Skip to content

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

@tstirrat15

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.

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