Skip to content

Conversation

@miparnisari
Copy link
Contributor

@miparnisari miparnisari commented Dec 23, 2025

Fixes this:

~/Documents/GitHub/zed (main) $ ./zed ctx list
 CURRENT  NAME        ENDPOINT              TOKEN                          TLS CERT 
    ✓     serverless  grpc.authzed.com:443  tc_adminclient_def_<redacted>  system   

~/Documents/GitHub/zed (main) $ cat schema.yaml 
---
schema: |+
  definition user {}

  caveat only_on_tuesday(day_of_week string) {
    day_of_week == 'tuesday'
  }

  definition document {
        relation writer: user
        relation reader: user with only_on_tuesday
    permission write = writer
    permission view = reader + write
  }

relationships: |
  document:1#reader@user:1[only_on_tuesday]
  document:2#writer@user:1
  document:3#writer@user:1
  document:4#writer@user:1%                                                                       

~/Documents/GitHub/zed (main) $ ./zed import /Users/miparnisari/Documents/GitHub/zed/schema.yaml  --log-level=debug
7:44PM DBG configured logging async=false format=auto log_level=debug provider=zerolog
7:44PM DBG error reading server version response header and trailer; it may be disabled on the server
7:44PM WRN not calling a released version of SpiceDB version=
7:44PM DBG extracted response dispatch metadata cached=0 dispatch=0
7:44PM DBG found schema definition prefix prefix=maineparnisari
7:44PM INF importing schema
7:44PM DBG extracted response dispatch metadata cached=0 dispatch=0
7:44PM INF importing relationships batch_size=1000 count=4 workers=1
7:44PM DBG extracted response dispatch metadata cached=0 dispatch=0
7:44PM ERR terminated with errors error="rpc error: code = InvalidArgument desc = the length of the unpacked is not equal to the provided input"

@codecov-commenter
Copy link

codecov-commenter commented Dec 23, 2025

Codecov Report

❌ Patch coverage is 27.27273% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 40.77%. Comparing base (7ed5ab0) to head (2c054a2).
⚠️ Report is 27 commits behind head on main.

Files with missing lines Patch % Lines
internal/cmd/import.go 27.27% 13 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #607      +/-   ##
==========================================
+ Coverage   39.28%   40.77%   +1.49%     
==========================================
  Files          37       38       +1     
  Lines        5448     4964     -484     
==========================================
- Hits         2140     2024     -116     
+ Misses       3063     2693     -370     
- Partials      245      247       +2     

☔ 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.

@miparnisari miparnisari changed the title fix: import relationships with caveats fix: import relationships with caveats and prefix Dec 23, 2025
@miparnisari miparnisari force-pushed the fix-import-with-prefix branch from 4b7ac21 to 0303fd3 Compare December 23, 2025 03:50
@miparnisari miparnisari force-pushed the fix-import-with-prefix branch from 0303fd3 to 2c054a2 Compare December 23, 2025 03:54
Copy link
Member

@josephschorr josephschorr left a comment

Choose a reason for hiding this comment

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

LGTM

@miparnisari miparnisari merged commit d0c259e into main Dec 23, 2025
12 checks passed
@miparnisari miparnisari deleted the fix-import-with-prefix branch December 23, 2025 18:16
@github-actions github-actions bot locked and limited conversation to collaborators Dec 23, 2025
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.

4 participants