Skip to content

chore: remove Gemara display content from mock OCI registry#529

Open
sonupreetam wants to merge 2 commits into
mainfrom
cleanup/remove-mock-gemara-content
Open

chore: remove Gemara display content from mock OCI registry#529
sonupreetam wants to merge 2 commits into
mainfrom
cleanup/remove-mock-gemara-content

Conversation

@sonupreetam
Copy link
Copy Markdown
Contributor

@sonupreetam sonupreetam commented May 27, 2026

Summary

Closes #477

  • Removes all Gemara content from cmd/mock-oci-registry/ except the minimal test-branch-protection-catalog.yaml and test-branch-protection-policy.yaml used by integration tests
  • Removes the enrichment endpoint (/v1/enrich) and all enrichment types/mappings from main.go
  • Removes all inline YAML seeds (nist-800-53-r5, cis-benchmark, osps-b, guidance/nist) and file-based seeds (ampel-branch-protection, cis-fedora-l1-workstation)
  • Updates integration_test.sh to use policies/test-branch-protection instead of the removed nist-800-53-r5, installing the test provider as complyctl-provider-ampel to match the policy's executor ID
  • Updates root complytime.yaml to reference the retained test-branch-protection policy

Result: main.go shrinks from ~670 to ~255 lines. Total -4,750 lines removed.

Files deleted (5)

File Size Content
ampel-branch-protection-catalog.yaml 2.6 KB Ampel branch protection catalog
ampel-branch-protection-policy.yaml 2.0 KB Ampel branch protection policy
cis-fedora-l1-workstation-catalog.yaml 68.8 KB CIS Fedora workstation catalog
cis-fedora-l1-workstation-policy.yaml 68.0 KB CIS Fedora workstation policy
sample-complytime.yaml 199 B Unused example workspace config

Files retained (2)

File Purpose
test-branch-protection-catalog.yaml Minimal catalog for integration tests
test-branch-protection-policy.yaml Minimal policy for integration tests (Ampel provider)

Impact

  • make test-integration: Updated — now uses policies/test-branch-protection with the test provider installed as complyctl-provider-ampel to match the policy executor
  • make test-cross-repo: Unaffected — already uses policies/test-branch-protection
  • make test-e2e / make test-behavioral: Unaffected — use separate in-process mocks
  • org-infra reusable_compliance.yml: References policies/ampel-branch-protection — needs updating separately to use Quay.io release or test-branch-protection

Spec workflow exemption

This change was not preceded by an OpenSpec or Speckit spec workflow. Rationale:

  • Purely subtractive: removes dead code and unused test data; no new features, APIs, or behavior introduced
  • Well-defined scope: driven by issue Remove Complyctl mock used to display Gemara content #477, which fully describes the intent ("Remove Complyctl mock used to display Gemara content")
  • No design decisions: the "what to keep" (test-branch-protection fixtures) was already established by existing cross-repo integration tests

Per AGENTS.md, spec workflows are required for non-trivial changes. While the line count is large, the change is mechanical deletion with minimal logic changes. Future cleanups of comparable scope should consider a lightweight OpenSpec proposal to formalize the rationale upfront.

Test plan

  • go build ./cmd/mock-oci-registry/ compiles clean
  • go vet ./cmd/mock-oci-registry/ passes
  • make test-integration passes with updated policy and provider name
  • make test-cross-repo passes (retained content, no changes)

@sonupreetam sonupreetam requested a review from a team as a code owner May 27, 2026 09:11
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 27, 2026

✅ CRAP Load Analysis: PASS

Summary

Metric Value
Functions analysed 14
Avg complexity 2.7
Avg line coverage 0%
Avg CRAP score 12.9
CRAPload (>= 15) 3
Avg contract coverage 0%
Avg GazeCRAP score 0
GazeCRAPload (>= 15) 0
Regressions 0
Improvements 0
New functions 0

View full analysis logs

