Skip to content

fix(upgrade): fetch install.sh from the target release tag - #1540

Merged
c-vigo merged 2 commits into
devfrom
bugfix/1532-upgrade-installer-tag-pin
Aug 17, 2026
Merged

c-vigo merged 2 commits into
devfrom
bugfix/1532-upgrade-installer-tag-pin

Conversation

@c-vigo

@c-vigo c-vigo commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements #1532 (surfaced by a Scorecard Pinned-Dependencies alert on commit-action): the managed devkit-upgrade.yml fetched install.sh from main tip while installing a pinned $TARGET — an untested installer/payload combination on most scheduled runs, and a window where any push to devkit main immediately changes code executing with contents: write in every consumer repo.

One functional line: the fetch is now refs/tags/${TARGET}/install.sh (double-quoted; $TARGET reused from the step's existing env:), with a rationale comment. The #1530 report job is untouched.

  • No main fallback, verified: git ls-tree over all 61 tags shows root-level install.sh in 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 and releases/latest never returns it.
  • Every other main/install.sh URL audited and kept: all remaining hits are unversioned human-driven bootstrap paths (README/template one-liners, install.sh self-help text, version-check.sh's no-workflow hint, SOLO_ADOPTION/MIGRATION docs, archived issue text) — bootstrap from main is correct when no version exists yet. The smoke-test workflows already fetch ${TAG}/install.sh.
  • Out of scope per the issue: SHA-pinning (circular for a self-upgrading installer — the Scorecard alert is expected to remain and be dismissed consumer-side) and installer self-verification of its version (possible stronger follow-up).

Test plan

  • New test_installer_is_fetched_from_the_target_release_tag: asserts the exact double-quoted refs/tags/${TARGET} curl, the env.TARGET wiring, and that devkit/main/install.sh appears nowhere in the template (TDD red first: 1 failed against the main URL).
  • test_bootstraps_installsh_and_commits_in_project_shell relaxed to ref-agnostic — the ref pin is owned by the new test (DRY).
  • tests/test_workflow_devkit_upgrade.py: 27 passed; prek run --all-files exit 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

c-vigo added 2 commits August 17, 2026 13:51
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
@c-vigo
c-vigo merged commit e853dcb into dev Aug 17, 2026
12 checks passed
@c-vigo
c-vigo deleted the bugfix/1532-upgrade-installer-tag-pin branch August 17, 2026 12:09
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.

1 participant