Skip to content

Commit cd36b84

Browse files
claude[bot]claude
andauthored
fix(ci): verify the restored Console dist's spec injection in release.yml and save its cache only on success (#9709) (#14424)
release.yml restores the vendored Console dist under the same repo-scoped key ci.yml's Console Pin Gate uses, but carried no `check:console-injection` step — so on a cache hit nothing asked whether the dist about to be PUBLISHED bundles this tree's @objectstack/spec (assert-console-spec-injection.mjs runs inside build-console.sh, which the cache hit skips). It also used the COMBINED actions/cache action, whose post-step saves even when the job failed. build-console.sh stamps the dist before it asserts the bundle canary, so a canary failure seeded that shared key with a stamped-but-broken dist. Both halves now match ci.yml exactly: split restore/save around the console assertions, and `pnpm check:console-injection --require-stamp` with the same CONSOLE_DIST_CACHE_KEY env after `check:console-sha`. Co-authored-by: Claude <noreply@anthropic.com>
1 parent d16df74 commit cd36b84

1 file changed

Lines changed: 34 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,9 +1091,16 @@ jobs:
10911091
# ci.yml's Console Pin Gate (#4290) uses this exact key, so the pin bump's
10921092
# PR run and this job share one build — keep the two in step if either
10931093
# input set changes.
1094-
- name: Cache vendored Console dist (keyed on the objectui pin)
1094+
#
1095+
# Split restore/save, matching ci.yml, and not the combined actions/cache
1096+
# action: the combined form's post-step saves even when the job FAILED,
1097+
# and build-console.sh writes the SHA stamp BEFORE it asserts the bundle
1098+
# canary — so a canary failure here would seed this shared, repo-scoped
1099+
# key with a stamped-but-broken dist that later runs restore and sail
1100+
# through. See ci.yml's split-restore note for the full rationale.
1101+
- name: Restore vendored Console dist (keyed on the objectui pin)
10951102
id: console-dist-cache
1096-
uses: actions/cache@v6
1103+
uses: actions/cache/restore@v6
10971104
with:
10981105
path: packages/console/dist
10991106
key: ${{ runner.os }}-console-dist-${{ hashFiles('.objectui-sha', 'scripts/build-console.sh') }}
@@ -1109,6 +1116,31 @@ jobs:
11091116
- name: Verify Console dist stamp matches pin
11101117
run: pnpm check:console-sha
11111118

1119+
# The spec-injection half of the same question, spelled exactly as
1120+
# ci.yml's Console Pin Gate spells it — both consumers of one cache key
1121+
# apply one check. check:console-sha answers only "which objectui SHA",
1122+
# and scripts/assert-console-spec-injection.mjs runs INSIDE
1123+
# build-console.sh, which the `if: cache-hit != 'true'` above skips — so
1124+
# on a cache hit nothing had asked whether the dist this job is about to
1125+
# PUBLISH bundles this tree's @objectstack/spec rather than the published
1126+
# tarball. --require-stamp because the vacuity check:console-sha tolerates
1127+
# (no dist, or a dist no build ever stamped) is wrong on a publish lane.
1128+
- name: Verify the restored Console dist bundles this tree's spec
1129+
env:
1130+
CONSOLE_DIST_CACHE_KEY: ${{ runner.os }}-console-dist-${{ hashFiles('.objectui-sha', 'scripts/build-console.sh') }}
1131+
run: pnpm check:console-injection --require-stamp
1132+
1133+
# Reached only with every console assertion above green: Actions steps
1134+
# default to `success()`, and nothing between the restore and here carries
1135+
# `if: always()` or `continue-on-error`. Saving only on a miss keeps an
1136+
# immutable entry from being rewritten on every release run.
1137+
- name: Save vendored Console dist
1138+
if: steps.console-dist-cache.outputs.cache-hit != 'true'
1139+
uses: actions/cache/save@v6
1140+
with:
1141+
path: packages/console/dist
1142+
key: ${{ runner.os }}-console-dist-${{ hashFiles('.objectui-sha', 'scripts/build-console.sh') }}
1143+
11121144
- name: Downstream backward-compat smoke (live hotcrm)
11131145
# Pre-publish gate (#2035): the about-to-publish @objectstack/spec must
11141146
# not break a real third-party consumer pinned to a published release.

0 commit comments

Comments
 (0)