Skip to content

Commit 350beba

Browse files
authored
fix(release): rc detection asks the registry, not the changeset count — a dispatch published ungated (#871)
The gate's rc detector read pending-changeset file counts, but the changesets action decides a publish by 'any package version missing from npm'. On a workflow_dispatch its changed-since-before filter gets an empty before, the reader throws to zero, and the action read 'no changesets' over hundreds of pending files — skipped the gate as a 'version-PR leg' (regression never ran) and attempted an ungated publish of unvalidated rc packages straight at npm. It crashed mid-every-plugin, so nothing landed; the hazard was real. The detector now asks the registry the question the action asks: a publish is imminent iff any publishable package's version is missing from npm, and every dispatched release run gates regardless. Also carries the changeset documenting the #869 revert.
1 parent 6f8c846 commit 350beba

2 files changed

Lines changed: 41 additions & 21 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
"everything-dev": patch
3+
---
4+
5+
Revert the regression harness's file-backed pglite substitution: the dev stack
6+
opens the auth database from two processes (the auth service and the auth-plugin
7+
instance composed into the api/host), and a per-secret shared data dir turned
8+
that topology into ADR 0044's silent-corruption case — the suite died on
9+
system-catalog reads past EOF (`pg_attribute`, "unexpected data beyond EOF").
10+
The harness is restored to in-memory pglite, whose per-process databases made
11+
the dual-open harmless. App fixtures for regression specs still seed over HTTP;
12+
a file-backed mode needs a single-writer story first (seed through the running
13+
stack, not pre-spawn against shared files).

‎.github/workflows/release.yml‎

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -80,30 +80,37 @@ jobs:
8080
8181
- name: Detect a release candidate (publish imminent)
8282
id: rc
83+
env:
84+
EVENT_NAME: ${{ github.event_name }}
8385
run: |
84-
# The changesets action publishes when the push merges the version
85-
# PR — its own commit title, pinned by the action's `commit:` input
86-
# — or (stable mode, after `pre exit`) when the merged diff
87-
# consumes changesets. Pending .md counts can NEVER signal during
88-
# the rc train: pre mode never consumes them (hundreds sit in
89-
# .changeset/, by design) and .changeset/README.md exists forever,
90-
# so a file-count check misdetects every version merge as
91-
# "changesets pending" and the publish slips out ungated.
92-
SUBJECT="$(git log -1 --pretty=%s HEAD)"
93-
case "$SUBJECT" in
94-
"chore: version packages"*)
95-
echo "rc=true" >> "$GITHUB_OUTPUT"
96-
echo "::notice::Version PR merged ($SUBJECT) — a publish is imminent; the full regression gates it"
97-
exit 0
98-
;;
99-
esac
100-
if find .changeset -maxdepth 1 -name '*.md' ! -name 'README.md' -print -quit | grep -q .; then
101-
echo "rc=false" >> "$GITHUB_OUTPUT"
102-
echo "::notice::Pending changesets — this run opens/updates the version PR; the regression gate does not apply"
103-
else
86+
# The changesets action's publish decision is "any workspace package
87+
# version is not on npm" — version-PR subjects and pending-changeset
88+
# file counts are proxies that disagree with it. 2026-11-11: a
89+
# dispatched run read "no changesets" over hundreds of pending files
90+
# (its changed-since-before filter gets an empty `before` on
91+
# dispatches, which makes the reader throw and yield zero), skipped
92+
# the gate as a "version-PR leg", and attempted an ungated publish
93+
# of unvalidated rc packages. Ask the registry directly: a publish
94+
# is imminent iff any publishable package's version is missing from
95+
# npm — gate exactly that. Dispatches always gate: they are a
96+
# deliberate release action.
97+
if [ "$EVENT_NAME" = "workflow_dispatch" ]; then
98+
echo "::notice::Dispatched release run — the full regression gates it before npm sees anything"
10499
echo "rc=true" >> "$GITHUB_OUTPUT"
105-
echo "::notice::No pending changesets — a publish is imminent; the full regression gates it"
100+
exit 0
106101
fi
102+
rc=false
103+
for pkg in every-plugin better-near-auth everything-dev; do
104+
local_version="$(node -p "require('./packages/$pkg/package.json').version")"
105+
if npm view "$pkg@$local_version" version >/dev/null 2>&1; then
106+
echo "$pkg@$local_version is already on npm"
107+
else
108+
echo "$pkg@$local_version is not on npm — a publish is imminent; the full regression gates it"
109+
rc=true
110+
break
111+
fi
112+
done
113+
echo "rc=$rc" >> "$GITHUB_OUTPUT"
107114
108115
# The release gate: the full regression matrix must be green before npm
109116
# sees anything. Dispatched as a manual retry (workflow_dispatch), the rc

0 commit comments

Comments
 (0)