Skip to content

Commit 97fad97

Browse files
test(cli): nightly e2e fixtures open their object from app navigation (#38534)
<!-- claude-projects-attribution: {"github_login":"os-project-manager"} --> _Requested by **Leehom** · [project thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XHogQ9ogKPxHhiFfT2UQgJi)_ Fixes #38493 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户无感:只改了三个夜间测试里的示例配置,产品行为没有任何变化。 - 为什么做:夜间测试自昨天起一直报红,原因是新加的「应用导航」发布检查让这些本该干净的示例配置多出了警告。 - 出错会怎样:只影响测试,不影响用户;若有问题,直接撤回此改动即可。 - 要你做什么:无。 ## What changes Test fixtures only, in the three nightly-tier CLI suites the card names. Each fixture that is meant to raise no advisory now declares an app whose `navigation` opens its object (`{ id: 'nav_ticket', type: 'object', label: 'Tickets', objectName: ... }`) and gives that object a list view (`listViews: { all: { type: 'grid', columns: ['title'] } }`). No rule, assertion, test name or skip changed. - `packages/cli/src/commands/validate-json-strict-exit.e2e.test.ts`: the clean control, the conversions minimal pair and the severity minimal pair (all three copy one object and app). - `packages/cli/test/validate-json-warning-parity.e2e.test.ts`: the clean control. - `packages/cli/test/jsx-gate-manifest-notice.e2e.test.ts`: the `stack()` and `packageCarried()` builders. The html-page members already had a navigation entry, but it opened only the page, and an html page names no object, so the object was unreachable. Every member now carries the object entry, with the page entry beside it where there is a page. ## Why The publish-time app-shell rules that d578952 (#38107) added in `packages/lint/src/validate-app-shell-reach.ts` warn on an app with no navigation entry (`app-navigation-empty`), on an object no entry opens (`object-unreachable-from-navigation`), and on an object opened as a list with no list view (`object-without-view`). The rules are intended behaviour. The fixtures predate them, and these suites are `*.e2e.test.*` files, which run only in the nightly tier (`OS_TEST_TIERS=nightly`), so #38107's own PR checks never ran them. So the "nothing to warn about" controls, `--strict` exit 0 and `lint` `passed: true / failing: 0` went red. The before log shows all three rules: 6 lines naming `app-navigation-empty`, 14 naming `object-unreachable-from-navigation` and 2 naming `object-without-view`. The third rule hit the `jsx-gate` member with no pages, whose navigation already opened the object but with no list view. That rule comes from the same commit and the same validator file. No failure had any other cause. Per test, nothing was out of scope: no failing test counts findings that these rules add on purpose. Every failing test asserts a zero-advisory baseline (exit 0 under `--strict`, an empty warning set, `failing: 0`, or exactly one finding of a named kind). In each one, the right fix was to make the baseline clean again, not to widen the count. ## Tests <details><summary>Before / after, nightly tier, the three files (head 1af5b3e, origin/main merged)</summary> Command (run under `scripts/pm/os-verify-lock.sh`, after `pnpm turbo run build --filter='@objectstack/cli^...'`): ``` OS_TEST_TIERS=nightly pnpm --filter @objectstack/cli exec vitest run --maxWorkers=2 src/commands/validate-json-strict-exit.e2e.test.ts test/jsx-gate-manifest-notice.e2e.test.ts test/validate-json-warning-parity.e2e.test.ts ``` - Before (the three files restored to merge base 545a4fa, everything else at the head): `Test Files 3 failed (3)`, `Tests 15 failed | 41 passed (56)`. That matches the 15 failures in run 46229659209. - After: `Test Files 3 passed (3)`, `Tests 56 passed (56)`. - `pnpm --filter @objectstack/cli typecheck`: exit 0. Both legs compile these files (`src/**` through `tsconfig.json`, `test/**` through `tsconfig.test.json`). </details> ## Acceptance notes - Other `*.e2e.test.*` / `*.live.test.*` files that declare apps with no navigation (8 under `packages/cli/test/`: `artifact-pinned-boot`, three `i18n-extract-*`, `serve-app-anchored-optional-import`, `serve-cluster-driver-diagnosis`, `serve-runtime-assets-branding-warning`, `start-signal-forwarding`) run `serve`, `start` or `i18n`, never `validate`, `lint` or `build`. The rules do not run there, and none of these files is in the nightly's failing list. No finding. ## Verification <details><summary>Gates</summary> - `node scripts/pm/dispatch-gates.mjs --commands` on head 1af5b3e: 55 commands. 51 exit 0. 4 exit 3 (PREREQUISITE NOT MET, the workspace `dist/` is not built): `check:dual-build-cjs-loads`, `check:i18n`, `check:i18n-coverage`, `check:i18n-walk-parity`. These are NOT MEASURED locally and left to CI: they read built output, which no file in this diff feeds. - `dispatch-gates --ran`: `55 derived famil(ies) accounted for — 51 run, 4 NOT-MEASURED (4 DERIVED from a recorded exit 3)`. - `check-governed-merges --test` on the three-dot file list: NOT governed. - `overlap-check`: `VERDICT clean exit 0`. - No changeset. Test files only, and neither package build ships them (`tsconfig.build.json` excludes `src/**/*.test.ts`, and `test/` is outside `files[]`), so this takes `skip-changeset`. </details> Two-minute check: run the command above. Expected: `Tests 56 passed (56)`. Read first: `packages/cli/test/jsx-gate-manifest-notice.e2e.test.ts` `stack()` (the one fixture whose navigation shape changed rather than grew). <!-- signed: repo:objectstack#5 · os-project-manager · session_01FEkQ5oPfjnm2yWHEwkiYrn --> --- _Generated by [Claude Code](https://claude.ai/code/session_01FEkQ5oPfjnm2yWHEwkiYrn)_ Co-authored-by: Claude <noreply@anthropic.com>
1 parent 1dccbb1 commit 97fad97

3 files changed

Lines changed: 51 additions & 13 deletions

File tree

‎packages/cli/src/commands/validate-json-strict-exit.e2e.test.ts‎

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,15 @@ export default defineStack({
170170
}, { strict: false });
171171
`;
172172

173-
/** The zero-warning control — pins the other end of the matrix. */
173+
/**
174+
* The zero-warning control — pins the other end of the matrix.
175+
*
176+
* The app opens its object from navigation and the object declares a list
177+
* view: without the entry the app-shell rules raise `app-navigation-empty` and
178+
* `object-unreachable-from-navigation`, and with the entry but no view they
179+
* raise `object-without-view`, each a warning `--strict` promotes. The fixtures
180+
* below copy this object and app, for the same reason.
181+
*/
174182
const CLEAN_SOURCE = `
175183
import { defineStack } from '@objectstack/spec';
176184
@@ -181,8 +189,13 @@ export default defineStack({
181189
label: 'Ticket',
182190
sharingModel: 'private',
183191
fields: { title: { type: 'text', label: 'Title' } },
192+
listViews: { all: { type: 'grid', columns: ['title'] } },
193+
}],
194+
apps: [{
195+
name: 'strictexit_app',
196+
label: 'Strict Exit App',
197+
navigation: [{ id: 'nav_ticket', type: 'object', label: 'Tickets', objectName: 'strictexit_ticket' }],
184198
}],
185-
apps: [{ name: 'strictexit_app', label: 'Strict Exit App' }],
186199
}, { strict: false });
187200
`;
188201

@@ -210,8 +223,13 @@ export default defineStack({
210223
label: 'Ticket',
211224
sharingModel: 'private',
212225
fields: { title: { type: 'text', label: 'Title' } },
226+
listViews: { all: { type: 'grid', columns: ['title'] } },
227+
}],
228+
apps: [{
229+
name: 'strictexit_app',
230+
label: 'Strict Exit App',
231+
navigation: [{ id: 'nav_ticket', type: 'object', label: 'Tickets', objectName: 'strictexit_ticket' }],
213232
}],
214-
apps: [{ name: 'strictexit_app', label: 'Strict Exit App' }],
215233
flows: [{
216234
name: 'strictexit_notify',
217235
label: 'Notify',
@@ -249,8 +267,13 @@ export default defineStack({
249267
label: 'Ticket',
250268
sharingModel: 'private',
251269
fields: { title: { type: 'text', label: 'Title' } },
270+
listViews: { all: { type: 'grid', columns: ['title'] } },
271+
}],
272+
apps: [{
273+
name: 'strictexit_app',
274+
label: 'Strict Exit App',
275+
navigation: [{ id: 'nav_ticket', type: 'object', label: 'Tickets', objectName: 'strictexit_ticket' }],
252276
}],
253-
apps: [{ name: 'strictexit_app', label: 'Strict Exit App' }],
254277
${finding === 'info'
255278
? ` permissions: [{ name: 'strictexit_reader', label: 'Reader', objects: { strictexit_ticket: { allowRead: true } } }],`
256279
: ` tools: [{

‎packages/cli/test/jsx-gate-manifest-notice.e2e.test.ts‎

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,17 +125,20 @@ function noticesIn(payload: Record<string, unknown>): Array<Record<string, unkno
125125
}
126126

127127
/**
128-
* A stack with no advisory of its own on any of the three commands — an app,
129-
* an engines range, a private object — so under `--strict` the ONLY thing that
128+
* A stack with no advisory of its own on any of the three commands — an app
129+
* whose navigation opens the object, an engines range, a private object with a
130+
* list view (the app-shell rules warn on an object no entry opens, and on one
131+
* opened with no list view) — so under `--strict` the ONLY thing that
130132
* could move the exit status is the notice. `body` is the page source, or
131133
* `null` for a stack with no pages at all.
132134
*/
133135
function stack(body: string | null): string {
134136
const pages = body === null ? '' : `pages: [{ name: 'jxg_landing', label: 'Landing', kind: 'html', source: '${body}' }],`;
137+
// The object entry in every member, so the app-shell rules find the object
138+
// reachable; the page entry beside it only where there is a page to open.
139+
const ticket = `{ id: 'nav_ticket', type: 'object', label: 'Tickets', objectName: 'jxg_ticket' }`;
135140
const nav =
136-
body === null
137-
? `{ id: 'nav_ticket', type: 'object', label: 'Tickets', objectName: 'jxg_ticket' }`
138-
: `{ id: 'nav_landing', type: 'page', label: 'Landing', pageName: 'jxg_landing' }`;
141+
body === null ? ticket : `${ticket}, { id: 'nav_landing', type: 'page', label: 'Landing', pageName: 'jxg_landing' }`;
139142
return `
140143
import { defineStack } from '@objectstack/spec';
141144
@@ -144,7 +147,7 @@ export default defineStack({
144147
${pages}
145148
apps: [{ name: 'jxg_app', label: 'JXG', navigation: [${nav}] }],
146149
objects: [
147-
{ name: 'jxg_ticket', label: 'Ticket', sharingModel: 'private', fields: { title: { type: 'text', label: 'Title' } } },
150+
{ name: 'jxg_ticket', label: 'Ticket', sharingModel: 'private', fields: { title: { type: 'text', label: 'Title' } }, listViews: { all: { type: 'grid', columns: ['title'] } } },
148151
],
149152
}, { strict: false });
150153
`;
@@ -172,7 +175,7 @@ export default defineStack({
172175
],
173176
apps: [{ name: 'jxg_app', label: 'JXG', navigation: [{ id: 'nav_ticket', type: 'object', label: 'Tickets', objectName: 'jxg_ticket' }] }],
174177
objects: [
175-
{ name: 'jxg_ticket', label: 'Ticket', sharingModel: 'private', fields: { title: { type: 'text', label: 'Title' } } },
178+
{ name: 'jxg_ticket', label: 'Ticket', sharingModel: 'private', fields: { title: { type: 'text', label: 'Title' } }, listViews: { all: { type: 'grid', columns: ['title'] } } },
176179
],
177180
}, { strict: false });
178181
`;

‎packages/cli/test/validate-json-warning-parity.e2e.test.ts‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,14 @@ export default defineStack({
132132
},
133133
];
134134

135-
/** The zero-warning control — see the test that uses it. */
135+
/**
136+
* The zero-warning control — see the test that uses it.
137+
*
138+
* The app opens its object from navigation and the object declares a list
139+
* view: without the entry the app-shell rules raise `app-navigation-empty` and
140+
* `object-unreachable-from-navigation`, and with the entry but no view they
141+
* raise `object-without-view`.
142+
*/
136143
const CLEAN_SOURCE = `
137144
import { defineStack } from '@objectstack/spec';
138145
@@ -143,8 +150,13 @@ export default defineStack({
143150
label: 'Ticket',
144151
sharingModel: 'private',
145152
fields: { title: { type: 'text', label: 'Title' } },
153+
listViews: { all: { type: 'grid', columns: ['title'] } },
154+
}],
155+
apps: [{
156+
name: 'clean_app',
157+
label: 'Clean App',
158+
navigation: [{ id: 'nav_ticket', type: 'object', label: 'Tickets', objectName: 'clean_ticket' }],
146159
}],
147-
apps: [{ name: 'clean_app', label: 'Clean App' }],
148160
}, { strict: false });
149161
`;
150162

0 commit comments

Comments
 (0)