From a0b7bc07ff228b9755c758f244d4336d2ab1d3b4 Mon Sep 17 00:00:00 2001 From: Libba Lawrence Date: Thu, 23 Jul 2026 15:07:41 -0700 Subject: [PATCH] fix(python-integration): build mock specs from source to end client/mock skew The "Python Integration -> Mock API Tests" job regenerated the client from the checked-out Azure/typespec-azure `main` `.tsp` source, but overwrote the mock server dist (`azure-http-specs`/`http-specs`) with the versions resolved via http-client-python's `package.json` pin (currently `@azure-tools/azure-http-specs@0.1.0-alpha.43`). Whenever typespec-azure `main` advanced a spec beyond the pinned bundle, the client and mock disagreed and otherwise-green http-client-python PRs failed with body-validation errors unrelated to the PR (e.g. the 4 `test_arm_resource_identifiers_*` common-properties failures after Azure/typespec-azure#4891 added `armIdWithGroupScope`). Build the mock servers from the same checked-out source used to regenerate the client instead of pinning them, keeping client and mock in lockstep and removing this class of failure. This intentionally does not bump the `azure-http-specs` pin: alpha.44 requires typespec-azure 0.71-dev features (`ServiceGroup`) that the emitter''s pinned ~0.70.0 libraries can''t compile, which would break `npm run regenerate` / the RegenCheck. Fixes #11348. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8f756746-2ff4-4e4f-9f15-23f07a9d11fe --- .github/workflows/python-integration.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/python-integration.yml b/.github/workflows/python-integration.yml index 34390a3abc7..a5b548fc142 100644 --- a/.github/workflows/python-integration.yml +++ b/.github/workflows/python-integration.yml @@ -67,12 +67,15 @@ jobs: - name: Build run: pnpm turbo run --filter "@azure-tools/typespec-python..." build - - name: Use pinned http-specs versions - run: | - rm -rf core/packages/http-specs/dist - cp -r core/packages/http-client-python/node_modules/@typespec/http-specs/dist core/packages/http-specs/dist - rm -rf packages/azure-http-specs/dist - cp -r core/packages/http-client-python/node_modules/@azure-tools/azure-http-specs/dist packages/azure-http-specs/dist + - name: Build http-specs and azure-http-specs from source + # Build the mock servers from the checked-out typespec-azure (+ PR core) + # source, so the mock stays in lockstep with the client that is + # regenerated from the same source below. Previously these build outputs + # were overwritten with the versions resolved via http-client-python's + # package.json pin, which caused client/mock spec skew whenever + # typespec-azure main advanced a spec beyond the pinned bundle and failed + # otherwise-green PRs. See microsoft/typespec#11348. + run: pnpm turbo run build --filter "@typespec/http-specs..." --filter "@azure-tools/azure-http-specs..." - name: Prepare Python environment run: pnpm run prepare