Skip to content

Make release-prep refuse a version the repository has already tagged - #11

Closed
glaubersilva wants to merge 1 commit into
mainfrom
soft-5188-release-prep-refuse-tagged
Closed

glaubersilva wants to merge 1 commit into
mainfrom
soft-5188-release-prep-refuse-tagged

Conversation

@glaubersilva

@glaubersilva glaubersilva commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Follow-up to SOFT-5187

The release-prep action now refuses a version the repository has already tagged. Independent of #10; the two can merge in either order.

Why

A release branch cut from main right after a release still carries that release's version. Preparing it with the same version passed every check (the version is not lower than the branch's, which is the rule that catches a wrong branch), and the next changes ended up under a version that was already out. That is what happened on the test plugins today: both release/M26.test40 branches were cut after 2.1.36 and 1.1.10 had been released, the prepare accepted those versions, and the deploy found their tags already published.

What changes

  • Before pup runs, the action reads refs/tags/<version> through the GitHub API. A 404 lets the run go on; an existing tag fails the step: "The tag 4.17.0 already exists in owner/repo: that version is out … Give the release a new version. Nothing was changed." Any other API error fails the step too, rather than being read as an absent tag.
  • The read goes through github-script's own client, so the manifest now hands inputs.token to the prepare step as github-token, as the commit step already did. A pinned pup-version still makes no API call for pup; the tag read is the one request a prepare makes.
  • GITHUB_REPOSITORY is required, as it already was for the commit step.
  • README: the new refusal under "Versions it refuses", and "Running it again" says that a finished preparation can be rerun until its version is tagged.

Tests

node --test: 216 pass (213 before). New: the tag exists (refused before any download or pup call, no outputs), the read fails (refused, not taken for an absent tag), GITHUB_REPOSITORY missing, and the pinned-pup test now asserts the one request is the tag read. Removing the check fails three tests.

actionlint 1.7.12 is clean on the template.

Verified end to end

Not yet. Once #10 lands, a prepare of release/M26.test40 on release-test-plugin-a with its current version 2.1.36 should fail with the message above, and one with a new version should go on as before. Runs will be listed here.

A release branch cut from main right after a release still carries that release's version, and
preparing it again put the next changes under a version that was already out; the only check was
that the version was not lower than the branch's. The tag is now read through the GitHub API before
pup runs, so the shallow checkout does not matter, and an existing tag fails the step naming the fix.
@coderabbitai

coderabbitai Bot commented Oct 30, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@linear

linear Bot commented Oct 30, 2026

Copy link
Copy Markdown

SOFT-5188

@glaubersilva glaubersilva self-assigned this Oct 30, 2026
@glaubersilva
glaubersilva deleted the soft-5188-release-prep-refuse-tagged branch October 30, 2026 18:53
@glaubersilva

Copy link
Copy Markdown
Member Author

Closed by a branch rename, not on purpose: the branch moved to soft-5187-release-prep-refuse-tagged and GitHub closed this pull request with it. The same change is open as #12.

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