Skip to content

Add SpiceDB Schema language support#7936

Merged
lildude merged 2 commits intogithub-linguist:mainfrom
ivanauth:add-spicedb-schema
May 1, 2026
Merged

Add SpiceDB Schema language support#7936
lildude merged 2 commits intogithub-linguist:mainfrom
ivanauth:add-spicedb-schema

Conversation

@ivanauth
Copy link
Copy Markdown
Contributor

@ivanauth ivanauth commented Apr 30, 2026

Description

Add SpiceDB Schema (.zed) as a new data language.

SpiceDB is an open-source permissions database. The schema describes object types, the relations between them, and the permissions derived from those relations, plus CEL-based caveats for contextual constraints. Used by teams at Red Hat, Oviva, Raystack, and others (see the repo list below for specifics).

Two things worth flagging up front:

  1. The submodule is pinned to 1b3f6db instead of the v1.1.1 tag because that commit (authzed/spicedb-vscode#65) fixes a regex that wasn't valid PCRE, which linguist's grammar-compiler needs. Will be in a future upstream release.
  2. grammars.yml lists two scopes (source.cel and source.spicedb) for one new language. CEL is embedded inside SpiceDB caveats, so the upstream grammar ships both cel.tmGrammar.json and spicedb.tmGrammar.json. CEL isn't added to languages.yml; the second scope just registers the bundled grammar file. Nothing else in grammars.yml claims either scope.

.zed is also used by Brim Data's Zed shape language, which isn't currently in linguist. If it's added later, the definition/permission/relation/caveat keywords should be enough to disambiguate.

Checklist:

  • I am adding a new language.
    • The extension of the new language is used in hundreds of repositories on GitHub.com.
      • Search results for each extension:
        • REST API cross-check (gh api /search/code?q=extension:zed+definition): 307 SpiceDB-flavored files (one .zed schema per repo is the norm, so this also approximates the unique-repo count).
        • Example users: Red Hat (Project Kessel and the Insights RBAC config), Oviva, Raystack Frontier, Magistrala, Inkeep, SchoolAI, France-Nuage.
    • I have included a real-world usage sample for all extensions added in this PR:
    • I have included a syntax highlighting grammar: https://github.com/authzed/spicedb-vscode (Apache-2.0)
    • I have added a color
      • Hex value: #a5318a
      • Rationale: Magenta 600 from the official AuthZed brand palette at https://authzed.com/brand (alongside Red 500 #f0566d and Sand 300 #ffb370). The 600 step is designed to clear contrast checks on light backgrounds, which matches how GitHub renders language-color dots. Visually distinct from existing linguist entries.
    • .zed isn't currently mapped to any language in linguist, so no heuristic is needed (see the Brim Zed note above for what to do if that changes).

Some .zed repos for context

Repository Stars Description
absmach/magistrala 2,584 ⭐ IoT platform
inkeep/agents 1,116 ⭐ Inkeep agent platform
raystack/frontier 331 ⭐ Identity & access platform built on SpiceDB
France-Nuage/plateforme 54 ⭐ France-Nuage cloud platform
oviva-ag/spicegen 11 ⭐ Oviva (digital health), SpiceDB Java client generator. Source of samples/SpiceDB Schema/oviva.zed.
project-kessel/relations-api 10 ⭐ Red Hat Project Kessel relations API. Source of samples/SpiceDB Schema/schema.zed.
RedHatInsights/rbac-config 5 ⭐ Red Hat Hybrid Cloud Console RBAC config
SchoolAI/spicedb-zed-schema-parser 3 ⭐ Open-source .zed schema parser
project-kessel/inventory-api 2 ⭐ Red Hat Project Kessel inventory API

@ivanauth ivanauth requested a review from a team as a code owner April 30, 2026 20:12
@ivanauth ivanauth force-pushed the add-spicedb-schema branch from 338d307 to c21d498 Compare April 30, 2026 20:48
Comment thread lib/linguist/languages.yml Outdated
ace_mode: text
language_id: 354
SpiceDB Schema:
type: programming
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Schema is generally considered data and not a programming language.

Suggested change
type: programming
type: data

Copy link
Copy Markdown
Contributor Author

@ivanauth ivanauth May 1, 2026

Choose a reason for hiding this comment

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

Good call. Applied in the latest force-push (b337609).

@lildude
Copy link
Copy Markdown
Member

lildude commented May 1, 2026

Nope. That's showing repos with zed in their name or description 😁

Usage looks good as it appears there is only ever one of these files per repo, so it's just the type that needs changing.

@ivanauth ivanauth force-pushed the add-spicedb-schema branch from c21d498 to b337609 Compare May 1, 2026 13:22
@ivanauth
Copy link
Copy Markdown
Contributor Author

ivanauth commented May 1, 2026

Good catch on the search URL - you're right. I fixed the PR description. Thanks for the quick review.

Copy link
Copy Markdown
Member

@lildude lildude left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks.

Important

The changes in this PR will not appear on GitHub until the next release has been made and deployed. See here for more details.

@lildude lildude enabled auto-merge May 1, 2026 14:08
@lildude lildude added this pull request to the merge queue May 1, 2026
Merged via the queue into github-linguist:main with commit e535c9a May 1, 2026
5 checks passed
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