Repository navigation
feat: advance a pinned devkit flake input on upgrade and gate scaffold/toolchain skew in CI - #1768
Merged
Merged
Conversation
…input advance RED: the template must ship the knob empty, round-trip it across --force and refuse an unknown value; install.sh must advance a pinned release ref (both forms, form preserved, atomic with the lock) only under the knob, and report exactly one flake-bump: line per outcome. Regression pins (floating advance under the knob, no flake-bump: line outside the outer gate) already pass. Refs: #1752, #1756
… DEVKIT_FLAKE_PIN_ADVANCE A pinned devkit input was never advanced, so a pinned consumer's adoption moved DEVKIT_VERSION while its dev shell kept the previous release's toolchain. With DEVKIT_FLAKE_PIN_ADVANCE=true, an install.sh --force upgrade rewrites a release pin (?ref=X or /X, form preserved) to the new DEVKIT_VERSION and locks it with nix flake update, restoring both files on failure. Empty or false keeps today's skip, now naming the knob. The scaffold guards the value and writes it back across upgrades. Refs: #1752, #1756
RED: ci.yml's resolve-toolchain job must fetch flake.nix and fail, right after the declared-languages gate, when a pinned devkit release ref differs from .vig-os DEVKIT_VERSION in direnv/both mode; floating inputs, non-release pins, an empty version, bare and devcontainer modes never fail it, and the step is skipped when a dispatch overrides the image tag. Refs: #1752, #1756
…s DEVKIT_VERSION A new resolve-toolchain step compares a pinned devkit release ref in flake.nix with .vig-os DEVKIT_VERSION for direnv/both consumers and fails on skew, so the toolchain jobs are skipped and the summary gate reports it. The error names the one-commit remedy and DEVKIT_FLAKE_PIN_ADVANCE. The sparse checkout fetches flake.nix; the parse regex is shared byte-for-byte with the scaffold's lagging-pin warning. Refs: #1752, #1756
…_VERSION gate MIGRATION.md gains the manifest-key row, an Updating note and a rewritten lockstep section (the knob, the atomic advance, the CI gate, the one-commit first-adoption remedy, the Monday-cron clobber and the drift-off pre-set caveat). DOWNSTREAM_RELEASE.md, the upgrade skill and the changelog follow. Refs: #1752, #1756
6 tasks
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.
Description
In
direnv/bothmode the scaffold and the toolchain are versioned twice:.vig-osDEVKIT_VERSIONdrives the scaffold, the devkit flake input's ref drives the dev shell. Anupgrade only moved the first, so a pinned consumer ran the previous release's tools against
the new scaffold — surfacing as
prepare-changelog seed: invalid choicemid-release(vig-os/scitadel#225) and as
shellcheck-composite-actions: Failed to spawnon theadoption PR itself (vig-os/tessera#445, #1756). The installer's
flake-bump: skippedline was the only signal, and no gate could see it:
flake.nixis aPRESERVE_FILE.This PR closes the gap on both axes:
DEVKIT_FLAKE_PIN_ADVANCE(.vig-os,true | false | empty; empty = today). Withtrue,install.sh --forcerewrites a pinned RELEASE ref (?ref=Xor/X, formpreserved) to the new
DEVKIT_VERSIONand runsnix flake update <input>in the samestep. Atomic: if the lock update fails, or
nixis absent,flake.nixandflake.lockare left byte-identical. Non-release pins (
main,rev=<sha>,refs/tags/X) are nevertouched. Every outcome prints exactly one
flake-bump:line; the adoption PR body alreadycarries it, and the knob-off line now names the key.
ci.ymlgains aCheck flake pin lockstepstep in theresolve-toolchainjob (which now sparse-checks-outflake.nix). A pinned release refthat differs from
DEVKIT_VERSIONfails the job with an actionable::error::; floatinginputs, non-release pins (warning only),
bareanddevcontainermodes are never gated.It is deliberately independent of
DEVKIT_DRIFT_CHECK.devkit-upgrade.ymlneeds no change: it installs nix, commits withgit add -A, and liftsthe
flake-bump:line into the PR body already.Type of Change
feat-- New featurefix-- Bug fixdocs-- Documentation onlychore-- Maintenance task (deps, config, etc.)refactor-- Code restructuring (no behavior change)test-- Adding or updating testsci-- CI/CD pipeline changesbuild-- Build system or dependency changesrevert-- Reverts a previous commitstyle-- Code style (formatting, whitespace)Modifiers
!) -- This change breaks backward compatibilityChanges Made
assets/workspace/.vig-os— newDEVKIT_FLAKE_PIN_ADVANCEkey (ships empty) with itscontract comment, next to the other devkit-upgrade runtime knobs.
assets/init-workspace.sh— read,""|true|falsevalue guard (aborts loudly on a typo,also under
--preview), write-back for a non-empty value; cross-reference comment on thelagging-pin WARNING regex.
install.sh— the pinned branch of the flake-bump block: knob + new-version read,release-shape guards,
advance_pinned_input(line-targetedsedon the detected inputline, verification of that line, backup + restore of both flake files, one
mktemp -dunder
$TMPDIR, never in the project),advance_flake_lockshared with the floatingbranch; broad detector regex hoisted into
DEVKIT_INPUT_RE. Floating-path messages arebyte-identical to before.
assets/workspace/.github/workflows/ci.yml—flake.nixin theresolve-toolchainsparse checkout; new
Check flake pin lockstepstep (env-routed, skipped under aworkflow_dispatchimage-tagoverride, regex byte-identical to the scaffold'sWARNING regex).
tests/bats/install.bats(+12 cases: both pin forms, renamed input, doc-commentand sibling untouched, already-aligned, non-release pins, non-release
DEVKIT_VERSION,nix failure restores both files, no nix, unusable
TMPDIR, one-line-per-run; outer-gatetests now refute any
flake-bump:line),tests/bats/init-workspace.bats(round-tripand invalid-value rows),
tests/test_vig_os_manifest.py(MANIFEST_KEYSrow), newtests/test_flake_pin_lockstep.py(17 tests: sparse checkout, step placement,if,env routing, regex lockstep, executed gate body across every mode/pin case).
docs/MIGRATION.md(manifest table row, Updating, rewritten lockstep sectionwith the CI gate, first-adoption remedy and rollout caveats),
docs/DOWNSTREAM_RELEASE.md(+ synced copy),
plugins/devkit/skills/upgrade/SKILL.md,CHANGELOG.md(+ synced copy).Changelog Entry
Added
(#1752, #1756)
.vig-oskeyDEVKIT_FLAKE_PIN_ADVANCE. Withtrue, aninstall.sh --forceupgrade in direnv orbothmode rewrites a pinnedrelease ref (
?ref=Xor/X, form kept) to the newDEVKIT_VERSIONandruns
nix flake update <input>in the same step. If the lock update fails,flake.nixandflake.lockare both restored. Empty orfalse(default)leaves a pin untouched, and the
flake-bump:line now names the keyci.ymlfails itsresolve-toolchainjob when a pinnedrelease ref differs from
DEVKIT_VERSION, so an adoption PR can no longerwire hooks the pinned toolchain cannot run. Floating inputs, non-release
pins,
bareanddevcontainermodes are not gatedin one commit on that branch (bump the pin,
nix flake update <input>, setthe key) and merge it before the next weekly upgrade run replaces the
branch; see
docs/MIGRATION.mdTesting
just test)Manual Testing Details
just precommit(all hooks, all files): green, exit 0.bats tests/bats/install.bats: 107/107.bats -j $(nproc) tests/bats/init-workspace.bats:308/308 (includes the per-mode actionlint of the rendered
ci.yml). Fulljust test-bats:622/622.
uv run pytestovertest_flake_pin_lockstep.py test_vig_os_manifest.py test_declared_languages.py test_ci_runner.py test_scaffold_drift.py test_workflow_summary_gate.py test_workflow_zizmor_baseline.py test_workflow_devkit_upgrade.py:254 passed.
just lint: clean.actionlintandzizmor --offlineon the scaffoldedci.yml: no findings beyond dev's baseline.test:commit was run RED against the preceding tree (10 bats + 1 pytest + 2bats rows failing; 17 pytest failing), then GREEN after its
feat:commit. The gate testswere additionally checked against nine mutated copies of
ci.yml(step removed, bodyreplaced by
exit 0,ifremoved,flake.nixdropped from the sparse list, mode checkremoved,
|| trueremoved, …) — every mutant is caught.test_image.py/test_integration.pynot run locally (need the fresh image; CI covers).Checklist
docs/templates/, then runjust docs)CHANGELOG.mdin the[Unreleased]section (and pasted the entry above)Additional Notes
(
mainstill 1.6.0). Their adoption PR to the release that ships this is red at the newgate once, by design (its scaffold predates the opt-in). Remedy is one commit on the
adoption branch — bump the pin,
nix flake update <input>, set the knob — merged beforethe next Monday 06:00 UTC
devkit-upgraderun, which force-updates that branch. Pre-settingthe knob on the default branch ahead of the adoption is safe only for
DEVKIT_DRIFT_CHECK=falseconsumers: the scaffold-drift job re-scaffolds at the currentversion, which drops the unknown key.
posted there.
DEVKIT_VERSION=1.12.0with afloating input — a consumer chore,
devkit-stalenesscovers it); a--no-write-lock-fileon
devkit-upgrade.yml'snix develop -c git commit(pre-existing floating-path hazard,not triggered by this PR's atomic advance); Proposal B (advance when the pin equals the
outgoing version) — deliberately not done, a pin held at the outgoing version is not proof
of intent.
Refs: #1752, #1756
Closes #1752