Skip to content

feat: support single-arg schema diff against current context#705

Draft
jzelinskie wants to merge 1 commit into
authzed:mainfrom
jzelinskie:1-arg-schema-diff
Draft

feat: support single-arg schema diff against current context#705
jzelinskie wants to merge 1 commit into
authzed:mainfrom
jzelinskie:1-arg-schema-diff

Conversation

@jzelinskie

@jzelinskie jzelinskie commented Jun 26, 2026

Copy link
Copy Markdown
Member

Description

When invoked with one file argument, zed schema diff now reads the schema file and sends it to the SpiceDB DiffSchema API, comparing it against the schema stored in the current context's permissions system. The existing two-file local diff behavior is preserved.

Both code paths convert to a DiffSchemaResponse proto and share a single print function, producing identical grouped output. A --json flag is supported for both modes.

Sorry this code is very noisy because I wanted to make sure the formatting was consistent for both codepaths.

Testing

Run the unit tests or build locally and run zed schema diff test.zed.

References

N/A

When invoked with one file argument, `zed schema diff` now reads the
schema file and sends it to the SpiceDB DiffSchema API, comparing it
against the schema stored in the current context's permissions system.
The existing two-file local diff behavior is preserved.

Both code paths convert to a DiffSchemaResponse proto and share a single
print function, producing identical grouped output. A --json flag is
supported for both modes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 39.03226% with 189 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/cmd/schema.go 39.03% 185 Missing and 4 partials ⚠️

📢 Thoughts on this report? Let us know!

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