Skip to content

fix(ci): push floating tags as the Release App, and cover the move with real tests - #1509

Merged
c-vigo merged 2 commits into
devfrom
bugfix/1508-floating-tag-app-identity
Aug 14, 2026
Merged

c-vigo merged 2 commits into
devfrom
bugfix/1508-floating-tag-app-identity

Conversation

@c-vigo

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

Copy link
Copy Markdown
Contributor

Description

Third instance of the identity bug from #1503, this time in the floating-tags
job. The Release App token was embedded in the push URL while actions/checkout
persisted the default GITHUB_TOKEN as http.<host>.extraheader — and the
extraheader outranks URL userinfo, so the push authenticated as the Actions
identity, which the job denies (contents: read) and the Tag ruleset does not
bypass. The token the step went out of its way to plumb through was never used.

No released floating tag was ever wrong. The git push form arrived in
devkit 1.7.0 (e76c31da, Refs: #1377); the only two repos that set
DEVKIT_FLOATING_TAGS — vig-os/commit-action and vig-os/sync-issues-action —
are both still on 1.6.0, where move_tag used gh api and no checkout
credentials were involved. devkit's own promote workflow has no floating-tags
job. The path had simply never executed anywhere, which is why nothing caught it.

Type of Change

  • fix -- Bug fix
  • test -- Adding or updating tests

Changes Made

The fix (assets/workspace/.github/workflows/promote-release.yml):

  • Generate release app token moves before Checkout repository, and
    checkout takes token: ${{ steps.release_app_token.outputs.token }} — so the
    credentials git actually uses are the App's.
  • REMOTE_URL is gone; the shallow tag fetch and the force-push both use
    origin. The fetch matters as much as the push: on a private consumer an
    unauthenticated fetch fails outright.
  • contents: read stays, with an inline comment saying why — granting
    contents: write would "fix" a future 403 by moving tag pushes to the Actions
    identity, defeating the App-identity model the Tag ruleset depends on.

The tests. One existing pin, test_move_tag_force_pushes_with_explicit_app_token,
asserted the defect itself:

assert "x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}" in script

That is why #1377 looked done. It is replaced by pins on the ordering, the
checkout token, the absence of any URL userinfo in the job, and contents: read.

New tests/test_floating_tag_move.py runs the move step's real bash against
a throwaway file:// remote, with gh stubbed by a shim that answers the REST
ref reads from that same remote (so stub and fixture cannot drift):

An identity bug cannot be reproduced against a local remote (no auth), so
identity stays pinned structurally — but everything downstream of it is now
executed rather than grepped.

Changelog Entry

### Fixed

- **Floating tags: the promote-time push ran under the wrong identity**
  ([#1508](https://github.com/vig-os/devkit/issues/1508))
  ...

(Full entry in CHANGELOG.md under ## Unreleased → ### Fixed.)

Testing

  • Tests pass locally (just test, just test-bats, prek run --all-files)
  • Manual testing performed (describe below)

RED-before-GREEN. Against the unfixed workflow the three new shape pins failed,
and all 8 behaviour tests failed — informatively: the old script builds its
remote from GITHUB_REPOSITORY, so it tried to reach the real
github.com/vig-os/testrepo and died on Authentication failed after 130s of
retry backoff. After the fix the same suite runs against origin in 18s, 28
passed.

Full local run: prek run --all-files clean; 1466 passed, 3 skipped (the two
known-environmental failures deselected — stale locally-built image vs. an edited
CHANGELOG.md, and a missing dbus-launch); full bats suite clean.

Manual Testing Details

Evidence gathered while confirming the report, all on the 1.6.0 (REST) path:

The extraheader precedence itself was reproduced outside CI against a private
repo with the credential helper disabled: valid token in the extraheader plus a
deliberately bogus token in the URL userinfo still authenticates, while the bogus
userinfo alone fails.

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly — none needed:
    docs/MIGRATION.md#first-release-floating-tags documents the human
    bootstrap for a repo whose promote workflow does not exist yet, which this
    does not change
  • I have updated CHANGELOG.md in the [Unreleased] section
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Additional Notes

This unblocks an upgrade. commit-action and sync-issues-action cannot
safely leave 1.6.0 until this ships: today their tag moves work and only the
first creation of a new level fails (#1157); on 1.7.0–1.9.x the push runs as
the wrong identity, so the moves would break too. With this fix, both cases go
through the App identity for the first time.

Whether #1377 actually fixed #1157 is now testable but still unproven in
production.
The premise — the App is a bypass actor for git push where it is
not for POST /git/refs — is unchanged and untested against a live ruleset,
because the push never ran as the App. The first real confirmation will be the
next new floating level on one of those two repos after they adopt this.

Deliberately untouched. The Cleanup git RC tags job still builds a
x-access-token: URL for a git ls-remote (promote-release.yml:562, and the
same line in devkit's own copy). The token there is likewise ignored, but the
operation is a read that succeeds under either identity, and its ref deletions
go through gh api -X DELETE, which uses GH_TOKEN correctly. Dead weight, not
a defect — out of scope here.

Refs: #1508

c-vigo added 2 commits August 14, 2026 10:07
The shape pins asserted the steps existed and one of them asserted the defect
itself (the App token embedded in the push URL). Replace that pin with the
identity/ordering the fix requires, and add a behaviour suite that runs the
move step's real bash against a throwaway file:// remote with gh stubbed from
that same remote, covering create, move, skip, annotated peel and refusal.

Refs: #1508
…ntials

The App token was embedded in the push URL, but checkout's persisted
extraheader outranks URL userinfo, so the push ran under the Actions identity
that contents: read denies and the Tag ruleset does not bypass. Generate the
token before checkout and check out with it; fetch and push via origin.

Refs: #1508
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