Skip to content

feat(codegen): rolling-spec drift detection for aws, azure, github (#526) - #531

Merged
lex00 merged 1 commit into
mainfrom
feat/526-rolling-upgrade
Jul 1, 2026
Merged

lex00 merged 1 commit into
mainfrom
feat/526-rolling-upgrade

Conversation

@lex00

@lex00 lex00 commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Closes #526. Part of #523. Builds on #524's regenLexicon + surface-diff tooling.

What

Rolling lexicons (aws, azure, github) pin no version constant — "latest" is fetched on every regen. This adds drift detection: regen from current-latest, diff the produced API surface against the committed surface.snapshot.json, and report whether the surface moved.

checkRollingUpgrade(lexiconDir)

Calls #524's regenLexicon (never reimplements it), diffs the fresh surface vs the committed baseline, and returns:

{ lexicon, hasUpgrade, severity, delta, deltaText, validationOk, failures, apiVersionDelta, freshSnapshot }
  • hasUpgrade — true only when the surface actually changed.
  • severity — additive (new resources / optional props / attrs) or breaking (removed / now-required / changed).
  • apiVersionDelta — azure only: per-provider API-version changes (added / updated / removed), derived from the ARM provider prefix of each resourceType.

The diff/decision logic is pure and unit-tested with fixture snapshots (no live upstream): classifyDelta, diffRollingSurface, computeAzureApiVersionDelta, diffAzureApiVersions, extractAzureProvider.

CLI (report-only)

chant dev rolling-upgrade <dir> regenerates, diffs, and prints the delta plus the PR label an upgrade would carry (additive → minor, breaking → major). Dry run only — it never opens a PR, updates a branch, or writes the baseline. PR automation + scheduling are #527.

Baseline seeding

Scope

No runtime PR automation, branch management, or scheduled workflow (that's #527). No changes to k8s/gcp/docker/gitlab (#525). Shared CLI-file edits kept minimal/additive.

Validation

  • npx tsc --noEmit -p packages/core/tsconfig.json — clean.
  • npx vitest run on rolling-upgrade + lexicon-regen + surface-snapshot — 61 passed.
  • End-to-end: chant dev rolling-upgrade lexicons/github regenerated from the cached latest spec and correctly reported hasUpgrade: false (unchanged surface → no PR).

)

Add checkRollingUpgrade(lexiconDir): regen from current-latest via #524's
regenLexicon, diff the fresh API surface against the committed
surface.snapshot.json, and report { lexicon, hasUpgrade, severity, delta,
validation }. For azure it also computes a per-provider API-version delta.

The diff/decision logic is factored into pure functions (classifyDelta,
diffRollingSurface, computeAzureApiVersionDelta, diffAzureApiVersions,
extractAzureProvider) unit-tested with fixture snapshots — no live upstream
required.

Adds `chant dev rolling-upgrade <dir>`, a dry-run reporter that prints the
surface delta and the PR label an upgrade would carry (additive -> minor,
breaking -> major). It only reports; PR automation and scheduling are #527.

Seeds the github surface baseline (22 entries). The azure baseline is
deferred: seeding it requires a full live regen over the 21MB ARM tarball,
left to the runner (#527).
@lex00
lex00 force-pushed the feat/526-rolling-upgrade branch from fb1edd5 to 4204db3 Compare July 1, 2026 23:17
@lex00
lex00 merged commit 64d36a5 into main Jul 1, 2026
6 checks passed
@lex00
lex00 deleted the feat/526-rolling-upgrade branch July 1, 2026 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(codegen): rolling-spec drift pipeline (aws, azure, github)

1 participant