Repository navigation
Commit 9bf3286
fix(devx): point shallow-clone refusals at ci.yml's history fetch step (#31667)
<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} -->
_Requested by **Steedos** · [project
thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbASbE5AXy68rApzP2nGVtXY)_
Fixes #31649
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:五个门禁脚本在浅克隆时的拒绝提示文案。原来只叫 CI 设 `fetch-depth: 0`,现在同时点名 ci.yml
的取历史步骤与 lint.yml 的全量检出。
- 为什么改:ci.yml 读历史的作业已改为深度 1 检出加取历史步骤,旧提示会把 CI 读者引向错误的修法。
- 风险与回滚:只改提示字符串与两处断言,退出码与逻辑不动;回滚即 revert 本 PR。
- 先看:`packages/spec/scripts/build-schemas.ts` 的 remedy
串;`ui/scripts/check-changeset-presence.mjs` 的 SHALLOW
分支;`ui/scripts/__tests__/check-changeset-presence.test.ts` 的浅克隆用例。
- 两分钟验证:`pnpm --dir ui exec vitest run
scripts/__tests__/check-changeset-presence.test.ts`,预期全绿,且浅克隆用例断言了步骤名。
- 需要你做的:无,席位落地。
## What changes
On main 532230f, five shallow-clone refusal messages told a CI reader
that the fix was `fetch-depth: 0`. That is no longer what works in a
`ci.yml` job that reads history. Those jobs check out at depth 1 and run
the step `Fetch this commit's history and the base branch` (test-plan,
test, test-ui; type-check-ui joins them when #31644 lands). `lint.yml`
still checks out with `fetch-depth: 0`.
Each message's "In CI" clause now names both remedies: run that step
before the gate (ci.yml), or give the checkout `fetch-depth: 0`
(lint.yml). The local advice, exit codes and every other line are
unchanged. No logic changes, and no workflow file is touched.
| Script | Who runs it | Change |
|:--|:--|:--|
| `packages/spec/scripts/build-schemas.ts`
(`resolveBaselineWithoutMergeBase` remedy) | spec's `build` in every job
that builds spec (both kinds), and `check:authorable-surface` in
lint.yml | both remedies named |
| `ui/scripts/check-new-cross-file-line-citations.mjs` | no workflow
step on main | both remedies named, generically |
| `ui/scripts/check-changeset-claims.mjs` | no workflow step on main |
both remedies named, generically |
| `ui/scripts/check-changeset-overwrite.mjs` | same text, added by Claim
amendment 6726615830 | same wording |
| `ui/scripts/check-changeset-presence.mjs` | same text, added by Claim
amendment 6726615830 | same wording |
**About #31644:** the wording is conditional on the job's shape ("in a
job that runs the step, or a full checkout"), so it holds whether #31644
has landed or not. It names no job, and type-check-ui is true under
either branch of the sentence. `check-i18n-en-drift.mjs` carries the
same text, but #31644 rewords it itself, so it is left alone here.
**Changeset:** `skip-changeset`. These are repository scripts and tests.
`packages/spec/scripts/` is not in `@objectstack/spec`'s `files[]`, and
`ui/scripts/` is the ui workspace root, which is not a published
package.
## Tests
The pins move with the prose. Both still assert `fetch-depth: 0`, and
each now also asserts the step name:
- `packages/spec/scripts/build-schemas-check-mode.git-topology.test.ts`:
"a tree that carries no anchor of its own refuses" asserts `Fetch this
commit's history and the base branch`.
- `ui/scripts/__tests__/check-changeset-presence.test.ts`: the depth-1
clone case asserts the same.
No pin asserted the old text of the other three messages. A grep of the
tests for each old string returned no other hits.
## Acceptance notes
- Two nearby strings in `build-schemas.ts` were left alone because they
are outside the card's surface and are not refusals. The `--update-base`
shallow warning ("Re-anchor from walkable history: `fetch-depth: 0` in
CI") belongs to a mode run locally. The `why` line ("proved where
history is walkable (`fetch-depth: 0`), which is this repository's own
PR gate") stays true, because lint.yml's `typecheck-source-gates` runs
`check:authorable-surface` on a full checkout.
- `check:new-line-citations` and `check:changeset-claims` are not run as
a step by any workflow on main, so their "In CI" line can only describe
the two job shapes.
## Verification
All runs below are on head `243250a6`. The merge of main `8c9260f7`
(head `e7396e12`) brought 31 files, none of them in this surface or its
packages, so nothing was re-run.
<details><summary>Dispatch gates: 66 derived, 65 run, 1 NOT
MEASURED</summary>
- `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` derived 66 commands. All exited 0 except
one.
- NOT MEASURED: `pnpm check:dual-build-cjs-loads` exited 3 (PREREQUISITE
NOT MET: about 33 packages have no `dist/`). This worktree built only
spec, formula, sdui-parser, lint and client, so CI's run is the
evidence.
- `node scripts/check-plugin-teardown-shape.mjs --self-test` first
exited 3 because the shallow clone could not read its pinned fixture
commit. After `git fetch --depth=1 origin 621a487`, it exited 0 with 48
cases.
- `pnpm check:query-options-erasure` hit the loop's 300 s timeout. Run
alone, it exited 0.
- `pnpm --dir ui exec vitest run scripts/` exited 0: 170 files passed
and 2 skipped; 5021 tests passed and 2 skipped.
- `pnpm check:pm-dispatch-gates` exited 0: 2205 fast-tier cases.
- `dispatch-gates --ran`: 66 derived families accounted for (65 run, 1
NOT MEASURED).
</details>
<details><summary>Pins: red on main's text, green on the fix</summary>
- Red leg: `git restore --source=532230f3` of
`check-changeset-presence.mjs` and `build-schemas.ts`, tree only. "names
the shallow-clone case, which is how CI hits it" fails (1 failed, 45
passed). "a tree that carries no anchor of its own refuses" fails (1
failed). Both files were then restored to HEAD, and `git diff HEAD` was
empty.
- Green: `build-schemas-check-mode.git-topology.test.ts` passed 17/17.
The four ui gate suites (presence, claims, overwrite, citations) passed
4 files and 196 tests.
</details>
---
_Generated by [Claude
Code](https://claude.ai/code/session_01QsR2jQqimUnb4io8LpGcvH)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent cd43416 commit 9bf3286
7 files changed
Lines changed: 20 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
832 | 832 | | |
833 | 833 | | |
834 | 834 | | |
| 835 | + | |
| 836 | + | |
835 | 837 | | |
836 | 838 | | |
837 | 839 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2426 | 2426 | | |
2427 | 2427 | | |
2428 | 2428 | | |
2429 | | - | |
2430 | | - | |
| 2429 | + | |
| 2430 | + | |
| 2431 | + | |
2431 | 2432 | | |
2432 | 2433 | | |
2433 | 2434 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
914 | 914 | | |
915 | 915 | | |
916 | 916 | | |
| 917 | + | |
917 | 918 | | |
918 | 919 | | |
919 | 920 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1421 | 1421 | | |
1422 | 1422 | | |
1423 | 1423 | | |
1424 | | - | |
1425 | | - | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
1426 | 1428 | | |
1427 | 1429 | | |
1428 | 1430 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
295 | 295 | | |
296 | 296 | | |
297 | 297 | | |
298 | | - | |
299 | | - | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
300 | 302 | | |
301 | 303 | | |
302 | 304 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1100 | 1100 | | |
1101 | 1101 | | |
1102 | 1102 | | |
1103 | | - | |
1104 | | - | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
1105 | 1107 | | |
1106 | 1108 | | |
1107 | 1109 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
502 | 502 | | |
503 | 503 | | |
504 | 504 | | |
505 | | - | |
| 505 | + | |
| 506 | + | |
506 | 507 | | |
507 | 508 | | |
508 | 509 | | |
| |||
0 commit comments