Commit feab60d
[MISC] Add 'auto' version bump to OSS create-release (#2136)
* [MISC] Add 'auto' version bump to OSS create-release
Adds an 'auto' choice (now the default) to create-release.yaml that picks
the OSS version bump from merged PR titles: a [FEAT]/[GATED-FEAT] PR merged
since the last release -> minor, otherwise patch. These are the only feature
PR types in the contribution guide, so this matches the documented SemVer
intent without any new labeling.
Details:
- 'auto' resolves in a new "Resolve auto bump" step (main mode only; hotfix
lines stay patch-only). Fail-safe is always patch, so a compare/PR query
hiccup never over-bumps the public version.
- Hotfix-mode input validation now accepts 'auto' (maps to patch).
- compute-version consumes the resolved bump; dry-run/final summaries show
"auto -> minor/patch" for an explicit audit trail.
- 'auto' never selects major — that stays behind the confirm_major gate.
Validated by replaying the classifier over the last 13 real releases: 12/13
matched the human bump; the lone diff was a discretionary minor with no FEAT
PR (recoverable via manual minor override, which the notice points to).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* [MISC] Address review: PR-read perms, patch fallback, truncation warning
- Add `pull-requests: read` to the job (the permissions block sets unlisted
scopes to none, so `gh pr list` would 403 and 'auto' would silently always
fall back to patch). [CodeRabbit]
- BUMP_TYPE falls back to 'patch' instead of 'auto' when resolved is empty,
avoiding a latent "Unknown bump type: 'auto'" job failure. [Greptile]
- Surface a warning when the merged-PR query hits the 200-result cap instead
of silently under-counting FEAT PRs. [Greptile]
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* [MISC] Harden auto-bump resolve step (review follow-ups)
From a multi-agent review of the auto-bump step:
- Guard the jq parses: malformed/non-array stdout now degrades to patch
instead of crashing the job under set -e/pipefail (upholds the "never fail
the release outright" invariant). Also validates TOTAL/FEAT_COUNT are numeric
before arithmetic.
- Detect gh failure by exit status (if ! PR_JSON=$(...)) and surface captured
stderr, so a permanent 403 (e.g. dropped pull-requests scope) is diagnosable
rather than a cause-free warning that silently patches forever.
- Add '// empty' to the published_at lookup for consistency with get-latest,
so a JSON null can't leak through as the literal "null".
- Only emit the truncation warning when no FEAT was found within the cap (the
only case where truncation could change the outcome).
- Fix an inaccurate comment ("silently" -> "with a warning") and reword the
self-referential permissions comment.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>1 parent 076fd6f commit feab60d
1 file changed
Lines changed: 87 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
42 | 48 | | |
43 | 49 | | |
44 | 50 | | |
| |||
82 | 88 | | |
83 | 89 | | |
84 | 90 | | |
85 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
86 | 94 | | |
87 | 95 | | |
88 | 96 | | |
| |||
158 | 166 | | |
159 | 167 | | |
160 | 168 | | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
161 | 233 | | |
162 | 234 | | |
163 | 235 | | |
164 | 236 | | |
165 | | - | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
166 | 241 | | |
167 | 242 | | |
168 | 243 | | |
| |||
225 | 300 | | |
226 | 301 | | |
227 | 302 | | |
| 303 | + | |
228 | 304 | | |
229 | 305 | | |
230 | 306 | | |
| 307 | + | |
| 308 | + | |
231 | 309 | | |
232 | 310 | | |
233 | 311 | | |
234 | 312 | | |
235 | 313 | | |
236 | 314 | | |
237 | 315 | | |
238 | | - | |
| 316 | + | |
239 | 317 | | |
240 | 318 | | |
241 | 319 | | |
| |||
324 | 402 | | |
325 | 403 | | |
326 | 404 | | |
| 405 | + | |
327 | 406 | | |
328 | 407 | | |
329 | 408 | | |
| 409 | + | |
| 410 | + | |
330 | 411 | | |
331 | 412 | | |
332 | 413 | | |
| |||
335 | 416 | | |
336 | 417 | | |
337 | 418 | | |
338 | | - | |
| 419 | + | |
339 | 420 | | |
340 | 421 | | |
341 | 422 | | |
| |||
0 commit comments