feat: add ReleaseSet, Fingerprint, ConfigSource, TokenDoor, GitRefBuild schemas#73
feat: add ReleaseSet, Fingerprint, ConfigSource, TokenDoor, GitRefBuild schemas#73
Conversation
…ld schemas and examples Agent-Logs-Url: https://github.com/SourceOS-Linux/sourceos-spec/sessions/d3049a4c-d0a8-45a9-ac88-d65006ae8627 Co-authored-by: mdheller <21163552+mdheller@users.noreply.github.com>
Scope is bounded to schemas, examples, validation tooling, and catalog updates only — no runtime code touched.
All 9 schema/example pairs pass. The agent environment doesn't have permission to call Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
Pull request overview
Adds canonical v2 JSON Schemas and conforming examples for five release/build lifecycle contract types, and wires them into the repository’s schema/example validation and catalog docs.
Changes:
- Introduce new v2 schemas + examples:
ReleaseSet,Fingerprint,ConfigSource,TokenDoor,GitRefBuild. - Extend
tools/validate_nlboot_examples.pyto validate the new schema/example pairs; adjust the control-plane validator to resolve./$refs and drop legacy pairs now owned by the canonical validator. - Update schema and example catalogs (
schemas/README.md,examples/README.md) with a “Recent additions” section and quick-reference rows.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/validate_nlboot_examples.py | Adds the 5 new schema/example pairs to the canonical validator set. |
| tools/validate_control_plane_examples.py | Fixes legacy $ref resolution for wrapper schemas; removes ReleaseSet/Fingerprint legacy validation pairs. |
| schemas/ReleaseSet.json | New v2 schema defining assigned release sets and artifact references. |
| schemas/Fingerprint.json | New v2 schema defining point-in-time device observations and compliance verdicts. |
| schemas/ConfigSource.json | New v2 schema defining typed config source references (git/http/oci/inline/bundle). |
| schemas/TokenDoor.json | New v2 schema defining token-gated access boundaries with quota/expiry fields. |
| schemas/GitRefBuild.json | New v2 schema defining build provenance from git ref/commit to produced artifacts. |
| schemas/README.md | Documents the new lifecycle schemas and adds them to the quick reference table. |
| examples/release_set.json | Migrates legacy snake_case example to v2 camelCase and new fields. |
| examples/fingerprint.json | Migrates legacy snake_case example to v2 camelCase and new structure. |
| examples/config_source.json | Adds v2 example for ConfigSource. |
| examples/token_door.json | Adds v2 example for TokenDoor. |
| examples/git_ref_build.json | Adds v2 example for GitRefBuild. |
| examples/README.md | Documents the new lifecycle examples and updates “Recent additions” sections. |
| "uri": { | ||
| "type": ["string", "null"], | ||
| "description": "URI of the configuration source. Required for git, http, and oci kinds." | ||
| }, |
There was a problem hiding this comment.
The uri field description says it's required for git, http, and oci sourceKind, but the schema does not enforce that (it allows uri: null and does not conditionally require it). Either enforce this with if/then (or oneOf) keyed on sourceKind, or update the description to avoid stating a requirement the schema doesn't validate.
| legacy_ref = schema.get("allOf", [{}])[0].get("$ref") | ||
| validation_schema_path = schema_path.with_name(legacy_ref) if legacy_ref else schema_path | ||
| validation_schema_path = (schema_path.parent / legacy_ref).resolve() if legacy_ref else schema_path | ||
| validation_schema = json.loads(validation_schema_path.read_text(encoding="utf-8")) |
There was a problem hiding this comment.
legacy_ref is read from schema content and is now joined/resolved into a filesystem path. This allows absolute paths or ../ traversal to escape schemas/control-plane/ and make the validator read arbitrary files when run in CI. Consider restricting legacy_ref to a relative path under schema_path.parent (e.g., reject absolute paths, reject .., and after resolve() assert it is_relative_to(schema_path.parent.resolve())).
mdheller
left a comment
There was a problem hiding this comment.
Approved. Scope matches issue #72: ReleaseSet, Fingerprint, ConfigSource, TokenDoor, and GitRefBuild schemas/examples/validation/catalog updates. This remains schema/spec-only and does not introduce runtime behavior. No workflow run is visible, but the PR body reports make validate coverage and the changes are bounded to normative contracts and validators.
Adds canonical v2 JSON Schema definitions and conforming examples for five SourceOS lifecycle types adjacent to NLBoot, consumed by sourceos-boot, release tooling, Homebrew taps, and the control plane.
New schemas
ReleaseSeturn:srcos:release-set:Fingerprinturn:srcos:fingerprint:ConfigSourceurn:srcos:config-source:TokenDoorurn:srcos:token-door:GitRefBuildurn:srcos:git-ref-build:All schemas follow existing v2 conventions:
$schema,$id,title,additionalProperties: false,id/type/specVersionrequired fields, URN-patternid, camelCase properties.Validation
tools/validate_nlboot_examples.pyextended with all 5 new pairs; now covers 9 schema/example pairs total.ValueErrorcrash intools/validate_control_plane_examples.pywherePath.with_name()rejected./-prefixed$refvalues (./release-set.schema.json). Fix: use(schema_path.parent / legacy_ref).resolve().ReleaseSetandFingerprintfrom the control-plane validator's legacy-schema pairs — the canonical validator now owns those.examples/release_set.jsonandexamples/fingerprint.jsonmigrated from snake_case legacy format to v2 camelCase to conform to the new canonical schemas.Catalog updates
schemas/README.mdandexamples/README.mdupdated with new "Recent additions" sections and quick-reference table rows.