Repository navigation
feat(codegen): pinned-version upgrade detection (k8s, gcp, docker, gitlab) - #530
Merged
Merged
Conversation
… gitlab Add checkPinnedUpgrade(lexiconDir): reads the pinned upstream version constant, queries GitHub for the latest stable release (skipping pre-release/rc tags), and when newer, dry-run bumps the constant, runs #524's regenLexicon to regen + surface-diff, then reverts the bump so the working tree is unchanged. Upstream-query and version-compare are pure/injectable functions (parseVersion, compareVersionTuples, isNewer, isPreRelease, REAL_RESOLVERS) so the bump/regen/revert flow is unit-testable with mocked upstream. Add `chant dev pinned-upgrade <dir>` CLI to report the result (text/json, semver label from surface severity). Reports only — branch/PR automation is out of scope (#527). Refs #525
This was referenced Jul 1, 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.
Part of #523. Implements #525.
What
checkPinnedUpgrade(lexiconDir)— pinned-version upgrade detection for the four pinned lexicons (k8s, gcp, docker, gitlab). It:regenLexiconto regen + surface-diff, then reverts the bump (dry run — the working tree is never left bumped).{ lexicon, hasUpgrade, from, to, validation, fetchError }wherevalidationcarries the regenseverity/delta.Pins covered
K8S_SCHEMA_VERSION(lexicons/k8s/src/spec/fetch.ts); upstream = kubernetes/kubernetes releases.KCC_VERSION(lexicons/gcp/src/spec/fetch.ts); upstream = GoogleCloudPlatform/k8s-config-connector releases.moby/moby/<tag>version embedded inENGINE_API_URL(lexicons/docker/src/codegen/versions.ts); upstream = moby/moby releases.GITLAB_SCHEMA_VERSION(lexicons/gitlab/src/codegen/fetch.ts); upstream = gitlab-org/gitlab tags with the-eesuffix.Design
parseVersion,compareVersionTuples,isNewer,isPreRelease, andREAL_RESOLVERS(per-lexicon GitHub API resolvers). Tests inject a mock resolver — no network, no live regen.finallyso it is undone even if regen throws.CLI
chant dev pinned-upgrade <lexicon-dir>— reports only (text or-f json, with aminor/majorsemver label derived from the surface severity). Lexicon inferred from the directory basename.Scope
Reporting only. Branch management,
gh pr createfor upgrades, and the scheduled runner are #527. Does not touch aws/azure/github (#526).Validation
npx tsc --noEmit -p packages/core/tsconfig.json— clean.npx vitest run packages/core/src/codegen/pinned-upgrade.test.ts— 21 passed (version parse/compare, pin read/bump/revert round-trip, and checkPinnedUpgrade upgrade/no-upgrade/fetch-error/revert-on-failure paths, all with mocked upstream).npx vitest run packages/core/src/cli/main.test.ts— 46 passed (registry/handler edits).Live end-to-end regen over the large lexicons is deferred to CI / the runner (#527).