Skip to content

Re-align stale @objectstack/objectql tests with current overlay registry & sys_metadata schema - #1363

Merged
hotlong merged 2 commits into
mainfrom
copilot/fix-ci-errors-a963c9da-ee0b-42f1-9910-4a9ec31273eb
May 27, 2026
Merged

hotlong merged 2 commits into
mainfrom
copilot/fix-ci-errors-a963c9da-ee0b-42f1-9910-4a9ec31273eb

Conversation

Copilot AI commented May 27, 2026

Copy link
Copy Markdown
Contributor

@objectstack/objectql#test (the only failing CI job) blew up the first time the Test Core paths filter re-engaged after the project-mode/overlay refactor — f0c87d977 touched packages/** LICENSE files and surfaced ~21 stale fixtures (4 real failures once workspace deps are built).

Root cause

  • ba252da0b (project mode, metadata forms, org overlays) flipped allowOrgOverride: false → true in DEFAULT_METADATA_TYPE_REGISTRY for object, field, action, flow, workflow, approval, agent. Whitelist tests still expected those types to be rejected.
  • 482eb67cc + feat(metadata): durable sys_metadata_history writes reshaped sys_metadata rows (added checksum/created_at/updated_at, dropped scope), split history into a dedicated sys_metadata_history table, added parentVersion optimistic-concurrency, and stopped wrapping DB errors with "Failed to persist customization overlay…". Persistence assertions never followed.

Changes — test files only, no production code touched

  • overlay-precedence.test.ts — denied list rebuilt around the types that are still allowOrgOverride: false (trigger, validation, hook, datasource, router, function, service); the "registry-as-source-of-truth" invariant now pins the current allowed/denied split and its plural-form coverage uses a denied type with a real SINGULAR_TO_PLURAL entry. Header docstring rewritten so the architectural intent stays accurate.
  • protocol-meta.test.ts — insert/update expectations match the new row shape; update-path tests now pass the correct parentVersion derived from the mocked existing row's checksum; fail-fast tests assert raw DB error propagation (/Connection refused/, /Table not found/) instead of the removed wrapper.
  • protocol-meta-types-rich.test.ts — switched the deny + OBJECTSTACK_METADATA_WRITABLE env-elevation cases to function/trigger (still non-overridable), and registered both in beforeEach so getMetaTypes() (which iterates engine.registry.getRegisteredTypes()) actually surfaces them.
  • sys-metadata-repository.test.ts — put refuses non-allowOrgOverride types cases switched from object/flow to trigger/function.

Result

pnpm turbo run test --filter @objectstack/objectql → 23 files, 371/371 passing. CHANGELOG.md updated.

Copilot AI and others added 2 commits May 27, 2026 10:37
- Register `function` and `trigger` in protocol-meta-types-rich.test.ts beforeEach
  so getMetaTypes() includes them in entries (method only returns types present in
  getRegisteredTypes(), so types must be registered to appear in entries)
- This fixes the last failing test: `honours OBJECTSTACK_METADATA_WRITABLE to
  elevate allowOrgOverride` which needed `functionEntry` to be non-undefined

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@vercel

vercel Bot commented May 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Building Building Preview, Comment May 27, 2026 10:41am

Request Review

This branch was successfully deployed

1 active deployment
Preview — 424de980 Deployed May 27, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants