Skip to content

ROX-36856: retire Compliance 1.0 REST and gRPC endpoints - #23399

Open
taimurhafeez wants to merge 5 commits into
masterfrom
th/ROX-36856-retire-compliance-v1-apis
Open

taimurhafeez wants to merge 5 commits into
masterfrom
th/ROX-36856-retire-compliance-v1-apis

Conversation

@taimurhafeez

@taimurhafeez taimurhafeez commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Description

First backend cut of Compliance 1.0 removal (ROX-36856). This PR removes the externally reachable Compliance 1.0 API surface; the ~271 files under central/compliance/ are left in place, now unreachable, and are deleted in follow-ups once the compiler can prove it is safe.

Removed

  • ComplianceService and ComplianceManagementService are no longer registered in servicesToRegister(). Because pkg/grpc.APIService carries both RegisterServiceServer and RegisterServiceHandler, this removes the gRPC services and their grpc-gateway REST equivalents under /v1/compliance/* in one step. Callers now get Unimplemented / HTTP 501.
  • The /api/compliance/export/csv custom route.
  • qa-tests-backend's ComplianceTest (@Tag("BAT")), which exercises only the removed v1 API and would otherwise fail against this change, plus the service/object classes that became orphaned with it.

Kept, deliberately: /api/splunk/ta/compliance now returns 410 Gone

The acceptance criteria require existing Splunk TA Compliance feed configurations to fail closed. Alternatives considered:

Option Result Why rejected
Delete the route 404 A modular input is liable to treat 404 as transient and retry; the removal gets buried in retry noise.
Return an empty payload 200 [] Splunk indexes "no compliance findings" as fact. Dashboards stay green. This is failing open.
Explicit error 410 Gone Chosen. Unambiguously permanent, carries an actionable message.

🔔 This 410 is a contract with external TA users and is the one decision in this PR that wants explicit sign-off. Happy to change the status code or wording if the Splunk TA owner prefers something else.

The handler also drops its datastore.DataStore parameter. That is load-bearing beyond the 410: it severs central/splunk's compile-time import of central/compliance, which is what allows that tree to be deleted independently in a later PR.

Not in this PR: GraphQL resolvers (~1,177 lines + 449 refs in generated code, coupled to proto removal), the .proto definitions, the central/compliance/ tree itself, and the five Compliance 1.0 Postgres tables (GORM AutoMigrate never drops, so those need an explicit migration). resources.Compliance is intentionally untouched — it is shared with Compliance v2 and is a customer-visible permission name.

This PR has no file overlap with #23360 and can merge in either order.

Customer impact worth explicit review: Compliance Operator results stop reaching Splunk

This surfaced from a review question about the ocp4-cis-node-master / MachineConfigResults fixtures in the deleted test. They are not Compliance v2 data, but tracing them found a real consequence.

Compliance Operator results reach this feed through the pre-v2 bridge:

central/complianceoperator/manager          (NOT .../v2/ -- manager_impl.go:16)
  -> GetMachineConfigs(clusterID)            (manager_impl.go:123)
  -> framework.NewComplianceDomain
  -> collect_results.go:234 -> MachineConfigResults
  -> storage.ComplianceRunResults (v1 tables)
  -> /api/splunk/ta/compliance

So a customer running the Compliance Operator today, with the TA Compliance modular input enabled, loses that data in Splunk when this merges. They cannot migrate, because there is no v2 Splunk feed (RFE-9120 / RFE-6372, out of scope here). The Compliance Operator itself and Compliance v2 in-product are unaffected; only the Splunk delivery path goes away.

The CHANGELOG now splits the API removal from the feed retirement and states plainly that no Splunk replacement exists, rather than implying v2 covers it. Flagging here so this is a conscious call by the Splunk TA owner and release-notes reviewer, not a surprise.

For the record on the original question: Compliance v2 is fully independent — grepping central/complianceoperator/v2/ for imports of central/compliance/ returns zero hits, and v2 has its own storage (checkresults, scans, profiles, ...). Separately, a _test.go file is only ever compiled into its own package's test binary, so no other package could have depended on the deleted test regardless.

User-facing documentation

Downstream docs are tracked by ROX-36856's own Documentation & Release Notes acceptance criterion and will follow separately. CHANGELOG entries are included here under "Removed Features" — one for the API removal, one for the Splunk feed retirement and its Compliance Operator consequence.

Testing and quality

  • the change is production ready: the change is GA, or otherwise the functionality is gated by a feature flag
  • CI results are inspected

Automated testing

  • added unit tests
  • added e2e tests
  • added regression tests
  • added compatibility tests
  • modified existing tests

Added a unit test asserting the Splunk endpoint returns 410 with the removal message. This is deliberately a test rather than a bare stub: the fail-closed behavior is an external contract, so a later "tidy-up" to 404 should break the build.

How I validated my change

  • go build ./... — pass
  • go vet ./... — pass (type-checks _test.go files, so the new test compiles)
  • go test -tags test ./central/... — 296 packages pass, 1 fails. The failure is central/clusters/zip panicking in init() via testutils.MustBeInTest; it reproduces identically on clean master at c4b073da25, so it is pre-existing and unrelated.
  • gofmt — clean
  • Grepped for dangling references to everything removed: no remaining hits for /api/compliance/export/csv, complianceHandlers, complianceManagerService, CSV_COLUMN_MAPPING, objects.Control, CsvRow, or ComplianceServiceGrpc outside the tree scheduled for later deletion.

Gap I want to be explicit about: I could not compile the Groovy locally — generateProto fails because scanner/api/v1/{component,note}.proto are absent from qa-tests-backend/src/main/proto, so no Java proto classes are generated and every io.stackrox.proto.* import fails. This reproduces on clean master (199 unresolved-proto errors before my change, 181 after; the delta is exactly the imports in the files I deleted, and zero errors name any file I touched). Confidence in the Groovy deletions therefore rests on grep rather than a compiler. CI is the real check here.

🤖 Co-Generated with [Claude Code]

Unregister the v1 ComplianceService and ComplianceManagementService and drop the
/api/compliance/export/csv route, making the Compliance 1.0 API surface
unreachable. This is the first backend cut; the now-orphaned central/compliance
tree is deleted in follow-ups.

/api/splunk/ta/compliance is kept as a stub returning 410 Gone rather than being
deleted outright. The acceptance criteria require existing Splunk TA Compliance
feed configurations to fail closed: a 404 is liable to be retried as transient by
a modular input, and an empty 200 would be indexed as "no compliance findings" --
both hide the removal. The stub no longer takes a datastore, which decouples
central/splunk from central/compliance so that tree can be removed independently.

qa-tests-backend's ComplianceTest exercises only the removed v1 API, so it is
deleted along with the service and object classes that became orphaned with it.

This change was partially generated with the help of an AI agent.

Co-Authored-By: Claude Opus 5
@openshift-ci

openshift-ci Bot commented Oct 14, 2026

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Central YAML (base), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: 5c8f16ac-ed93-48f7-be87-77121800e52e
📥 Commits

Reviewing files that changed from the base of the PR and between 7973df6 and 942469f.

📒 Files selected for processing: 1
  • CHANGELOG.md
🚧 Files skipped from review as they are similar to previous changes: 1
  • CHANGELOG.md

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 10 remain after this review.

📝 Summary

Summary by CodeRabbit

  • Breaking Changes
    • Legacy Compliance 1.0 gRPC services and REST endpoints, including CSV export, are no longer available.
    • The Splunk TA Compliance feed returns HTTP 410 Gone instead of compliance data. Remove the Compliance modular input from your Splunk TA configuration; there is no Splunk replacement.
    • Compliance Operator results remain available in the product through Compliance (v2).

The change removes Compliance 1.0 gRPC services and REST endpoints, including CSV export. The Splunk compliance feed now returns HTTP 410 with a message directing users to remove the modular input. Related QA backend services, data classes, mappings, and tests are deleted.

Changes: Compliance 1.0 retirement

Layer / File(s) Summary
Remove Compliance 1.0 interfaces
central/main.go, central/splunk/compliance.go, central/splunk/compliance_test.go, CHANGELOG.md
The central service no longer registers the legacy compliance services or CSV route. The Splunk feed returns HTTP 410, and its test checks the response and removal message. The changelog records the retirement and stated replacement.
Remove QA backend compliance support
qa-tests-backend/src/main/groovy/services/ComplianceService.groovy, qa-tests-backend/src/main/groovy/services/ComplianceManagementService.groovy, qa-tests-backend/src/main/groovy/objects/*, qa-tests-backend/src/main/groovy/common/Constants.groovy, qa-tests-backend/src/test/groovy/ComplianceTest.groovy
The QA backend removes its compliance services, data classes, CSV column mapping, and ComplianceTest specification.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Other

Suggested reviewers: janisz

Merge Risk: ⚪ Minimal · up to 94246

The release notes describe the Compliance 1.0 retirement and Splunk feed removal. No supported issue in the selected change prevents merging after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 3 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description is complete and directly covers the endpoint removals, retained 410 behavior, customer impact, testing, validation results, documentation status, and known limitations.
Title check Passed The title clearly and concisely identifies the primary change: retirement of the Compliance 1.0 REST and gRPC endpoints.
Full details: Docstring Coverage

Explanation

Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 3 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

🚀 Build Images Ready

Images are ready for commit 1c186dd. To use with deploy scripts:

export MAIN_IMAGE_TAG=5.1.x-281-g1c186dd341

@taimurhafeez

Copy link
Copy Markdown
Contributor Author

/test all

The previous CHANGELOG entry pointed Splunk TA users at Compliance v2 as the
replacement. That is accurate for the gRPC/REST APIs but misleading for the feed:
there is no v2 Splunk feed (RFE-9120 / RFE-6372, out of scope here), so a reader
would expect to reconfigure the TA and keep receiving data.

This also matters more than it first appears for Compliance Operator users. CO
results reach the retired feed through the pre-v2 bridge
(central/complianceoperator/manager -> GetMachineConfigs -> compliance domain ->
MachineConfigResults in v1 storage), so retiring it stops CO results reaching
Splunk even though the Compliance Operator itself is unaffected. Split the entry
in two and say outright that no Splunk replacement exists.

This change was partially generated with the help of an AI agent.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 51.96%. Comparing base (f462ad4) to head (1c186dd).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #23399      +/-   ##
==========================================
- Coverage   52.00%   51.96%   -0.05%     
==========================================
  Files        2912     2912              
  Lines      183385   183273     -112     
==========================================
- Hits        95372    95232     -140     
- Misses      79684    79705      +21     
- Partials     8329     8336       +7     
Flag Coverage Δ
go-unit-tests 51.96% <100.00%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@taimurhafeez
taimurhafeez marked this pull request as ready for review October 14, 2026 13:26
@taimurhafeez
taimurhafeez requested a review from janisz as a code owner October 14, 2026 13:26
@taimurhafeez
taimurhafeez requested review from dashrews78 and pedrottimark and removed request for janisz October 14, 2026 13:27
Comment thread CHANGELOG.md
Comment on lines +20 to +21
- ROX-36856: The Compliance 1.0 API has been removed. The `ComplianceService` and `ComplianceManagementService` gRPC services, their `/v1/compliance/*` REST equivalents, and the `/api/compliance/export/csv` export endpoint are no longer served. Use Compliance (v2), backed by the Compliance Operator, instead.
- ROX-36856: The Splunk TA Compliance feed at `/api/splunk/ta/compliance` has been retired and now responds with HTTP 410 Gone rather than returning data, so that stale feed configurations fail loudly instead of silently reporting zero compliance findings. Remove the Compliance modular input from your Splunk TA configuration. **There is no Splunk replacement for this feed.** Note that this also affects Compliance Operator results: those were previously routed into Compliance 1.0 storage and surfaced through this feed, and they are no longer delivered to Splunk. Compliance Operator results remain available in the product through Compliance (v2).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

That's a lot of words. Perhaps we should be more succinct in the CHANGELOG and more wordy in the release notes shipped by the docs team.

@taimurhafeez

Copy link
Copy Markdown
Contributor Author

/test all

@taimurhafeez

Copy link
Copy Markdown
Contributor Author

/test gke-qa-e2e-tests

@pedrottimark

Copy link
Copy Markdown
Contributor

/retest

@red-hat-konflux

Copy link
Copy Markdown
Contributor

All PipelineRuns for this commit have already succeeded. Use /retest <pipeline-name> to re-run a specific pipeline or /test to re-run all pipelines.

@openshift-ci

openshift-ci Bot commented Oct 16, 2026

Copy link
Copy Markdown

@taimurhafeez: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/gke-qa-e2e-tests 1c186dd link false /test gke-qa-e2e-tests
ci/prow/ocp-4-12-nongroovy-e2e-tests 1c186dd link false /test ocp-4-12-nongroovy-e2e-tests
ci/prow/ocp-4-22-nongroovy-e2e-tests 1c186dd link false /test ocp-4-22-nongroovy-e2e-tests

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants