Skip to content

fix(release): publish the release tag as a lightweight ref - #1374

Merged
c-vigo merged 2 commits into
devfrom
bugfix/1370-lightweight-release-tag
Aug 7, 2026
Merged

c-vigo merged 2 commits into
devfrom
bugfix/1370-lightweight-release-tag

Conversation

@c-vigo

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

Copy link
Copy Markdown
Contributor

Description

Every release tag devkit publishes is an annotated tag object with an unsigned
tagger
. release.yml created it with git tag -a under
vigOS Release Bot <[email protected]> and pushed it. Live evidence on tag
1.6.0:

$ gh api repos/vig-os/devkit/git/refs/tags/1.6.0 --jq '.object.type'
tag
$ gh api repos/vig-os/devkit/git/tags/bad7b6a18ae645ccc19b4cb838c57c4e80543963 \
    --jq '.verification.reason'
unsigned
$ gh api repos/vig-os/devkit/commits/b590198a6956eb0bf75aec706d12b9d16728153e \
    --jq '.commit.verification.reason'
valid

The release commit is GitHub-verified; the tag pointing at it is not.

Signing that tag object is not reachable. It is written under the Release
GitHub App installation token, and an App has no registrable GPG/SSH key, so
no git tag -s variant can ever render as Verified. Creating the object
server-side with POST /git/tags does not help either — that Git Data route
stores the payload verbatim and GitHub does not sign it, so the result is again
reason: "unsigned".

So the fix is to stop creating a tag object at all.

Type of Change

  • fix -- Bug fix

Changes Made

  • .github/workflows/release.yml
    • "Create annotated tag" + "Push tag" are replaced by a single Create
      release tag
      step that POSTs refs/tags/<version> at
      needs.finalize.outputs.finalize_sha via
      gh api -X POST repos/{owner}/{repo}/git/refs, using the Release App token
      the job already generates. A lightweight tag has no tagger and no
      payload, so there is nothing left that can report unsigned; the object the
      ref resolves to is the GitHub-verified release commit.
    • Behaviour preserved: the step is still skipped when
      finalize.outputs.tag_already_exists == 'true'; a candidate run still
      fails when the RC tag already exists on origin (concurrent-publish
      detection); a failed create is still accepted only when the remote ref
      already resolves to the finalize SHA, and errors loudly on a mismatch.
    • The publish job's "Configure git" step is removed — that identity existed
      solely to be the tagger — and with it the now-unreferenced
      git-user-name / git-user-email workflow_dispatch inputs.
      prepare-release.yml, which actually writes commits, keeps its own.
      justfile.gh never passed them.
  • docs/RELEASE_CYCLE.md — the publish-job description no longer claims an
    annotated tag and records why.
  • tests/test_workflow_release_lightweight_tag.py — new workflow-shape test
    (committed RED first).

Checked and left alone, because they are already annotation-agnostic:
prepare-release.yml (existence check only), promote-release.yml (deletes RC
tags by ref; devkit has no floating tags), prepare-release-extension.yml (no
tag handling). release.yml's own tag_already_exists probe and the create
fallback already peel refs/tags/<v>^{} and fall back to the plain ref, so both
tag shapes resolve. No git describe anywhere in the repo.

SECURITY.md needed no change — it never claimed signed tags (it advertises
cosign image signatures, SLSA provenance and SBOM attestation, all unaffected).

Out of scope

  • The scaffold shipped to consumers
    (assets/workspace/.github/workflows/release-publish.yml) still runs
    git tag -a, and docs/MIGRATION.md documents peeling its annotated tags.
    Worth a follow-up; changing it here would drift every consumer for a fix that
    is about devkit's own release chain.
  • Tag immutability is a ruleset concern. A tag ruleset is being added
    separately in vig-os/org-config; nothing in this PR depends on it.

Changelog Entry

### Security

- **Release tags are lightweight refs, so no unsigned object remains in the release chain** ([#1370](https://github.com/vig-os/devkit/issues/1370))
  - `release.yml` created the tag with `git tag -a` under
    `vigOS Release Bot <[email protected]>`, producing an **annotated tag
    object** whose tagger was permanently unverifiable — live tag `1.6.0`
    reports `verification.reason: "unsigned"`. Signing it was never reachable:
    the tag is written under the Release **App** installation token and a GitHub
    App has no registrable GPG/SSH key, while the server-side `POST /git/tags`
    route stores the payload verbatim without signing it either.
  - The publish job now creates the tag as a plain `refs/tags/<version>` ref at
    the release commit (`POST /git/refs`). A lightweight tag has no tagger and
    no payload, so there is nothing left that can report `unsigned`, and the
    commit the ref resolves to is the GitHub-verified release commit. The
    candidate-collision guard and the "already tagged at the finalize SHA"
    skip are unchanged; the now-unused `git-user-name` / `git-user-email`
    dispatch inputs are removed from `release.yml` (`prepare-release.yml`, which
    actually writes commits, keeps its own).

Testing

  • Tests pass locally
  • Manual testing performed (describe below)

Manual Testing Details

  • uv run pytest tests/test_workflow_release_lightweight_tag.py — RED (4 failed)
    before the workflow change, GREEN (5 passed) after.
  • Full lightweight suite: uv run pytest tests/ <CI ignore set> packages/vig-utils/tests — 909 passed.
  • prek run --all-files — green (actionlint, shellcheck, yamllint,
    check-action-pins, sync-manifest all clean).
  • The release path itself is only exercised by a real release; the next
    candidate publish is the acceptance test —
    gh api repos/vig-os/devkit/git/refs/tags/<version> --jq '.object.type' must
    report commit, not tag.

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
  • 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

Refs: #1370

@c-vigo
c-vigo merged commit d3d9f00 into dev Aug 7, 2026
13 checks passed
@c-vigo
c-vigo deleted the bugfix/1370-lightweight-release-tag branch August 7, 2026 15:16
c-vigo added a commit that referenced this pull request Aug 7, 2026
…#1382)

## Description

Every repo devkit scaffolds published its `X.Y.Z` release tag through
`assets/workspace/.github/workflows/release-publish.yml`, which ran
`git config user.*` + `git tag -a` + `git push` under a GitHub App identity —
an **annotated tag object** whose tagger reports
`verification.reason: "unsigned"` permanently. The reasoning from #1370
transfers unchanged: an App has no registrable GPG/SSH key, and
`POST /git/tags` is not signed server-side either, so the only fix is to not
create a tag object at all. The scaffold was also internally inconsistent:
`promote-release.yml` already creates the *floating* tags (`vX`, `vX.Y`) as
lightweight refs (#1045/#1157), leaving only the version tag — the one users
pin and audit — unsigned.

## Type of Change

- [x] `fix` -- Bug fix

## Changes Made

- `assets/workspace/.github/workflows/release-publish.yml`
  - "Configure git" + "Create and push tag" are replaced by a single
    **Create release tag** step mirroring devkit's own `release.yml` from
    PR #1374: `gh api -X POST repos/{owner}/{repo}/git/refs` writes
    `refs/tags/<prefix><version>` straight at `inputs.finalize_sha`, using the
    same resolved auth token (`secrets.token` or the Release App token).
  - Behaviours carried over, per the issue's acceptance criteria:
    - the `tag_already_exists` skip (`if: ${{ !inputs.tag_already_exists }}`)
      is unchanged;
    - the create-race verification accepts a lost race **only** when the
      existing ref already resolves to the release commit (peeled `^{}` first,
      plain ref fallback, so pre-change annotated tags still resolve);
    - `TAG_PREFIX` composition (#1044): the created ref is
      `refs/tags/${TAG_PREFIX}${PUBLISH_VERSION}`;
    - **GH013 tombstone diagnosis** (#1319): the signature match is re-derived
      against the `POST /git/refs` error surface — the repository-rules 422
      body says `Cannot create ref due to creations being restricted.` while
      the git-protocol shape stays `GH013 ... creations restricted`, so the
      grep is now `GH013|creations?( being)? restricted`. The shape test
      exercises the extracted pattern against both shapes and asserts the
      benign lost-race shape (`Reference already exists`) does NOT match.
  - The dead `git_user_name` / `git_user_email` `workflow_call` inputs are
    removed.
- `assets/workspace/.github/workflows/release.yml` — the two identity
  pass-throughs in the `publish` call are removed. The `git-user-name` /
  `git-user-email` **`workflow_dispatch` inputs stay**, as the issue requires:
  the rollback job still checks out the release branch and writes with that
  identity (the asymmetry with #1374).
- `assets/workspace/.github/workflows/promote-release.yml` — the "creates an
  ANNOTATED tag" comment is corrected; the `object.type == "tag"` peel itself
  stays as backward compatibility for tags published by older scaffolds.
- `docs/MIGRATION.md` — same treatment for the first-release floating-tags
  runbook (~L1028): claim corrected, peel snippet kept (it handles both
  shapes).
- `tests/test_workflow_release_publish_lightweight_tag.py` — new workflow-shape
  test mirroring `tests/test_workflow_release_lightweight_tag.py` for the
  scaffold (committed RED first).
- `tests/test_release_tombstone_detection.py` — tag-side tests re-pointed at
  the **Create release tag** step and upgraded to execute the extracted grep
  pattern against the observed error shapes instead of asserting substrings.

## Out of scope

- The optional `persist-credentials` cleanup from the issue is deliberately
  **not** bundled: after this change the publish job still runs
  `git ls-remote origin` for the create-race verification, which needs the
  persisted checkout credential on private consumer repos — the credential is
  not dead. Same situation in devkit's own `release.yml` post-#1374. If it is
  to be dropped, the verification must move to `gh api` first; that is its own
  change.
- Existing annotated consumer tags are left as they are (forward-fix policy;
  immutable releases lock them anyway). The change reaches consumers on their
  next `devkit-upgrade` / re-scaffold; until then `scaffold-drift` flags them.

## Changelog Entry

Added under `## Unreleased` → `### Security`, directly after the sibling #1370
entry (mirrored into `assets/workspace/.devcontainer/CHANGELOG.md` by
`sync-manifest`).

## Testing

- `uv run pytest tests/test_workflow_release_publish_lightweight_tag.py tests/test_release_tombstone_detection.py`
  — RED before the workflow change (10 failed / 3 passed), GREEN after
  (13 passed).
- Full lightweight suite (CI `test-project` scope + `packages/vig-utils/tests`):
  **950 passed**.
- Full bats suite: 575 ok; the 9 `githooks.bats` IN_CONTAINER-guard failures
  are environmental (the runner shell exports `IN_NIX_SHELL`, which the guard
  sanctions) — all 12 pass with `env -u IN_NIX_SHELL bats tests/bats/githooks.bats`.
  The rendered-template actionlint tests passed.
- `just precommit` (`prek run --all-files`) — fully green.
- The live path is only provable on a real release: acceptance is
  `gh api repos/vig-os/devkit-smoke-test/git/refs/tags/<tag> --jq '.object.type'`
  reporting `commit`, not `tag`, on the next smoke-test release.

## Checklist

- [x] My code follows the project's style guidelines
- [x] I have performed a self-review of my code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have updated the documentation accordingly
- [x] I have updated `CHANGELOG.md` in the `[Unreleased]` section
- [x] My changes generate no new warnings or errors
- [x] I have added tests that prove my fix is effective
- [x] New and existing unit tests pass locally with my changes

Closes #1378
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