@sonupreetam sonupreetam marked this pull request as draft May 27, 2026 09:20
@sonupreetam sonupreetam force-pushed the cleanup/remove-mock-gemara-content branch 2 times, most recently from 1aa8362 to f3dafcb Compare May 27, 2026 09:34
@sonupreetam sonupreetam marked this pull request as ready for review May 27, 2026 09:35
@sonupreetam sonupreetam changed the title cleanup: remove Gemara display content from mock OCI registry chore: remove Gemara display content from mock OCI registry May 27, 2026
Remove all Gemara content from mock-oci-registry except the minimal
test-branch-protection catalog and policy used by cross-repo
integration tests. This includes:

- 5 testdata files (ampel-branch-protection-*, cis-fedora-l1-*, sample-complytime)
- All inline YAML seeds (nist-800-53-r5, cis-benchmark, osps-b, guidance/nist)
- Enrichment endpoint (/v1/enrich) and all enrichment types/mappings

The mock registry now serves only policies/test-branch-protection,
shrinking main.go from ~670 to ~255 lines (-4750 lines total).

The root complytime.yaml is updated to reference the retained policy.

Closes #477

Assisted-by: Cursor (claude-opus-4-6)
Signed-off-by: sonupreetam <spreetam@redhat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@sonupreetam sonupreetam force-pushed the cleanup/remove-mock-gemara-content branch from f3dafcb to 5febdb3 Compare May 27, 2026 09:45
Copy link
Copy Markdown
Member

@marcusburghardt marcusburghardt left a comment

Choose a reason for hiding this comment

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

Review Summary

Solid cleanup PR — removes ~4,750 lines of mock Gemara content as intended by #477. Two actionable findings:

  1. CI linter failure (gosec G706): The //nolint:gosec directive was dropped when the log message was renamed. Trivial fix.
  2. complytime.yaml still points at localhost mock: Should reference quay.io/complytime/policies-ampel-branch-protection now that the mock content is being removed in favor of quay.io releases.

This review was generated by /review-pr (AI-assisted).

Comment thread cmd/mock-oci-registry/main.go Outdated
Comment thread complytime.yaml Outdated
Comment thread cmd/mock-oci-registry/main.go
sonupreetam added a commit that referenced this pull request May 28, 2026
- Restore //nolint:gosec directive on renamed log line (gosec G706)
- Revert inlined variables in OCI route handlers for readability
- Update complytime.yaml to reference quay.io production registry
  instead of localhost mock

Signed-off-by: sonupreetam <spreetam@redhat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
sonupreetam added a commit that referenced this pull request May 28, 2026
- Restore //nolint:gosec directive on renamed log line (gosec G706)
- Revert inlined variables in OCI route handlers for readability
- Update complytime.yaml to reference quay.io production registry
  instead of localhost mock

Signed-off-by: sonupreetam <spreetam@redhat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: sonupreetam <spreetam@redhat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@sonupreetam sonupreetam force-pushed the cleanup/remove-mock-gemara-content branch from 4c64b73 to 27e35c0 Compare May 28, 2026 08:21
@sonupreetam
Copy link
Copy Markdown
Contributor Author

@marcusburghardt Thank you I have taken care of the feedbacks.

- Restore //nolint:gosec directive on renamed log line (gosec G706)
- Revert inlined variables in OCI route handlers for readability
- Update complytime.yaml to reference quay.io production registry
  instead of localhost mock

Signed-off-by: sonupreetam <spreetam@redhat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: sonupreetam <spreetam@redhat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: sonupreetam <spreetam@redhat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@sonupreetam sonupreetam force-pushed the cleanup/remove-mock-gemara-content branch from 27e35c0 to dca9529 Compare May 28, 2026 08:56
@marcusburghardt
Copy link
Copy Markdown
Member

@sonupreetam , there is a conflict. We need to rebase in order to solve it.

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.

Remove Complyctl mock used to display Gemara content

2 participants