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
{{ message }}
Repository navigation
Commit 23a6552
Browse filesBrowse the repository at this point in the historyBrowse files
ci(release): validate the post-version tree before the version PR is opened
The "chore: version packages" PR runs no CI: changesets/action opens and
force-pushes it with the default GITHUB_TOKEN, and GitHub does not start
workflow runs from events raised by that token. So the largest
machine-generated diff of the release cycle is the only commit that reaches
main without passing the gates. Two files in this repository already state
that mechanism -- lint.yml's docs-image-tag block and
scripts/sync-protocol-version.mjs's header -- and each states it while
explaining a rewriter built to work around it.
Render the post-version tree in the version-pr job, validate it, and put it
back before changesets/action reads it. The gate list is derived from the
change set by scripts/pm/dispatch-gates.mjs rather than written down, so a
fifth version-time rewriter pulls in its surface's gates on the day it lands.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015ahemw8RcTgqtxrj15PEZx
mapfile -t MOVED < "${RUNNER_TEMP}/post-version-paths.txt"
488
+
if [ "${#MOVED[@]}" -eq 0 ]; then
489
+
echo "::error::changesets were pending but the version step moved no path. Either \`pnpm run version\` did nothing, or it wrote outside the working tree — both are a broken version lane, not an empty diff."
# PARSE GUARD. The list is read out of prose the script writes for a
497
+
# human, so a format change would otherwise hand this step an empty
498
+
# gate list and a green run — a validation that validates nothing,
499
+
# which is the defect this whole block is closing. Both the header and
500
+
# a non-empty result are therefore asserted before anything runs.
501
+
if ! grep -q '^Local gates for this card' "${RUNNER_TEMP}/derived.txt"; then
502
+
echo "::error::dispatch-gates.mjs printed no 'Local gates for this card' block. Its output format changed and this step's parser did not — refusing to report a green validation derived from nothing."
echo "::error::dispatch-gates.mjs derived no gate at all from ${#MOVED[@]} changed path(s). A version pass always moves packages/cli/package.json and the doc surfaces that pin its version, so an empty derivation is a broken parse, not a clean tree."
514
+
exit 1
515
+
fi
516
+
517
+
# Written with printf rather than a heredoc: a heredoc body has to
518
+
# start at column 0, which ends the YAML block scalar this script
519
+
# lives in (caught by parsing this file, not by reading it).
520
+
printf '%s\n' \
521
+
'node scripts/check-dev-prereqs.mjs' \
522
+
'node scripts/check-engine-split-ratio.mjs' \
523
+
'pnpm check:i18n' \
524
+
'pnpm check:i18n-coverage' \
525
+
'pnpm --filter @objectstack/lint run check:doc-formula-expressions' \
526
+
'pnpm --filter @objectstack/lint run check:doc-security-posture' \
527
+
> "${RUNNER_TEMP}/excluded.txt"
528
+
529
+
failed=()
530
+
skipped=0
531
+
ran=0
532
+
while IFS= read -r gate; do
533
+
[ -z "${gate}" ] && continue
534
+
if grep -qxF -- "${gate}" "${RUNNER_TEMP}/excluded.txt"; then
535
+
echo "skipped (declared exclusion — needs a build or full history): ${gate}"
if [ "${pending_after}" != "${PENDING_BEFORE}" ] || [ "${dirty}" -ne 0 ]; then
613
+
echo "::error::the pre-version tree was NOT restored (${PENDING_BEFORE} pending changeset(s) before, ${pending_after} after; ${dirty} tracked path(s) still modified). changesets/action would read this tree, find nothing pending and no publish script, and return without refreshing the PR — a silent permanent no-op (#11945)."
614
+
exit 1
615
+
fi
616
+
echo "Pre-version tree restored: ${pending_after} pending changeset(s), working tree clean."
617
+
302
618
# `pnpm run version` = changeset version + sync-protocol-version +
303
-
# sync-template-versions. All three are pure file rewrites; none reads a
304
-
# built artifact. The workspace build, the vendored Console build and the
619
+
# sync-template-versions + sync-docs-image-tags — FOUR rewriters, read
620
+
# from the root `version` script, not three. The fourth joined in #9064
621
+
# and this comment did not follow; it is corrected here because the block
622
+
# above prices what that script moves, and a stale count of the rewriters
623
+
# is a stale statement of the surface being priced. All four are pure file
624
+
# rewrites; none reads a built artifact. The workspace build, the vendored Console build and the
305
625
# live hotcrm smoke that used to run here were PRE-PUBLISH gates — they
306
626
# moved to the `publish` job below, where the publish they gate now lives.
307
627
# Leaving them here would gate nothing and cost ~9 minutes of every main
0 commit comments