Skip to content

Fix test suite for schema evolution: import paths, filter syntax, capability fields#143

Merged
hotlong merged 2 commits into
copilot/fix-action-step-issue-another-onefrom
copilot/check-job-step-status
Jan 25, 2026
Merged

Fix test suite for schema evolution: import paths, filter syntax, capability fields#143
hotlong merged 2 commits into
copilot/fix-action-step-issue-another-onefrom
copilot/check-job-step-status

Conversation

Copilot AI commented Jan 25, 2026

Copy link
Copy Markdown
Contributor

Three test files failed due to schema evolution. Tests were using outdated import paths, deprecated filter syntax, and old capability field names.

Changes

endpoint.test.ts

  • Fixed import: ../system/api.zod./endpoint.zod + ./router.zod (file never existed in system/)
  • Updated HttpMethod validation: HEAD and OPTIONS now accepted per router schema

contract.test.ts

  • Migrated filter syntax from array to object format:
    // Before
    filters: ['status', '=', 'active']
    
    // After
    where: { status: 'active' }
    QuerySchema now uses FilterConditionSchema (object-based, MongoDB-style)

object.test.ts

  • Updated capability fields: feedEnabledfeeds, added activities, clone, mru
  • Aligned with Salesforce/ServiceNow-inspired capability model

All 1577 tests passing.

Original prompt

引用: https://github.com/objectstack-ai/spec/actions/runs/21327435927/job/61387062939#step:8:1


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@vercel

vercel Bot commented Jan 25, 2026

Copy link
Copy Markdown

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

Project Deployment Review Updated (UTC)
spec Ready Ready Preview, Comment Jan 25, 2026 5:33am

Request Review

…and test expectations

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot AI changed the title [WIP] Check job step status in workflow Fix test suite for schema evolution: import paths, filter syntax, capability fields Jan 25, 2026
Copilot AI requested a review from hotlong January 25, 2026 05:33
@hotlong
hotlong marked this pull request as ready for review January 25, 2026 05:38
Copilot AI review requested due to automatic review settings January 25, 2026 05:38
@hotlong
hotlong merged commit eb5d00d into copilot/fix-action-step-issue-another-one Jan 25, 2026
5 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses test failures caused by schema evolution across three test files. The changes align tests with updated schemas for API endpoints, contract specifications, and object capabilities.

Changes:

  • Updated import paths in endpoint.test.ts from non-existent ../system/api.zod to correct locations (./endpoint.zod and ./router.zod)
  • Migrated filter syntax in contract.test.ts from deprecated array format (filters: ['status', '=', 'active']) to object-based format (where: { status: 'active' })
  • Updated capability field names in object.test.ts from feedEnabled to feeds and added new capability fields (activities, mru, clone)

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
packages/spec/src/api/endpoint.test.ts Fixed import paths and updated HttpMethod tests to include HEAD and OPTIONS as valid methods
packages/spec/src/api/contract.test.ts Migrated export request test from array-based filter syntax to object-based where clause
packages/spec/src/data/object.test.ts Updated capability field tests from feedEnabled to feeds and added new capability fields (activities, mru, clone)

Comment on lines +12 to +16
expect(result.feeds).toBe(false);
expect(result.activities).toBe(false);
expect(result.trash).toBe(true);
expect(result.mru).toBe(true);
expect(result.clone).toBe(true);

Copilot AI Jan 25, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incomplete migration: While this test case has been updated to use the new capability fields (feeds, activities, mru, clone), there are other test cases in the same file at lines 217, 308, and 379 that still use the deprecated 'feedEnabled' field. These need to be updated to 'feeds' as well, and should include the new capability fields to ensure complete test coverage. The schema no longer accepts 'feedEnabled' (see object.zod.ts line 45), so those tests would fail.

Copilot uses AI. Check for mistakes.
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.

3 participants