Skip to content

Commit e6c4409

Browse files
ci(ui-merge): port objectui's lockfile-integrity gate into Type Check UI and retire lockfile-dedupe and the shadcn-check report (#26995)
<!-- claude-projects-attribution: {"github_login":"os-steve"} --> _Requested by **Steve** · [project thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi953MBpM3iLJAsd1HJwbM7eJ)_ Part of #26717 (slice 2: roster rows 19, 18 and 26 land here; row 7-docs stays open on the card for the seat's decision, see Acceptance notes. Row 17 is out of scope by #25914's ruling.) Clause-②: no Metadata-protocol: none ## 维护者速读 - 改了什么:objectui 剩下的三个"移植或退役"检查处理完。锁文件重复检查(lockfile-integrity)接进根 CI 的 `Type Check UI`,只在 PR 上跑,发现问题只打一条报错注释,不挡合并,和 objectui 当年一样。另外两个退役:锁文件 dedupe 报告(90 天 145 次运行从未失败)和 shadcn 每周报告的分类脚本,连同它们的测试一起删掉。 - 为什么改:objectui 并入后这些检查没有在任何地方运行;要么接回来,要么明确删掉,不留半死的脚本。 - 风险与回滚:`Type Check UI` 是必需检查,但新步骤带 `continue-on-error`,它红了不会让这个 job 红,所以不会挡任何 PR。删掉的脚本没有别的读者。回滚就是 revert 本 PR。 - 先看:`.github/workflows/ci.yml` 里 `Type Check UI` 新加的 `check:lockfile-integrity` 步骤;`ui/scripts/__tests__/check-lockfile-integrity.test.ts` 新加的四条接线测试。 - 两分钟验证:`pnpm --dir ui run check:lockfile-integrity --base-ref origin/main`,预期 `VERDICT clean — no package gained a copy.`,退出码 0。 - 需要你做的:本 PR 改了 `ci.yml`(Tier H),需要你明确批准;另外第 7-docs 行(objectui 文档站构建)记录里没定,席位会把选项拿给你。 ## What changes Rows of the #25697 workflow roster (comment 6388182608), read from the objectui workflows #26058 deleted (`lockfile-integrity.yml`, `lockfile-dedupe.yml`, `shadcn-check.yml` at `aa2f8e31f3`'s parent). | Row | objectui workflow | Disposition here | |---|---|---| | 19 | `lockfile-integrity.yml` (`check:lockfile-integrity`) | **ported**: one step of `Type Check UI`, `check:lockfile-integrity — compare this pull request's lockfile with its merge base` | | 18 | `lockfile-dedupe.yml` (`check:lockfile-dedupe`, report-only since objectui#9562's ruling A) | **retired**: alias, `ui/scripts/check-lockfile-dedupe.mjs` and its test deleted; nothing replaces it, by choice (#25920: 145 runs / 90 days / 0 failures) | | 26 | `shadcn-check.yml` (weekly report) | **retired**: `ui/scripts/shadcn-check-report.mjs` (the workflow's classifier and issue-body renderer) and its test deleted; nothing replaces the weekly report, by choice | - **Row 19, the step.** `if: github.event_name == 'pull_request'`, `continue-on-error: true`, before `pnpm install`, running `pnpm --dir ui run check:lockfile-integrity --base-ref "origin/${BASE_REF}"` with `BASE_REF` from `github.base_ref`. Why this job: it already checks out with `fetch-depth: 0`, so `origin/BASE` and the merge base are in the clone (objectui paid a separate job for that history), and the `ui` paths filter lists `pnpm-lock.yaml`, so every lockfile change runs it. Before the install because the script needs only Node builtins and two repo modules, as objectui ran it; Lint UI's pre-install import graph check holds that. `continue-on-error` keeps objectui's classification: a finding prints `::error title=Lockfile integrity::PACKAGES` on the pull request and does not fail the required job. Making it blocking stays the maintainer's call (`NOT_A_GATE` in `ui/scripts/dependabot-merge-gate.mjs`). No new job, no new check-run context, no new required context. - **Row 26, what stays.** `shadcn:check` and `shadcn:analyze` (and `shadcn-sync.js`, `shadcn-local-patches.mjs`, `component-analysis.js`) are not retired: they are the components package's maintainer commands, read by `ui/packages/components/README.md`, `README_SHADCN_SYNC.md`, `shadcn-components.json`, the other four `shadcn:*` aliases and `scripts/regen-artifacts.mjs`. The weekly workflow only scheduled them; its own artifact was the classifier, and that is what goes. The two ui tests that read `shadcn-sync` (`shadcn-local-patches.test.ts`, `shadcn-sync-fetch-cache.test.ts`) test those live scripts and stay. ### Forced test edits - `ui/scripts/__tests__/check-lockfile-integrity.test.ts`: the note saying the port would "bring both pins back against the root job" is replaced by those pins, read from root `ci.yml` through `helpers/root-ci`: the step exists and runs the gate against the pull request base; the job checks out with `fetch-depth: 0` before it; the step is `continue-on-error` and before the install; no other root workflow carries the alias. 13 → 17 cases. - `ui/scripts/__tests__/check-lockfile-dedupe.test.ts` and `ui/scripts/__tests__/shadcn-check-report.test.ts`: deleted with the scripts they test. ## Tests Measured in this worktree on head `a463a624`. <details><summary>Row 19: the step's command, and its counter-probe</summary> - `pnpm --dir ui run check:lockfile-integrity --base-ref origin/main` (the step's `run:` with `BASE_REF=main`): exit 0, `base: 7bb8084…:pnpm-lock.yaml (1941 resolutions) head: …/pnpm-lock.yaml (1941 resolutions)`, `VERDICT clean — no package gained a copy.` - Counter-probe: the root `pnpm-lock.yaml` mutated with the test's sample (a) (a second `ai@7.0.65(zod@4.6.7)` snapshot beside `ai@7.0.118(zod@4.6.7)`; marker count 1 on disk), then the same command: exit 1, `VERDICT 1 lockfile-integrity finding(s): 1 duplication(s).` and `::error title=Lockfile integrity::ai — see the run log; this is a lockfile regression, not a bundle regression (objectui#8326).` Restored by `git checkout HEAD -- pnpm-lock.yaml` under a trap; blob `8b64d515` before and after; `git diff HEAD` empty; re-run exit 0, `VERDICT clean`. - `pnpm --dir ui exec vitest run scripts/__tests__/check-lockfile-integrity.test.ts`: 17 passed. </details> <details><summary>Rows 18 and 26: every reader gone</summary> - `git grep -n -F check:lockfile-dedupe`: no hits (exit 1). - `git grep -n -F shadcn-check-report -- ':!ui/content/docs/guide/ci-cd-pipeline.md' ':!ui/scripts/dependabot-merge-gate.mjs'`: no hits. The two remaining mentions are prose about objectui's deleted workflows (Acceptance notes). - `git grep -n -F check-lockfile-dedupe -- ':!ui/content/docs/guide/ci-cd-pipeline.md' ':!ui/scripts/workspace-root.mjs'`: no hits. Same reason. </details> ## Acceptance notes - **Row 7-docs (`@object-ui/site`, objectui `ci.yml` "Build Docs") is not decided here.** The card says to decide it with F14 / docs-deploy (sub-issue 4 row 10). Read: #25712's item 5 says objectui's `docs-deploy.yml` should become "a second deploy job in this repo's `docs-deploy.yml` (the site stays a separate Vercel project) — the project id/secrets are the maintainer's"; #26058 then deleted it with "(none; objectui's site is a separate Vercel project)", and root `docs-deploy.yml` deploys `apps/docs` only. F14 (now on #25753) is the rewrite of `ui/content/docs/guide/ci-cd-pipeline.md`, not a build decision. So the record decides the deploy, which never landed, and not the per-PR build row. The options go to the seat in the card report; the card stays open (`Part of`). - `ui/content/docs/guide/ci-cd-pipeline.md` (F14, #25753) still describes `lockfile-integrity.yml`, `lockfile-dedupe.yml` and `shadcn-check.yml` as live, as it does every other deleted objectui workflow. Outside this card's file surface; F14 rewrites it. - `ui/scripts/workspace-root.mjs`'s docblock still names `check-lockfile-dedupe.mjs` as one of two pre-install importers, and `ui/scripts/dependabot-merge-gate.mjs` still classifies `Lockfile Dedupe Check` (`OPTIONAL_CONTEXTS`) and names `shadcn-check-report.mjs` in its header. Prose and context names from objectui's CI, outside the surface; `dependabot-merge-gate.mjs` runs in no root workflow. - The card delta named `dispatch-gates --tier` MANDATORY for `ci.yml`; measured on this change set it reports no path-derived mandate (`the surface hits none of the 4 declared glob(s)`). ## Verification Final head `a463a624`, after a root `pnpm build` (VERDICT command-exit 0, 12m30s under `os-verify-lock`). <details><summary>Gate sweep and reconciliation</summary> - `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` derived 74 commands for this change set (7 paths, 2175 changed lines). All 74 ran and exited 0, each exit code captured before any pipe. Among them: `pnpm --dir ui exec vitest run scripts/` under `os-verify-lock` (176 files passed, 2 skipped; 5032 tests passed, 2 skipped; VERDICT command-exit 0), `pnpm check:pm-dispatch-gates` (fast tier, 1935 cases), `pnpm check:required-contexts`, `pnpm check:ci-filter-parity`, `pnpm check:pm-expected-skips`, `pnpm check:workflow-step-name-quoting` and `pnpm check:published-files`. - `node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --ran LEDGER`: `✓ 74 derived famil(ies) accounted for — 74 run, 0 NOT-MEASURED`, 0 UNRUN. - `origin/main` moved 11 commits after the base `7bb80845`; none touches this PR's files, so it is not merged in. - Not run locally: `pnpm lint` and the full test suites, which are CI's run. </details> 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01ADHkmSracEMN5RmM9xs4Fu Co-authored-by: Claude <noreply@anthropic.com>
1 parent 6328a07 commit e6c4409

7 files changed

Lines changed: 82 additions & 2093 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3418,6 +3418,32 @@ jobs:
34183418
- name: Verify type-check coverage
34193419
run: pnpm --dir ui run type-check:coverage
34203420

3421+
# objectui's `lockfile-integrity.yml` (objectui#8326), row 19 of the
3422+
# objectstack#25697 workflow roster, ported by objectstack#26717: a pull
3423+
# request's `pnpm-lock.yaml` may not give any package a second physical
3424+
# copy. The script's header has the mechanism and its boundary.
3425+
#
3426+
# It lives here because this job already checks out with
3427+
# `fetch-depth: 0`, so `origin/<base>` and the merge base are in the
3428+
# clone, and because it runs on every change to `pnpm-lock.yaml` (the
3429+
# `ui` filter lists it). Before the install on purpose: the gate reads
3430+
# two text files with Node builtins only, which Lint UI's pre-install
3431+
# import graph check holds. `pull_request` only, because the gate's
3432+
# subject is the pull request's delta against its base; a push or queue
3433+
# run has none of its own.
3434+
#
3435+
# ⛔ `continue-on-error` keeps it an ALARM, as objectui ran it: a finding
3436+
# prints an `::error::` annotation naming the packages on the pull
3437+
# request and does NOT fail this required job. Making it blocking is a
3438+
# maintainer decision (`NOT_A_GATE` in `ui/scripts/dependabot-merge-gate.mjs`
3439+
# says why), not a step edit.
3440+
- name: check:lockfile-integrity — compare this pull request's lockfile with its merge base
3441+
if: github.event_name == 'pull_request'
3442+
continue-on-error: true
3443+
env:
3444+
BASE_REF: ${{ github.base_ref }}
3445+
run: pnpm --dir ui run check:lockfile-integrity --base-ref "origin/${BASE_REF}"
3446+
34213447
- name: Install dependencies
34223448
run: pnpm install --frozen-lockfile
34233449

