Skip to content

Commit 9427dd0

Browse files
committed
fix(ci): release gates fail closed on cancelled jobs + refuse malformed version input
Three fixes from the v0.10.7 release incident (2026-08-18): 1. build (and smoke/soak) required 'not failed' instead of explicit success. failure() does not cover a needed job that TIMED OUT (conclusion 'cancelled'), so lint hitting its 15-min timeout cascaded test into 'skipped' and the pipeline published with the whole test matrix and asan-soak silently skipped. build now requires lint success plus either test success or the sanctioned skip_tests input; smoke/soak require build success explicitly. 2. The tag is inputs.version verbatim: dispatching a bare '0.10.7' published a release the installers can never resolve (they fetch releases/download/v<version>/...), and under immutable releases the mis-named tag cannot be retagged or its name reused. A preflight job now refuses any non-v-prefixed version before anything runs. 3. Lint's 15-min timeout was one slow-runner day away from cancelling a normally-5-min job; raised to 30 so only a genuine hang can hit it. Release-path only (workflow_dispatch); adds one ~5s preflight job; no PR-CI gating, cost, or trigger changes. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
1 parent afebf00 commit 9427dd0

2 files changed

Lines changed: 39 additions & 7 deletions

File tree

‎.github/workflows/_lint.yml‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ permissions:
1111
jobs:
1212
lint:
1313
runs-on: ubuntu-latest
14-
timeout-minutes: 15
14+
# 15 min proved too tight on a slow runner day and a timed-out lint reads
15+
# as "cancelled", which the release graph must treat as a hard stop; keep
16+
# a bound, but one only a genuine hang can hit (normal runtime ~5 min).
17+
timeout-minutes: 30
1518
steps:
1619
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
1720

‎.github/workflows/release.yml‎

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,29 @@ jobs:
4646
uses: ./.github/workflows/_security.yml
4747
secrets: inherit
4848

49+
# ── 0. Preflight: refuse malformed dispatch inputs ──────────────
50+
# The tag is inputs.version VERBATIM. A bare "0.10.7" publishes a release the
51+
# installers can never resolve (they fetch releases/download/v<version>/...),
52+
# and with immutable releases the mis-named tag cannot be retagged, deleted,
53+
# or its name reused — the name is burned permanently (2026-08-18 incident).
54+
preflight:
55+
runs-on: ubuntu-latest
56+
timeout-minutes: 5
57+
steps:
58+
- name: Enforce v-prefixed semver version input
59+
env:
60+
VERSION: ${{ inputs.version }}
61+
run: |
62+
if [[ "$VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+([-.][0-9A-Za-z.]+)?$ ]]; then
63+
echo "version OK: $VERSION"
64+
else
65+
echo "::error::version must be v-prefixed semver (vX.Y.Z), got '$VERSION'"
66+
exit 1
67+
fi
68+
4969
# ── 1. Lint (cppcheck + clang-format) ───────────────────────────
5070
lint:
71+
needs: [preflight]
5172
uses: ./.github/workflows/_lint.yml
5273

5374
# ── 2. Tests (all platforms, full suite for release) ────────────
@@ -65,11 +86,19 @@ jobs:
6586
shard_suites: true
6687

6788
# ── 3. Build all platforms ──────────────────────────────────────
68-
# !cancelled() && !failure(): run when `test` is deliberately skipped, but
69-
# never when lint or test actually failed.
89+
# `test` may be skipped ONLY by the skip_tests input. A skipped `test` is
90+
# also what a cancelled/timed-out lint produces (needs-cascade), and the
91+
# bare !cancelled() && !failure() form cannot tell those apart: failure()
92+
# does not cover a needed job that was CANCELLED, so a lint timeout let the
93+
# whole pipeline publish with the test matrix silently skipped
94+
# (v0.10.7 incident, 2026-08-18). Require the explicit results.
7095
build:
71-
if: ${{ !cancelled() && !failure() }}
72-
needs: [test]
96+
if: >-
97+
${{ !cancelled()
98+
&& needs.lint.result == 'success'
99+
&& (needs.test.result == 'success'
100+
|| (inputs.skip_tests && needs.test.result == 'skipped')) }}
101+
needs: [lint, test]
73102
permissions:
74103
contents: read
75104
id-token: write
@@ -92,15 +121,15 @@ jobs:
92121
# an optional phase needs this override, or the phase being optional silently
93122
# makes the phases after it optional as well.
94123
smoke:
95-
if: ${{ !cancelled() && !failure() }}
124+
if: ${{ !cancelled() && needs.build.result == 'success' }}
96125
needs: [build]
97126
uses: ./.github/workflows/_smoke.yml
98127
with:
99128
broad_platforms: true
100129

101130
# ── 5. Soak tests ──────────────────────────────────────────────
102131
soak:
103-
if: ${{ !cancelled() && !failure() }}
132+
if: ${{ !cancelled() && needs.build.result == 'success' }}
104133
needs: [build]
105134
uses: ./.github/workflows/_soak.yml
106135
with:

0 commit comments

Comments
 (0)