Skip to content

Fix test data to match evolved schemas - #137

Merged
hotlong merged 14 commits into
mainfrom
copilot/fix-action-step-issue-another-one
Jan 25, 2026
Merged

Fix test data to match evolved schemas#137
hotlong merged 14 commits into
mainfrom
copilot/fix-action-step-issue-another-one

Conversation

CopilotAI commented Jan 25, 2026

Copy link
Copy Markdown
Contributor

Tests were failing because schemas evolved but test data wasn't updated. Three files affected:

sharing.test.ts

  • Schema now uses discriminated unions requiring type field and structured sharedWith object
  • Updated from flat string values to typed objects:
// Before{name: 'rule',object: 'account',sharedWith: 'group_id'}// After {name: 'rule',object: 'account',type: 'criteria',condition: "status = 'Active'",sharedWith: {type: 'group',value: 'group_id'}}

driver.test.ts

  • Added missing required methods to all driver mocks: findStream, upsert

plugin.test.ts

  • Added missing required drivers field to all PluginContext mocks

All 64 tests in affected files now pass.

Original prompt

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


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@vercel

vercelBot commented Jan 25, 2026

Copy link
Copy Markdown

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

ProjectDeploymentReviewUpdated (UTC)
specReadyReadyPreview, CommentJan 25, 2026 5:40am

Request Review

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
@hotlong
hotlong marked this pull request as ready for review January 25, 2026 03:19
CopilotAI review requested due to automatic review settings January 25, 2026 03:19
CopilotAI changed the title [WIP] Fix issue in action step executionFix test data to match evolved schemasJan 25, 2026
CopilotAI requested a review from hotlongJanuary 25, 2026 03:20

CopilotAI 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 fixes test failures caused by schema updates in the ObjectStack spec package. The changes align test files with updated Zod schema definitions for sharing rules, plugin context, and driver interfaces.

Changes:

  • Updated sharing rule tests to match the new discriminated union schema structure (owner vs criteria types, structured sharedWith/ownedBy objects, and 'condition' instead of 'criteria')
  • Added missing 'drivers' field to all plugin context mock objects in tests
  • Added missing 'findStream' and 'upsert' methods to all driver interface mock objects in tests

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

FileDescription
packages/spec/src/permission/sharing.test.tsUpdated all test cases to align with the new SharingRuleSchema structure, including proper type restrictions ('owner', 'criteria'), level support ('full' added), structured sharedWith/ownedBy objects, and field renaming (criteria → condition)
packages/spec/src/kernel/plugin.test.tsAdded the drivers.register field to all plugin context mock objects to match the PluginContextSchema definition
packages/spec/src/driver/driver.test.tsAdded findStream and upsert methods to all driver interface mock objects to match the DriverInterfaceSchema definition

CopilotAIand others added 4 commits January 25, 2026 04:41
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
CopilotAIand others added 4 commits January 25, 2026 05:02
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
CopilotAIand others added 3 commits January 25, 2026 05:27
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@hotlong