Skip to content

Commit b0231ea

Browse files
xuyushun441-sysos-zhuangclaude
authored
ci: add metadata test/lint gates (vitest + validate); fix broken lint step (#367)
CI called `pnpm run lint` but the repo had no `lint` script, so the "Build and Test" workflow failed at the lint step on every commit (pre-existing, also red on main). Aligns the scripts/CI with the @objectstack metadata-app conventions (see framework examples). package.json scripts: - validate: `objectstack validate` — protocol/schema gate (blocking). - lint: `objectstack lint --skip-i18n` — metadata conventions (advisory). - test: `vitest run` — structural metadata smoke test (was the no-op `objectstack test`, which needs qa/*.test.json + a live server → kept as `test:qa`). - verify: validate && typecheck && build && test. test/smoke.test.ts (vitest, no server — mirrors framework app-crm): asserts manifest, core objects, all 16 flows incl. the 6 workflows[]-migrated ones, and guards the 7.7 migration (no object `workflows[]`; every notify `severity` ∈ info|warning|critical). CI (ci.yml + code-quality.yml): blocking gates are now validate + typecheck + build + test; `objectstack lint` runs advisory (`continue-on-error`) because its `required/label` rule false-positives on standard list-views (checks top-level `view.label`, but the view schema only supports `list.label`) — filed upstream. Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 814ff84 commit b0231ea

6 files changed

Lines changed: 712 additions & 79 deletions

File tree

.github/workflows/ci.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,19 @@ jobs:
3434
- name: Install dependencies
3535
run: pnpm install --frozen-lockfile
3636

37-
- name: Run linter
37+
- name: Validate metadata (protocol/schema)
38+
run: pnpm run validate
39+
40+
- name: Lint metadata conventions (advisory)
3841
run: pnpm run lint
39-
42+
continue-on-error: true
43+
4044
- name: TypeScript type checking
4145
run: pnpm run typecheck
42-
46+
4347
- name: Build project
4448
run: pnpm run build
45-
49+
4650
- name: Run tests
4751
run: pnpm test
4852

.github/workflows/code-quality.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,14 @@ jobs:
5151

5252
- name: Check TypeScript compilation
5353
run: pnpm run typecheck
54-
55-
- name: Run ESLint
54+
55+
- name: Validate metadata (protocol/schema)
56+
run: pnpm run validate
57+
58+
- name: Lint metadata conventions (advisory)
5659
run: pnpm run lint
57-
60+
continue-on-error: true
61+
5862
- name: Check for TODO comments
5963
run: |
6064
echo "Checking for TODO/FIXME comments..."

package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@
1414
"start": "objectstack start -p 4001",
1515
"build": "objectstack build",
1616
"typecheck": "tsc --noEmit",
17-
"test": "objectstack test",
17+
"validate": "objectstack validate",
18+
"lint": "objectstack lint --skip-i18n",
19+
"test": "vitest run",
20+
"test:qa": "objectstack test",
1821
"test:e2e": "playwright test",
22+
"verify": "pnpm validate && pnpm typecheck && pnpm build && pnpm test",
1923
"demo:reset": "rm -rf .objectstack/data && pnpm build && echo '✅ DB reset — start the server with: pnpm dev (or pnpm start). Seed data loads on first boot.'"
2024
},
2125
"packageManager": "pnpm@10.33.0",
@@ -37,7 +41,8 @@
3741
},
3842
"devDependencies": {
3943
"@playwright/test": "^1.60.0",
40-
"typescript": "^6.0.3"
44+
"typescript": "^6.0.3",
45+
"vitest": "^4.1.8"
4146
},
4247
"engines": {
4348
"node": ">=20",

0 commit comments

Comments
 (0)