Repository navigation
fix(upgrade): fetch install.sh from the target release tag - #1540
Merged
Merged
Conversation
The managed devkit-upgrade workflow fetches install.sh from main tip while
installing a pinned $TARGET. Assert the fetch URL uses refs/tags/${TARGET},
that TARGET stays env-routed, and that no main-tip installer fetch survives
anywhere in the template.
Refs: #1532
The managed devkit-upgrade workflow fetched the installer from main tip while
installing a pinned $TARGET, so the installer and the scaffold payload came
from different refs — an untested combination, and the one every scheduled
consumer run got whenever main was ahead of the latest release. It also left a
window where any push to devkit main immediately changed code executing with
contents: write in every consumer repo, with no review gate.
The fetch now uses refs/tags/${TARGET}/install.sh (double-quoted, since the URL
interpolates), reusing the TARGET already in the step's env.
No main fallback: verified with git ls-tree over all 61 tags that every tag
matching the resolve step's semver shape (X.Y.Z[-prerelease], 0.2.0 through
1.10.0) carries a root-level install.sh. The only tag without one is 0.1, whose
two-component name the resolve step's strict semver validation rejects, and
which releases/latest can never return.
Refs: #1532
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
Implements #1532 (surfaced by a Scorecard
Pinned-Dependenciesalert on commit-action): the manageddevkit-upgrade.ymlfetchedinstall.shfrommaintip while installing a pinned$TARGET— an untested installer/payload combination on most scheduled runs, and a window where any push to devkitmainimmediately changes code executing withcontents: writein every consumer repo.One functional line: the fetch is now
refs/tags/${TARGET}/install.sh(double-quoted;$TARGETreused from the step's existingenv:), with a rationale comment. The #1530reportjob is untouched.mainfallback, verified:git ls-treeover all 61 tags shows root-levelinstall.shin every tag from 0.2.0 through 1.10.0 including every rc; the sole miss (0.1) is unreachable — the resolve step's^X.Y.Z[-pre]$regex rejects it andreleases/latestnever returns it.main/install.shURL audited and kept: all remaining hits are unversioned human-driven bootstrap paths (README/template one-liners,install.shself-help text,version-check.sh's no-workflow hint, SOLO_ADOPTION/MIGRATION docs, archived issue text) — bootstrap frommainis correct when no version exists yet. The smoke-test workflows already fetch${TAG}/install.sh.Test plan
test_installer_is_fetched_from_the_target_release_tag: asserts the exact double-quotedrefs/tags/${TARGET}curl, theenv.TARGETwiring, and thatdevkit/main/install.shappears nowhere in the template (TDD red first: 1 failed against themainURL).test_bootstraps_installsh_and_commits_in_project_shellrelaxed to ref-agnostic — the ref pin is owned by the new test (DRY).tests/test_workflow_devkit_upgrade.py: 27 passed;prek run --all-filesexit 0 (verified independently of the implementation run).Rollout note: consumers pick this up one train after it ships (the workflow runs from their base branch).
Closes #1532