Skip to content

Commit 34e0cda

Browse files
iscai-msftCopilot
andcommitted
fix: use azure-http-specs check instead of azure for spec path detection
The spec.includes('azure') check matched the runner directory path (azure-sdk-for-python) causing all specs to be treated as azure specs, producing incorrect package names like ..-..-..-@typespec-http-specs-... Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 95db199 commit 34e0cda

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

packages/http-client-python/eng/scripts/ci/regenerate-common.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ export function getEmitterOption(
363363
flavor: string,
364364
config: RegenerateConfig,
365365
): Record<string, string>[] {
366-
const specDir = spec.includes("azure") ? config.azureHttpSpecs : config.httpSpecs;
366+
const specDir = spec.includes("azure-http-specs") ? config.azureHttpSpecs : config.httpSpecs;
367367
const relativeSpec = toPosix(relative(specDir, spec));
368368
const key = relativeSpec.includes("resiliency/srv-driven/old.tsp")
369369
? relativeSpec

packages/http-client-python/eng/scripts/ci/regenerate.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,15 +124,19 @@ interface TaskGroup {
124124
tasks: CompileTask[];
125125
}
126126

127+
function isAzureSpec(spec: string): boolean {
128+
return spec.includes("azure-http-specs");
129+
}
130+
127131
function defaultPackageName(spec: string): string {
128-
const specDir = spec.includes("azure") ? AZURE_HTTP_SPECS : HTTP_SPECS;
132+
const specDir = isAzureSpec(spec) ? AZURE_HTTP_SPECS : HTTP_SPECS;
129133
return toPosix(relative(specDir, dirname(spec)))
130134
.replace(/\//g, "-")
131135
.toLowerCase();
132136
}
133137

134138
function getEmitterOptions(spec: string, flavor: string): Record<string, string>[] {
135-
const specDir = spec.includes("azure") ? AZURE_HTTP_SPECS : HTTP_SPECS;
139+
const specDir = isAzureSpec(spec) ? AZURE_HTTP_SPECS : HTTP_SPECS;
136140
const relativeSpec = toPosix(relative(specDir, spec));
137141
const key = relativeSpec.includes("resiliency/srv-driven/old.tsp")
138142
? relativeSpec
@@ -262,7 +266,7 @@ async function runParallel(groups: TaskGroup[], maxJobs: number): Promise<Map<st
262266
// Each group runs as a unit - tasks within a group run sequentially
263267
// But different groups can run in parallel
264268
const runGroup = async () => {
265-
const specDir = group.spec.includes("azure") ? AZURE_HTTP_SPECS : HTTP_SPECS;
269+
const specDir = isAzureSpec(group.spec) ? AZURE_HTTP_SPECS : HTTP_SPECS;
266270
const shortName = toPosix(relative(specDir, dirname(group.spec)));
267271

268272
// Run all tasks in this group sequentially to avoid state pollution

0 commit comments

Comments
 (0)