Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 25, 2026

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
Copy link

vercel bot commented Jan 25, 2026

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: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
Copilot AI review requested due to automatic review settings January 25, 2026 03:19
Copilot AI changed the title [WIP] Fix issue in action step execution Fix test data to match evolved schemas Jan 25, 2026
Copilot AI requested a review from hotlong January 25, 2026 03:20
Copy link
Contributor

Copilot AI left a comment

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.

File Description
packages/spec/src/permission/sharing.test.ts Updated 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.ts Added the drivers.register field to all plugin context mock objects to match the PluginContextSchema definition
packages/spec/src/driver/driver.test.ts Added findStream and upsert methods to all driver interface mock objects to match the DriverInterfaceSchema definition

Copilot AI and 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>
Copilot AI and 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>
@github-actions github-actions bot removed the size/m label Jan 25, 2026
Copilot AI and others added 3 commits January 25, 2026 05:27
@hotlong hotlong merged commit 262e76d into main Jan 25, 2026
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants