Repository navigation
fix(azure): pin the resource-manager-schemas source — codegen stops drifting with upstream main (#1144) - #1145
Merged
Merged
Conversation
…rifting with upstream main (#1144) The ARM schema fetch pulled refs/heads/main.tar.gz unpinned, so a cold ~/.chant cache regenerated against whatever upstream state currently existed while a warm cache kept serving the old one — nondeterministic per-runner CI failures (bit PR #1141). Pin to a commit SHA instead, following the fly (#814) single-source-pin precedent, and name the cache file after the pin so a stale cached tarball can never mask a bump. At the pinned commit, Microsoft.Compute's naive "latest date wins" schema selection picks a disk-only delta file that drops virtualMachines, virtualMachineScaleSets, and availabilitySets entirely (Azure alternates "VM flavor" and "disk flavor" snapshots of this file rather than publishing one cumulative one). Extend PROVIDER_VERSION_OVERRIDES (previously just Microsoft.Authorization, #223) to pin Microsoft.Compute to the last date that still has the VM family, restoring the composites' and validate.ts's expected exports without touching any composite source.
This was referenced Jul 27, 2026
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.
Summary
lexicons/azure/src/spec/fetch.tsfetchedrefs/heads/main.tar.gzofAzure/azure-resource-manager-schemasunpinned. A cold~/.chantcache regenerated against whatever upstream state currently existed; a warm cache kept serving whatever was current when it was last filled — nondeterministic per-runner CI failures depending on cache warmth (bit PR fix(cli): --flag=value works everywhere, unknown flags error — nothing silently drops (#1127) #1141's first run while main passed the same hour on a warm cache).AZURE_SCHEMA_COMMIT, current upstreammainHEAD at the time of this PR:0085cb6f3a98e735359807143bcb1667aeec930f), following the fly emulator-pin precedent (fly: single-source the mudflaps/spritzer emulator image pins #814). The constant's docstring records the bump procedure and notes epic: scheduled lexicon spec upgrades (auto-PR from latest upstream specs) #523's rolling-spec-drift sub-issue (feat(codegen): rolling-spec drift pipeline (aws, azure, github) #526) is meant to eventually propose bumps here automatically.azure-resource-manager-schemas-<sha>.tar.gz) so a stale tarball from before a bump can never mask the bump — a GitHub Actions cacherestore-keyspartial-key fallback, or a developer's pre-existing~/.chant, simply misses the new filename and re-downloads instead of silently serving pre-bump schemas.Microsoft.Compute's naive "latest date wins" schema selection (latestVersionPerProvider) picks a disk-only delta file (2026-03-02) that dropsvirtualMachines,virtualMachineScaleSets, andavailabilitySetsentirely — Azure alternates a "VM flavor" and a "disk flavor" snapshot of this file across dates rather than publishing one cumulative file, so this isn't a rename, it's an omission. ExtendsPROVIDER_VERSION_OVERRIDES(previously onlyMicrosoft.Authorization, bug(azure): lexicon no longer generates Microsoft.Authorization/roleAssignments — breaks k8s-aks-microservice #223) with aMicrosoft.Compute: "2026-03-01"entry — the latest date that still has the VM family — which restoresVirtualMachine/VirtualMachineScaleSet/AvailabilitySetgeneration under their original names. No composite source changes were needed as a result (composites/vm-linux.tsstill importsVirtualMachineunchanged).api-versions.test.ts: the existing "picks the latest API version per provider" test usedMicrosoft.Computeas its no-override example, which now conflicts with the new override — swapped it forMicrosoft.Network, and added a new test asserting the override itself picks2026-03-01over the naive2026-03-02.Other lexicons audited (per #1144, filing separately)
COMPOSE_SPEC_URLinlexicons/docker/src/codegen/versions.tsfetchesraw.githubusercontent.com/compose-spec/compose-spec/master/schema/compose-spec.json— the same unpinned-moving-git-ref shape as this bug (a live file offmaster, not a tagged release).ENGINE_API_URLin the same file is already pinned to a tag (v27.3.1) and is fine.KCC_VERSION), k8s (K8S_SCHEMA_VERSION), gitlab (GITLAB_SCHEMA_VERSION): already pinned to tagged releases. Fine.github-workflow.json), fly (docs.machines.dev/openapi.json), aws (CloudFormation's own published schema zip): all fetch a live "current" endpoint with no git ref/branch and no tag/release scheme to pin against — already classified as "rolling, nothing to bump" in epic: scheduled lexicon spec upgrades (auto-PR from latest upstream specs) #523, same as fly's own documented rationale. Not the same failure mode (no git-branch-tarball non-determinism), so not touched here.CI cache-key check
.github/workflows/chant.yml's "Cache lexicon schemas" step keys onhashFiles('lexicons/*/src/**/fetch.ts', 'lexicons/*/src/**/versions.ts'). The pin constant lives directly inlexicons/azure/src/spec/fetch.ts, which matches that glob, so bumpingAZURE_SCHEMA_COMMITchanges the file's content hash and rotates the cache key automatically — no workflow change needed. Verified this is the actual key derivation (not assumed).Test plan
All run against a cold cache (a temp
HOMEoverride,~/.chanton the actual machine untouched):npm run generate -w @intentius/chant-lexicon-azureclean from a truly empty cache — cache file lands asazure-resource-manager-schemas-0085cb6f3a98e735359807143bcb1667aeec930f.tar.gznpm run build -w @intentius/chant-lexicon-azureclean (~27s, not the historical 17-minute regression territory)npm run validate -w @intentius/chant-lexicon-azure— all checks OK includingrequired-names(VirtualMachine/VirtualMachineScaleSet/AvailabilitySet present)just build/just lint/just testall green (771 test files, 8996 tests passed, 5 skipped)just check-lexicons— azure 17/17, no regression (github's pre-existing 15/17 known-tracked failures, bug(github): 'expression' intrinsic is registered but never exported from src/index.ts #1069, untouched)examples/fold-differential.test.ts(part ofjust test) —drift: 0, unchanged from baseline