‎ui/package.json‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@
8484
"check:merge-queue-head": "node scripts/check-merge-queue-head.mjs --self-test",
8585
"check:required-check-set": "node scripts/check-required-check-set.mjs --self-test",
8686
"check:lockfile-integrity": "node scripts/check-lockfile-integrity.mjs",
87-
"check:lockfile-dedupe": "node scripts/check-lockfile-dedupe.mjs",
8887
"merge-queue-head": "node scripts/check-merge-queue-head.mjs",
8988
"check:pre-install-import-graph": "node scripts/check-pre-install-import-graph.mjs",
9089
"check:test-path-roots": "node scripts/check-test-path-roots.mjs",

‎ui/scripts/__tests__/check-lockfile-dedupe.test.ts‎

Lines changed: 0 additions & 600 deletions
This file was deleted.

‎ui/scripts/__tests__/check-lockfile-integrity.test.ts‎

Lines changed: 56 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import { fileURLToPath } from 'node:url';
2525
import { describe, expect, it } from 'vitest';
2626
import { lockfilePath } from '../workspace-root.mjs';
2727

28+
import { jobBlock, rootCi, rootWorkflow, rootWorkflowFiles, uiRun, withoutComments } from './helpers/root-ci';
2829
import { NOT_A_GATE, OPTIONAL_CONTEXTS, REQUIRED_CONTEXTS } from '../dependabot-merge-gate.mjs';
2930
import {
3031
compareLockfiles,
@@ -38,7 +39,7 @@ const GATE = path.join(repoRoot, 'scripts/check-lockfile-integrity.mjs');
3839
const LOCKFILE = lockfilePath();
3940
const realLock = fs.readFileSync(LOCKFILE, 'utf8');
4041

41-
/** The check-run name the workflow's job produces. */
42+
/** The check-run name objectui's own job produced, the name the Dependabot merge gate classifies. */
4243
const CHECK_NAME = 'Lockfile Integrity Check';
4344

4445
describe('the gate runs its own self-test', () => {
@@ -191,15 +192,61 @@ describe('cause 2 — a declared dependency forks with no version moving (object
191192
});
192193
});
193194

