fix: add missing required Gemara schema fields to policy fixtures#707
Merged
sonupreetam merged 1 commit intoJul 9, 2026
Merged
Conversation
Add required fields per the upstream Gemara CUE schema to mock-oci-registry policy YAML fixtures and inline test YAML in resolver_test.go. Metadata blocks gain: - type: Policy - gemara-version: 1.0.0 Evaluation-methods entries gain: - id: <evaluator>-eval - mode: Automated These fields are required by the Gemara CUE schema (#Metadata.type, #Metadata."gemara-version", #AcceptedMethod.id, #AcceptedMethod.mode) but were silently zero-valued by Go's YAML unmarshaller at runtime. The reference fixture rh-workstation-audit-policy.yaml was already compliant and served as the target state model. Closes complytime#696 Assisted-by: OpenCode (claude-opus-4-6) Signed-off-by: Yvonne Devlin <ydevlin@redhat.com>
gxmiranda
approved these changes
Jul 9, 2026
gxmiranda
left a comment
There was a problem hiding this comment.
Clean, well-scoped fixture fix that aligns test data with the upstream Gemara CUE schema. All 4 required fields (type, gemara-version, id, mode) added consistently across 3 YAML fixtures and 6 inline test YAML blocks. Scope matches issue #696 exactly. All CI checks pass.
This review was generated by /review-pr (AI-assisted).
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
Add required fields per the upstream Gemara CUE schema to mock-oci-registry policy YAML fixtures and inline test YAML in
resolver_test.go. These files would failcue vet -c -d '#Policy'validation. They work at runtime because Go's YAML unmarshalling silently uses zero values for missing fields.This is the same class of fix applied in PR #695 for acceptance test data.
Changes
Policy YAML fixtures (
cmd/mock-oci-registry/testdata/)Three files updated:
test-branch-protection-policy.yamlampel-branch-protection-policy.yamltest-opa-policy.yamlMetadata blocks gained:
type: Policy— required by#Metadata.typegemara-version: 1.0.0— required by#Metadata."gemara-version"(consistent with sibling catalogs and governance artifacts)Evaluation-methods entries (both top-level and within
assessment-plans) gained:id: <evaluator>-eval— required by#AcceptedMethod.idmode: Automated— required by#AcceptedMethod.modeInline test YAML (
internal/policy/resolver_test.go)Six inline YAML policy fixtures updated with the same fields:
TestResolvePolicyGraph_AllThreeLayers(line 114)TestResolvePolicyGraph_MissingOptionalLayers(line 163)TestParsePolicyLayer_MissingAssessmentPlans(line 209, metadata only)TestParsePolicyLayer_SingleAssessmentPlan(line 234)TestParsePolicyLayer_MultiEvaluator(line 271)validPolicyYAML()shared helper (line 698, used by 7+ tests)Reference
rh-workstation-audit-policy.yamlis already fully compliant and served as the target state model.Verification
Related Issues
Closes #696