Skip to content

Commit 897da79

Browse files
johnscaclaude
andcommitted
fix: make the release dispatch ask which bump it wants (ENG-9233)
[ENG-9233](https://stacklet.atlassian.net/browse/ENG-9233) What ---- - Opens the caller's `bump` dropdown on `(choose one)` rather than defaulting to `patch`, so a dispatch has to answer the question. The called workflow already rejects anything but the three real values, so the placeholder needs no new validation. - Drops the step that required a first release to be a major bump. - Updates the README to match, in the prose about refusals and in the caller block it offers for copying. Why ---- `patch` was a poor default on a dispatch that cannot be taken back. On a repository with no tags it opens at `v0.0.1`, and immutable releases burn that name for good. On any later release it quietly ships a patch for work that earned a minor, which nothing caught, because the guard only ever looked at first releases. Asking the question fixes both, and it fixes them at the point where the default was wrong rather than downstream of it. The guard can then go. A repository that explicitly asks for a patch on an empty tag history means `v0.0.1`, and a minor bump climbs out of it, so there is nothing left worth refusing. Whether a repository opens at `v0.0.1`, `v0.1.0` or `v1.0.0` is its own call, and `cut-release.yml` no longer holds a view on it. Testing ---- - [x] `just lint` passes here and in the five module repositories. - [x] `uvx zizmor@1.23.1 -v --gh-token=... .github/workflows/` reports no findings, with the five online audits scheduled rather than skipped. - [x] Ran the bump check against `(choose one)`, `patch`, `minor`, `major`, `Patch`, empty and `majorly`. Only the three lowercase values pass, so the placeholder stops a run the same way any other unrecognised bump does. - [x] Parsed each caller to confirm the placeholder survives YAML as the literal `(choose one)` and that no `default` key remains. - [ ] After merge, dispatch Release here and confirm the dropdown opens on `(choose one)` and that submitting it fails at the bump check. - [ ] Dispatch Release with a `minor` bump and confirm `v1.1.0` publishes against `v1.0.0` as previous. Docs ---- The README's account of the refusals now covers the placeholder, and says what each bump opens at on a repository with no tags rather than naming one of them as required. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 6fa4d7c commit 897da79

3 files changed

Lines changed: 23 additions & 20 deletions

File tree

‎.github/workflows/cut-release.yml‎

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ jobs:
5050
# confusing place to find out. Checked in the shell rather than an `if:`
5151
# because workflow expressions compare case-insensitively, so `Major`
5252
# would clear one and then fail inside the action.
53+
#
54+
# This also catches the placeholder a caller's dropdown opens on. A
55+
# dispatch that never answered the question arrives here as an
56+
# unrecognised bump and stops, which is why no step downstream has to
57+
# care what a first release looks like.
5358
- name: Check the requested bump
5459
env:
5560
BUMP: ${{ inputs.bump }}
@@ -111,20 +116,6 @@ jobs:
111116
echo "| Dry run | ${DRY_RUN} |"
112117
} >> "${GITHUB_STEP_SUMMARY}"
113118
114-
# Only fires on the first release, where the baseline is 0.0.0. A patch
115-
# from there lands v0.0.1 permanently, so this is enforced rather than
116-
# left to the input description. Reads `previous_version` rather than
117-
# `previous_tag`, which carries the action's tag prefix and would make
118-
# this a second copy of a default owned elsewhere.
119-
- name: Require the first release to be major
120-
if: ${{ steps.version.outputs.previous_version == '0.0.0' && inputs.bump != 'major' }}
121-
env:
122-
BUMP: ${{ inputs.bump }}
123-
run: |
124-
echo "This repository has no releases yet, so the first one has to be a" >&2
125-
echo "major bump to land v1.0.0. This run asked for ${BUMP}." >&2
126-
exit 1
127-
128119
publish:
129120
needs: version
130121
# `success()` is implicit here, and it is what keeps the version job's

‎.github/workflows/release.yml‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,15 @@ on:
44
workflow_dispatch:
55
inputs:
66
bump:
7-
description: Which part of the version to raise. The first release has to be major, because the count starts from 0.0.0.
7+
# The dropdown always opens on something, and there is no way to make
8+
# it open on nothing, so it opens on a value the called workflow
9+
# rejects. A dispatch that skipped the question fails instead of
10+
# quietly shipping whichever bump happened to be first.
11+
description: Which part of the version to raise.
812
required: true
913
type: choice
10-
default: patch
1114
options:
15+
- (choose one)
1216
- patch
1317
- minor
1418
- major

‎README.md‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,15 @@ on:
6363
workflow_dispatch:
6464
inputs:
6565
bump:
66-
description: Which part of the version to raise. The first release has to be major, because the count starts from 0.0.0.
66+
# The dropdown always opens on something, and there is no way to make
67+
# it open on nothing, so it opens on a value the called workflow
68+
# rejects. A dispatch that skipped the question fails instead of
69+
# quietly shipping whichever bump happened to be first.
70+
description: Which part of the version to raise.
6771
required: true
6872
type: choice
69-
default: patch
7073
options:
74+
- (choose one)
7175
- patch
7276
- minor
7377
- major
@@ -95,8 +99,12 @@ jobs:
9599

96100
The workflow refuses to run against anything but the calling repository's default
97101
branch, refuses any re-run of a run it has already started, and refuses to publish over
98-
a tag it did not create. A retry means dispatching again. The first release has to be a major bump, because the version
99-
walk starts from 0.0.0 and a patch from there spends `v0.0.1` permanently.
102+
a tag it did not create. A retry means dispatching again.
103+
104+
The `bump` dropdown opens on `(choose one)`, which the workflow rejects. The version
105+
walk starts from 0.0.0, so on a repository with no tags patch opens at `v0.0.1`, minor
106+
at `v0.1.0` and major at `v1.0.0`. Which of those a repository wants is its own call,
107+
so the workflow asks rather than assumes.
100108

101109
`STEP_SECURITY_API_KEY` is optional. Without it the Harden Runner step is skipped and
102110
the rest runs unchanged.

0 commit comments

Comments
 (0)