Repository navigation
fix: advance lockstep release pins during upgrades - #1988
Merged
Merged
Conversation
gerchowl
added a commit
that referenced
this pull request
Nov 3, 2026
## Description Carry #1856 / PR #1988 into the 1.18.2 hotfix. A target installer now advances release pins that matched the consumer's previous version, recognizes qualified and v-prefixed refs, and reports retained-pin mismatches with advice that respects opt-out. Targets `release/1.18.2`; no merge or release dispatch is requested. ## Type of Change <!-- Mark the relevant option(s) with an 'x' --> - [ ] `feat` -- New feature - [x] `fix` -- Bug fix - [ ] `docs` -- Documentation only - [ ] `chore` -- Maintenance task (deps, config, etc.) - [ ] `refactor` -- Code restructuring (no behavior change) - [x] `test` -- Adding or updating tests - [ ] `ci` -- CI/CD pipeline changes - [ ] `build` -- Build system or dependency changes - [ ] `revert` -- Reverts a previous commit - [ ] `style` -- Code style (formatting, whitespace) ### Modifiers - [ ] Breaking change (`!`) -- This change breaks backward compatibility ## Changes Made - Cherry-picked all four PR #1988 commits in order with provenance retained before the final Refs line. - Adapted the missing dev-only test harness to the 1.18.1 container installer boundary: a minimal test-only runtime stand-in executes the real scaffold. All 18 policy cases and assertions remain AST-identical to dev. - The hotfix used `seed`; Fixed, Changed and migration entries are under `[1.18.2] - TBD`. The sync-manifest hook regenerates the workspace mirror. ## Changelog Entry ### Changed - **Default lockstep pin advancement** ([#1856](#1856)): lockstep release pins advance unless `DEVKIT_FLAKE_PIN_ADVANCE=false`. ### Fixed - **Advance lockstep release pins during upgrades** ([#1856](#1856)) - The target installer advances release pins matching the pre-upgrade version by default, keeping the scaffold and dev shell aligned even through older upgrade workflows. - Recognize qualified release refs, preserve `refs/tags/`, and report removal of a leading `v` to use published bare tags. - Preserve explicit pin-advance settings; report every retained-pin mismatch, including failed updates and missing Nix, with manual-alignment advice that honors an explicit opt-out. - Migration: affected direnv/both consumers can set `DEVKIT_FLAKE_PIN_ADVANCE=false` to opt out and align pins manually; see [the migration note](docs/MIGRATION.md#lockstep-flake-pins-during-upgrades). ## Testing Commands ran inside `nix develop`: - `uv run --with pytest-xdist pytest tests/test_install_direnv_host.py tests/test_flake_pin_lockstep.py -n 2 --basetemp=$HOME/.cache/devkit-pytest/1856-carry-final`: 35 passed, exit 0. - `uv run --with pytest-xdist pytest tests/test_utils.py::TestInstallScriptUnit -n 2 --basetemp=$HOME/.cache/devkit-pytest/1856-carry-unit`: 3 passed, exit 0. - `bats tests/bats/install.bats`: 107 passed, exit 0. - RED evidence: initial policy tests had 4 failures / 1 pass, exit 1; round-two tests against the initial implementation had 10 failures / 8 passes, exit 1. - Commit hooks passed; `git diff --check` passed. Full suites are delegated to PR CI. - [ ] Tests pass locally (`just test`) - [ ] Manual testing performed (describe below) ### Manual Testing Details Compared every carried file with `origin/dev` using `git diff`: - `install.sh`: the entire post-initialization section, including policy, normalization, rollback and warnings, is byte-identical. Earlier differences retain 1.18.1 container scaffolding, version resolution, preflight and environment forwarding rather than importing #1871/#1826 and runner migrations. - `assets/init-workspace.sh`: the pin-knob preservation change matches dev; remaining differences are existing Rust config seeding / pack support, untracked-file preflight, gitignore rendering, runner lane validation/migration and extension-hook reconciliation. - `assets/workspace/.github/workflows/ci.yml`: lockstep normalization matches dev; existing runner selection, checkout paths and container-based drift checks stay on the release baseline. - `assets/workspace/.vig-os`: pin-policy documentation matches dev; existing runner documentation and absence of lane-size settings remain from the release baseline. - `docs/DOWNSTREAM_RELEASE.md` and its workspace mirror: upgrade-policy prose matches dev; only the existing runner-json contract differs. - `docs/MIGRATION.md`: the #1856 migration section is byte-identical; remaining differences retain release-baseline runner contracts/migration guidance, manifest and language descriptions, shell/env guidance, preflight behavior, and absence of the dev-only site-leak hook. - `tests/test_flake_pin_lockstep.py`: byte-identical to dev. - `tests/bats/install.bats`: carried assertions match dev; existing preflight tests remain, fixture modes use direnv through the hotfix container path rather than dev's both mode, and dry-run targets retain the baseline behavior. - `tests/test_install_direnv_host.py`: all policy decorators, function code and assertions match dev as an AST. Only minimal harness helpers are carried; unrelated dev host-scaffolding and migration tests are absent. The runtime stand-in replaces dev's Nix metadata/develop replay and records unexpected calls. - Root and mirrored changelogs retain hotfix/released history instead of unrelated dev Unreleased entries; #1856 entries are relocated to 1.18.2. The mirror uses the repository's manifest transforms. ## Checklist <!-- Mark completed items with an 'x' --> - [x] My code follows the project's style guidelines - [x] I have performed a self-review of my code - [ ] I have commented my code, particularly in hard-to-understand areas - [x] I have updated the documentation accordingly (edit `docs/templates/`, then run `just docs`) - [x] I have updated `CHANGELOG.md` in `[1.18.2] - TBD` per the hotfix brief (entry above) - [x] My changes generate no new warnings or errors - [x] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [x] Any dependent changes have been merged and published ## Additional Notes The brief explicitly overrides the generic dev-base and Unreleased instructions for this hotfix carry. Refs: #1856 <!-- Please include GitHub issue references in the "Refs:" line above (e.g., `Refs: #42`). Every change must be traceable to an issue, per project rules. If not related to a specific issue, explain why (chore/documentation only). See [commit-messages.mdc](../../rules/commit-messages.mdc) for more details. -->
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
A consumer upgrading a release-pinned devkit input could receive new scaffold hooks while retaining the old dev shell, preventing the adoption commit and PR. The target installer now advances release pins that matched the pre-upgrade DEVKIT_VERSION by default, using the existing atomic pin/lock update.
Type of Change
fix-- Bug fixtest-- Adding or updating testsModifiers
!) -- This change breaks backward compatibilityChanges Made
Changelog Entry
Changed
DEVKIT_FLAKE_PIN_ADVANCE=false.Fixed
refs/tags/, and report removal of a leadingvto use published bare tags.DEVKIT_FLAKE_PIN_ADVANCE=falseto opt out and align pins manually; see the migration note.Testing
Manual Testing Details
Checklist
Additional Notes
Migration: direnv/both consumers with a lockstep release pin and an empty knob now advance automatically. Set DEVKIT_FLAKE_PIN_ADVANCE=false to opt out, then align the release pin and lock manually before committing. Branch/revision refs and atomic rollback remain unchanged. No merge or release dispatch.
Refs: #1856