194-
describe('the gate is classified the way the dispatch reserved', () => {
195-
// `exists and runs the gate` and `checks out deep enough to have a merge
196-
// base` retired with objectstack#25712. They read objectui's
197-
// `lockfile-integrity.yml`, which runs nowhere under the monorepo: GitHub
198-
// runs the root `.github/workflows/` alone. That workflow is row 19 of the
199-
// objectstack#25697 workflow roster, "kept, follow-up port", re-aimed at the
200-
// one root `pnpm-lock.yaml`; the port brings both pins back against the root
201-
// job that runs the gate.
195+
describe('the gate is wired into the root CI (objectstack#26717)', () => {
196+
// objectui ran it in its own `lockfile-integrity.yml`, which runs nowhere
197+
// under the monorepo: GitHub runs the root `.github/workflows/` alone. Row 19
198+
// of the objectstack#25697 workflow roster ported it as one step of root
199+
// `ci.yml`'s `type-check-ui` job, re-aimed at the one root `pnpm-lock.yaml`.
200+
// The two pins objectui kept on its workflow (`exists and runs the gate`,
201+
// `checks out deep enough to have a merge base`) read that job now.
202+
const JOB = 'type-check-ui';
203+
const STEP_NAME = 'check:lockfile-integrity — ';
204+
const COMMAND = `${uiRun('check:lockfile-integrity')} --base-ref "origin/\${BASE_REF}"`;
205+
206+
/** The step's own lines, from its `- name:` to the next step. Throws when it is gone. */
207+
function step(): string {
208+
const block = withoutComments(jobBlock(rootCi(), JOB));
209+
const start = block.indexOf(`- name: ${STEP_NAME}`);
210+
if (start === -1) throw new Error(`ci.yml job ${JOB} has no step named ${STEP_NAME}…`);
211+
const next = block.indexOf('\n - ', start + 1);
212+
return next === -1 ? block.slice(start) : block.slice(start, next);
213+
}
214+
215+
it('exists and runs the gate against the pull request base', () => {
216+
expect(step()).toContain(`run: ${COMMAND}`);
217+
expect(step()).toContain('BASE_REF: ${{ github.base_ref }}');
218+
expect(step()).toContain("if: github.event_name == 'pull_request'");
219+
});
220+
221+
it('checks out deep enough to have a merge base', () => {
222+
// A shallow clone has no merge base, and the script exits 2 rather than
223+
// guess one: a reading that never measured the change.
224+
const block = withoutComments(jobBlock(rootCi(), JOB));
225+
const checkout = block.indexOf('uses: actions/checkout@');
226+
expect(checkout).toBeGreaterThan(-1);
227+
expect(block.indexOf('fetch-depth: 0', checkout)).toBeGreaterThan(checkout);
228+
expect(block.indexOf('fetch-depth: 0', checkout)).toBeLessThan(block.indexOf(`- name: ${STEP_NAME}`));
229+
});
202230

231+
it('⛔ stays an alarm in a required job: continue-on-error, before the install', () => {
232+
// The step's finding must not fail Type Check UI; enrolling the gate is
233+
// the maintainer's decision (the classification below). Before the
234+
// install, because the script needs nothing installed.
235+
expect(step()).toContain('continue-on-error: true');
236+
const block = withoutComments(jobBlock(rootCi(), JOB));
237+
expect(block.indexOf(`- name: ${STEP_NAME}`)).toBeLessThan(block.indexOf('run: pnpm install --frozen-lockfile'));
238+
});
239+
240+
it('runs in that one place: no other root workflow carries it', () => {
241+
const carriers = rootWorkflowFiles().filter((file) =>
242+
withoutComments(rootWorkflow(file)).includes('check:lockfile-integrity'),
243+
);
244+
expect(carriers).toEqual(['ci.yml']);
245+
expect(withoutComments(rootCi()).split('check:lockfile-integrity').length - 1).toBe(2); // the name and the run
246+
});
247+
});
248+
249+
describe('the gate is classified the way the dispatch reserved', () => {
203250
it('⛔ is classified as NOT a blocking context (the maintainer floor)', () => {
204251
expect(Object.keys(NOT_A_GATE)).toContain(CHECK_NAME);
205252
expect(REQUIRED_CONTEXTS).not.toContain(CHECK_NAME);

0 commit comments

Comments
 (0)