Skip to content

Commit 4db4598

Browse files
ci(release),ui: the publish-check texts say what the release does today — the dead ui changeset:publish alias goes, its wiring test pins the live path (#27131)
Fixes #27017 Clause-②: no Metadata-protocol: none ## 维护者速读 - 改了什么:`release.yml` 发布步骤上方的注释现在按顺序写清 `scripts/release-publish.sh` 实际做的三件事(先跑 `@object-ui` 发布产物的 tooling 扫描、再 `changeset publish`、最后一次性推 tag);删掉 `ui/package.json` 里没人调用的 `changeset:publish` 别名;它的接线测试改为钉住真实发布路径。 - 为什么改:发布路径的说明要和真正运行的脚本一致;一个无人调用的别名会让人以为还有第二个发布入口,而且它跑的扫描不带 `--no-build`,与真实发布读的不是同一批产物。 - 风险与回滚:无运行时影响。`release.yml` 只改注释,发布逻辑一个字节没动;`ui/package.json` 是私有工作区根(`private: true`),不发布。回滚即 revert 本 PR。 - 先看:① `ui/scripts/__tests__/check-published-dist-tooling.test.ts` 的 `runs on the publish path` 用例(钉的东西从别名换到 `scripts/release-publish.sh`,断言没有放松);② `.github/workflows/release.yml` 发布步骤注释;③ `ui/package.json` 删的那一行。 - 两分钟验证:`pnpm --dir ui exec vitest run scripts/__tests__/check-published-dist-tooling.test.ts`,预期 35/35 通过。 - 需要你做的:审阅并批准本 PR(`release.yml` 属 Tier H,需授权审批)。 ## What changes 1. **`.github/workflows/release.yml`** — comment only. The text over the publish step said `scripts/release-publish.sh` "is `changeset publish` followed by ONE atomic `git push origin --tags`". Measured on `origin/main`: since the four-gate port the script first runs `node ui/scripts/check-published-dist-tooling.mjs --no-build` and refuses to publish when it is red, and since the npm-record change it records npm's per-package answers for `scripts/release-verify-npm.mjs`. The comment now lists the three things the script runs, in order. No step, `run:` line or condition changed. ⛔ The release workflow was not run, dispatched or re-run to test this (Prime Directive 15); the edit is text. 2. **`ui/package.json`** — the `changeset:publish` alias is **removed**, not re-described. Nothing invokes it: `git grep -n 'changeset:publish'` outside `ui/package.json` hits only the wiring test, a past-tense history line in `scripts/release-publish.sh`'s comment, and released `CHANGELOG.md` entries (release-owned, untouched). No workflow and no script under `.github/` or `scripts/` calls it. JSON carries no comments, so "make it say what it is for" has no spelling here, and what it ran (the scan without `--no-build`, then `changeset publish`) is a second publish door that reads a different build from the release's. `ui/package.json` is `private: true`, so nothing publishes. 3. **`ui/scripts/__tests__/check-published-dist-tooling.test.ts`** — the wiring pin keeps its invariant (the gate runs before `changeset publish` on the publish path) and moves to the live path: the workspace root's `release` script ends in `bash scripts/release-publish.sh`, and that script (comment lines dropped) runs the gate as `if ! node ui/scripts/check-published-dist-tooling.mjs --no-build; then` before its `changeset publish` line. The old comment's claim that `changesets/action` runs `changeset:publish` was false (`release.yml` runs `pnpm run release`) and is gone. The whole card rides one PR in lane `domain:skills`, as triage ordered; the two `ui/**` files are the ui lane's tree, carried here because they describe the same publish path as the `release.yml` comment. ## Tests <details><summary>Edited test file, and the reverse check (three mutations, each red, then green again)</summary> - `pnpm --dir ui exec vitest run --maxWorkers=2 scripts/__tests__/check-published-dist-tooling.test.ts` (under the verify lock): `Test Files 1 passed (1)`, `Tests 35 passed (35)`, `VERDICT command-exit 0`. - Reverse check on the real files (the test reads fixed paths), each through `scripts/ablation-replace.mjs` with the fix committed, anchor hit counted, `git checkout HEAD` trap, and blob-hash restore check: - `--no-build` dropped from the gate line in `scripts/release-publish.sh` → `runs on the publish path` failed (`expected … to match /^if ! node ui\/scripts\/check…/`), exit 1; restored, blob equals HEAD. - root `release` script's `&& bash scripts/release-publish.sh` replaced by `&& changeset publish` → failed (`expected false to be true`), exit 1; restored. - a `changeset publish` line put ahead of the gate in `scripts/release-publish.sh` → failed (`expected 43 to be less than 19`), exit 1; restored. - Re-run on the restored tree: 35/35, exit 0. </details> ## Acceptance notes - `scripts/release-publish.sh`'s own header (lines 25–27) still says it is "Run as the `publish:` command of changesets/action", which `release.yml` says it is not. Same family of stale text, outside this card's three files; noted, not edited here. - `ui/scripts/__tests__` full directory on the final head `7076bbdd`: 175 files passed, 2 skipped; 5019 tests passed. On a fresh worktree it first needs `@objectstack/spec`, `@objectstack/formula` and `@objectstack/client` built: before those builds, 3 files failed on missing `dist/` (none of them reads a file this PR changes). ## Verification Head `7076bbdd` (merged with `origin/main`). `dispatch-gates --commands` derived 62 families; all 62 ran locally with exit 0, including `pnpm check:pm-dispatch-gates` and `pnpm --dir ui exec vitest run scripts/`. `--ran` reconciliation: 62 derived, 62 run, 0 NOT-MEASURED. Outside the derivation: `eslint` on the edited test exit 0. CI check-runs were not awaited. Full readings are in the os-dev report on #27017. --- _Generated by [Claude Code](https://claude.ai/code/session_01QSeKYmhU5KEj1nukYhp1Tg)_ Co-authored-by: Claude <noreply@anthropic.com>
1 parent 80064b2 commit 4db4598

3 files changed

Lines changed: 27 additions & 11 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1946,9 +1946,16 @@ jobs:
19461946
# ──────────────────────────────────────────────────────────────────────
19471947
# The publish itself. `pnpm run release` = build (both scopes; the turbo
19481948
# cache makes it the build above) + console:build (the Console dist into
1949-
# packages/console) + scripts/release-publish.sh, which is `changeset
1950-
# publish` followed by ONE atomic `git push origin --tags` (#2191: the action's concurrent per-tag
1951-
# pushes raced GitHub's ref backend and lost ~half the tags).
1949+
# packages/console) + scripts/release-publish.sh, which runs, in order:
1950+
# 1. `node ui/scripts/check-published-dist-tooling.mjs --no-build`, which
1951+
# refuses the publish when a published @object-ui package carries
1952+
# tooling material (a test, a mock, a `*.tsbuildinfo`) or has no build
1953+
# output. `--no-build` because the build above is what gets packed,
1954+
# so the scan reads exactly those artifacts;
1955+
# 2. `changeset publish`, with npm's own per-package answers recorded for
1956+
# scripts/release-verify-npm.mjs, which this step runs next;
1957+
# 3. ONE atomic `git push origin --tags` (#2191: the action's concurrent
1958+
# per-tag pushes raced GitHub's ref backend and lost ~half the tags).
19521959
#
19531960
# changesets/action is NOT used here, and that is deliberate: handed a
19541961
# workspace with pending changesets it would take the VERSION path and mint

‎ui/package.json‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@
113113
"changeset:check": "node scripts/check-changeset-fixed.mjs && node scripts/check-changeset-no-major.mjs",
114114
"changeset": "changeset",
115115
"changeset:version": "changeset version",
116-
"changeset:publish": "node scripts/check-published-dist-tooling.mjs && changeset publish",
117116
"test:e2e": "playwright test",
118117
"test:e2e:ui": "playwright test --ui",
119118
"test:e2e:live": "playwright test --config=playwright.live.config.ts",

‎ui/scripts/__tests__/check-published-dist-tooling.test.ts‎

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -503,13 +503,23 @@ describe('wiring', () => {
503503

504504
it('runs on the publish path, before anything is published', () => {
505505
// The ruling (objectui#4846 comment 5307574139) put the gate where the harm
506-
// materialises. `changeset:publish` is the command `changesets/action` runs
507-
// to push tarballs to npm, so a red gate stops the publish itself rather
508-
// than reporting after the fact.
509-
expect(manifest.scripts['changeset:publish']).toContain(GATE);
510-
expect(manifest.scripts['changeset:publish'].indexOf(GATE)).toBeLessThan(
511-
manifest.scripts['changeset:publish'].indexOf('changeset publish'),
512-
);
506+
// materialises. The release publishes through the workspace root's
507+
// `release` script (release.yml's publish step runs `pnpm run release`),
508+
// whose last command is `scripts/release-publish.sh`; that script runs the
509+
// gate with `--no-build` and refuses to go on when it is red, before
510+
// `changeset publish` packs a single tarball. So a red gate stops the
511+
// publish itself rather than reporting after the fact. Comment lines are
512+
// dropped first: the script's header names `changeset publish` in prose.
513+
// `repoRoot` in this file is the objectui root, `ui/` under the monorepo.
514+
const workspace = workspaceRoot(repoRoot);
515+
const scripts = rootManifest(repoRoot).scripts as Record<string, string>;
516+
expect(scripts.release.endsWith(' && bash scripts/release-publish.sh')).toBe(true);
517+
const publish = withoutComments(fs.readFileSync(path.join(workspace, 'scripts/release-publish.sh'), 'utf8'));
518+
const gate = `node ${path.relative(workspace, path.join(repoRoot, GATE))} --no-build`;
519+
expect(publish).toMatch(new RegExp(`^if ! ${gate.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}; then$`, 'm'));
520+
const publishAt = publish.search(/^changeset publish\b/m);
521+
expect(publishAt).toBeGreaterThan(-1);
522+
expect(publish.indexOf(gate)).toBeLessThan(publishAt);
513523
});
514524

515525
// The full-battery half (objectstack#26717). objectui scheduled the scan

0 commit comments

Comments
 (0)