镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Writing schema with prefixes and then writing same schema without prefixes results in no-op #603

Open

Description

@tstirrat15

Let's call this the "old" schema:

definition namespace/subscription {
    relation subscriber: namespace/user

    permission is_subscribed = subscriber 
}

definition namespace/user {
}

And this the "new" schema:

definition subscription {
    relation subscriber: user

    permission is_subscribed = subscriber 
}

definition user {
}

Start SpiceDB:

spicedb serve-testing

Write the old schema:

zed schema write old.zed

Write the new schema with tracing enabled:

zed schema write new.zed --log-level=trace

See that the written schema still has the prefixes:

10:50AM TRC writing schema request={"schema":"definition namespace/subscription {\n\trelation subscriber: namespace/user\n\tpermission is_subscribed = subscriber\n}\n\ndefinition namespace/user {}"}

This is due to our rewriting logic, and was part of serverless support. This may be fixed by the refactors in #597, but if it's not we should fix it.

It's an edge case but it's a sharp edge.

Activity

  1. miparnisari commented on Feb 13, 2026

    @miparnisari
    Contributor

    The current behavior is correct, right now. It will be incorrect starting in April. Leaving open so that we can fix it then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions