Skip to content

chore: fix self validation by pulling in most recent SpiceDB#624

Merged
tstirrat15 merged 1 commit intomainfrom
fix-self-validation
Feb 5, 2026
Merged

chore: fix self validation by pulling in most recent SpiceDB#624
tstirrat15 merged 1 commit intomainfrom
fix-self-validation

Conversation

@tstirrat15
Copy link
Contributor

@tstirrat15 tstirrat15 commented Feb 5, 2026

Fixes #623

Description

This pulls in most recent main for SpiceDB which fixes validation of schemas with the self keyword.

Changes

  • Pull in SpiceDB
  • Update schema function signature

Testing

Review. See that you can go run ./cmd/zed/... validate this schema:

use self

definition user {
  relation viewer: user
  permission view = viewer + self
}

miparnisari
miparnisari previously approved these changes Feb 5, 2026
Copy link
Contributor Author

@tstirrat15 tstirrat15 left a comment

Choose a reason for hiding this comment

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

See comments

// SpiceDB returns an error when no schema is defined, which is expected
require.Error(t, err)
assert.Contains(t, err.Error(), "No schema has been defined")
assert.Contains(t, err.Error(), "no schema has been defined")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This error message changed in the new version.

relationships := []*core.RelationTuple{}

nsDefs, err := reader.ListAllNamespaces(ctx)
schemaReader, err := reader.SchemaReader()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These changes are to use the new SchemaReader interface and stop using a part of the interface that was removed.

@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 42.46%. Comparing base (02bdd7d) to head (8394c3b).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #624   +/-   ##
=======================================
  Coverage   42.46%   42.46%           
=======================================
  Files          38       38           
  Lines        5032     5032           
=======================================
  Hits         2137     2137           
  Misses       2639     2639           
  Partials      256      256           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tstirrat15 tstirrat15 enabled auto-merge (squash) February 5, 2026 21:19
@tstirrat15 tstirrat15 merged commit c5f00b2 into main Feb 5, 2026
12 checks passed
@tstirrat15 tstirrat15 deleted the fix-self-validation branch February 5, 2026 21:36
@github-actions github-actions bot locked and limited conversation to collaborators Feb 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

zed cli doesn't yet support validation or import on schemas containing use self or the self relation

3 participants