You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ci(release): make the release-completeness guard reachable, and let it guard the image too (#4900) (#4901)
Two defects in the guard #4899 added, both exposed by the very next release
(89d2a4e). npm published all of 17.0.0-rc.2 and pushed its tags, then creating
the @objectstack/spec GitHub Release failed on the API's 125k body limit — the
spec changelog section for that version is 342,911 characters (#4900). The step
went red, `published` stayed false, and the runtime image was silently lost.
1. The guard could not fire. GitHub wraps an `if:` naming no status function in
an implicit success(), so `if: steps.changesets.outputs.published != 'true'`
was really `success() && …` — skipped for any changesets-step failure, which
is one of the two cases it exists for. Now `!cancelled() && …`.
2. Its contract was wrong. "Publish whatever is missing" does not cover a
release that published and then died before reporting it: rc.2 was already on
npm, so a publish-only step would have no-opped and lost the image anyway. It
now guards the invariant the release actually owes — this repo's version must
be on npm AND must have a matching runtime image — and reports the second
half through the job outputs so `docker` builds it.
`docker` gains the same `!cancelled()` treatment. A dependent job under the
default implicit success() is skipped for any upstream failure, so the image was
lost to a fault that happened after the packages were already public. The
`published` output is the real gate; the release job's exit status is not, and
the run stays red either way because the GitHub Release genuinely failed.
A failed ghcr probe counts as MISSING on purpose: a redundant rebuild costs a
few minutes, a wrongly-skipped one leaves a published npm version with no image
and nothing to say so.
Verified against stubbed npm/pnpm/git/curl — npm present + image present (full
no-op, no outputs), npm present + image missing (requests docker, does NOT
republish), npm missing (publishes, then requests docker), and ghcr unreachable
(treated as missing). The ghcr probe itself was checked against the live
registry: it resolves an anonymous pull token and correctly reports 17.0.0-rc.1
present and 17.0.0-rc.2 absent.
Claude-Session: https://claude.ai/code/session_01BbNVKv6KgPzuQ5p76nMgnf
Co-authored-by: Claude <noreply@anthropic.com>
if npm view "@objectstack/cli@$version" version >/dev/null 2>&1; then
191
-
echo "@objectstack/cli@$version is already on npm — nothing left to publish."
192
-
exit 0
200
+
echo "npm: @objectstack/cli@$version is present."
201
+
else
202
+
echo "::warning::@objectstack/cli@$version is versioned in this repo but absent from npm, and the Changesets action did not publish it (#4898) — publishing it now."
if ! npm view "@objectstack/cli@$version" version >/dev/null 2>&1; then
208
+
echo "::error::publish ran but @objectstack/cli@$version is still not on npm"
209
+
exit 1
210
+
fi
211
+
echo "::warning::Recovered npm packages and git tags. The GitHub Releases and the ADR-0087 D4 spec-changes attachment were NOT created — those only exist on the Changesets action's own publish path. Create them by hand if this release needs them."
193
212
fi
194
213
195
-
echo "::warning::@objectstack/cli@$version is versioned in main but absent from npm and the Changesets action did not publish it (#4898) — publishing it now."
echo "ghcr: image for $version is present — release is complete."
227
+
exit 0
204
228
fi
229
+
230
+
echo "::warning::No ghcr image for $version (or the registry could not be probed) — requesting the Docker job."
205
231
{
206
232
echo "published=true"
207
233
echo "version=$version"
208
234
} >> "$GITHUB_OUTPUT"
209
-
echo "::warning::Recovered by the fallback path — npm packages and git tags are published, but the GitHub Releases and the ADR-0087 D4 spec-changes attachment were NOT created (those only exist on the Changesets action's own publish path). Create them by hand if this release needs them."
210
235
211
236
- name: Attach spec-changes.json to the GitHub Release (ADR-0087 D4)
212
237
# Rebuilds the change manifest with the api-surface diff against the
@@ -242,7 +267,15 @@ jobs:
242
267
# for every npm release. Called as a reusable workflow so the same build
243
268
# can be re-run manually via workflow_dispatch (e.g. base-image CVE
244
269
# rebuilds) — see docker-publish.yml.
245
-
if: needs.release.outputs.published == 'true'
270
+
#
271
+
# `!cancelled()` rather than the default implicit success(): the release job
272
+
# can publish to npm and THEN fail (89d2a4e died creating the spec GitHub
273
+
# Release, #4900). A dependent job guarded by success() is skipped for any
274
+
# upstream failure, so the image was lost to a fault that happened after the
275
+
# packages were already public. The `published` output — which the recovery
276
+
# step above sets when an image is missing — is the real gate; the job's
0 commit comments