ci: require Gemara CUE schema validation for touched catalog YAMLs#1069
Open
eddie-knight wants to merge 3 commits into
Open
ci: require Gemara CUE schema validation for touched catalog YAMLs#1069eddie-knight wants to merge 3 commits into
eddie-knight wants to merge 3 commits into
Conversation
|
|
c96b8d3 to
385c89a
Compare
❌ Deploy Preview for common-cloud-controls failed. Why did it fail? →
|
👷 Deploy request for common-cloud-controls pending review.Visit the deploys page to approve it
|
Collaborator
Author
|
CI Checks are failing because every PR currently attempts to build the website, and the site is currently under construction. |
2 tasks
jpower432
requested changes
Jun 11, 2026
jpower432
left a comment
Contributor
There was a problem hiding this comment.
Mostly nits, but requesting changes on the third party actions references.
| ref: ${{ env.GEMARA_SPEC_REF }} | ||
| path: gemara-spec | ||
|
|
||
| - name: Install cue |
Contributor
There was a problem hiding this comment.
CUE has a setup-cue third party action you could use - https://github.com/cue-lang/setup-cue
| go-version-file: delivery-toolkit/go.mod | ||
| cache-dependency-path: delivery-toolkit/go.sum | ||
|
|
||
| - name: Checkout Gemara CUE spec |
Contributor
There was a problem hiding this comment.
Nit: why not just point directly to the module in the CUE registry when running cue vet?
Collaborator
Author
There was a problem hiding this comment.
because claude and I didn't know how to do that at the time we were working on this :D
Co-authored-by: Jennifer Power <jpower@redhat.com>
Co-authored-by: Jennifer Power <jpower@redhat.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new CI job —
Gemara Schema Check— that compiles and validates every catalog YAML touched in a PR against the Gemara CUE schema (gemaraproj/gemara@v1.2.0). Fails the PR on any compile error or schema violation.Per-file scope: only the build targets whose YAMLs were touched get re-validated, not the whole repo. Changes to shared/core files (
catalogs/categories.yaml,catalogs/core/ccc/**) cascade to every build target because every catalog depends on them.How it works
git diff base...headfinds catalog YAMLs touched in the PR.catalogs/<category>/<service>/...).(target, asset):delivery-toolkit compileto produce a self-describing Gemara artifact.cue vet -d "#<ArtifactType>" gemara-spec <compiled>against the CUE schema.CUE is the validator because:
grcliships from a private repo and can't be used from public CI.cuelang.org/go/cmd/cueis the upstream tool the Gemara CUE module was authored for.grcli validatedoes internally —cue vetagainst#<Type>.Pinned versions:
v1.2.0(matchesgemaraSpecVersionindelivery-toolkit/cmd/compile.go:51).v0.16.0.Why per-file, not full-repo
A full-repo run on every PR would be wasteful (~25 targets × 3 assets × seconds each). Per-file scoping makes the check fast and incentivises the team to fix what they touch without forcing a global fix-up to merge unrelated PRs.
Verification
Locally dry-ran the workflow's shell logic against:
catalogs/storage/object/*— compile +cue vetclean ✅catalogs/ai-ml/multi-agent-refarch/*— fails compile (missingmetadata.yaml+ undefined groups) ❌ (correctly surfaces as a CI failure)Confirmed
cue vetcatches real schema breaks: wrongmetadata.typevalue, duplicate control ids, missinggemara-version.Known surfaces this will now block
PRs that touch any of the 13 imports-only or otherwise broken catalog YAMLs will fail this check until the underlying tech debt is addressed:
catalogs/compute/virtual-machines/controls.yaml,catalogs/crypto/secrets/threats.yaml)catalogs/compute/batchproc/controls.yamlusing the wrongimports:keycatalogs/ai-ml/multi-agent-refarch/(missing metadata, undefined groups)controls.yaml/threats.yaml(management/tracing,orchestration/etl,orchestration/k8s) — touching theirmetadata.yamlorcapabilities.yamlwould now flag any other touched compile failure as well.That's the intended behaviour: this check is what was missing when those got merged.
Test plan
gemara-schema-checkerjob appears and passes (this PR touches no catalog YAMLs, so it should no-op).catalogs/categories.yamlshould trigger the broad-cascade path and validate all 24 catalogs.🤖 Generated with Claude Code