[python-integration] Build mock specs from source to fix client/mock skew#11377
Merged
l0lawrence merged 1 commit intoJul 24, 2026
Merged
Conversation
commit: |
Contributor
|
No changes needing a change description found. |
Contributor
Python emitter diffBaseline
Informational check (eng/emitter-diff); does not block the PR. |
|
You can try these changes here
|
l0lawrence
force-pushed
the
l0lawrence/bump-azure-http-specs-armidwithgroupscope
branch
from
July 23, 2026 22:45
0ca4385 to
ba40f80
Compare
…ock 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
l0lawrence
force-pushed
the
l0lawrence/bump-azure-http-specs-armidwithgroupscope
branch
2 times, most recently
from
July 24, 2026 16:46
a0b7bc0 to
6022145
Compare
l0lawrence
force-pushed
the
l0lawrence/bump-azure-http-specs-armidwithgroupscope
branch
from
July 24, 2026 17:11
6022145 to
a0b7bc0
Compare
iscai-msft
approved these changes
Jul 24, 2026
l0lawrence
marked this pull request as ready for review
July 24, 2026 18:23
l0lawrence
requested review from
bterlson,
catalinaperalta,
markcowl,
timotheeguerin and
witemple-msft
as code owners
July 24, 2026 18:23
xirzec
approved these changes
Jul 24, 2026
l0lawrence
deleted the
l0lawrence/bump-azure-http-specs-armidwithgroupscope
branch
July 24, 2026 19:37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Do we even need to pin devDep for http-specs then?
Summary
The Python Integration → Mock API Tests job (
.github/workflows/python-integration.yml) can fail on http-client-python PRs with body-validation errors unrelated to the PR under test, due to a client/mock spec skew.Root cause
The job:
Azure/typespec-azuremain.tspsource, butazure-http-specs/http-specs) with the versions resolved viahttp-client-python'spackage.jsonpin (@azure-tools/azure-http-specs@0.1.0-alpha.43).Whenever
typespec-azuremainadvances a spec beyond the pinned bundle, client and mock disagree. After Azure/typespec-azure#4891 added thearmIdWithGroupScopeARM common property, the regenerated client sends 5propertiesbut the pinned alpha.43 mock expects 4 → the 4test_arm_resource_identifiers_*failures on every Python PR.The change
Build the mock servers from the same checked-out source used to regenerate the client, instead of pinning them to the http-client-python-resolved version. Client and mock stay in lockstep, removing this entire class of failure (issue #11348, option 3).
The
@azure-tools/azure-http-specsdevDependency pin is intentionally left atalpha.43— it is still needed by the emitter's ownnpm run regenerate(which resolves specs fromnode_modules/@azure-tools/azure-http-specs/specs) and its RegenCheck. This change only decouples the mock server from that pin.Because this PR edits
python-integration.yml(a trigger path), the workflow's own run here validates the fix.Why not just bump the
azure-http-specspin?Tried and rejected. Bumping to
0.1.0-alpha.44-dev.5makes Mock API Tests pass, but breaks the blockingtypespec - ci … RegenCheck: the emitter'snpm run regeneratecompiles specs from the bundle against its pinned@azure-tools/typespec-azure-*: ~0.70.0, and every published alpha.44 build also pulls in the newservice-groupspec /ServiceGroupscope, which requires typespec-azure 0.71-dev (only dev pre-releases exist; no stable 0.71). RegenCheck failed on both linux and windows in that attempt. This workflow-only fix avoids that skew entirely and leaves the pin untouched.Fixes
Closes #11348 — including the 4
test_arm_resource_identifiers_*Mock API failures.