Skip to content

ROX-36856: delete the Compliance 1.0 implementation tree - #23446

Draft
taimurhafeez wants to merge 7 commits into
th/ROX-36856-remove-compliance-v1-graphqlfrom
th/ROX-36856-delete-compliance-v1-tree
Draft

taimurhafeez wants to merge 7 commits into
th/ROX-36856-remove-compliance-v1-graphqlfrom
th/ROX-36856-delete-compliance-v1-tree

Conversation

@taimurhafeez

Copy link
Copy Markdown
Contributor

Description

Fourth backend cut of Compliance 1.0 removal (ROX-36856). The previous PRs removed the callers; this deletes the implementation they orphaned. 338 files, −28,405 lines, 1 insertion.

⚠️ Stacked on #23399 and #23438 — both must merge first. This branch contains both, because neither alone leaves a compiling tree: central/splunk imports central/compliance until #23399, and the GraphQL resolvers do until #23438. Review against those, not master.

Deleted

Tree What it was
central/compliance/ The 1.0 engine — standards, the hand-written CIS/PCI/NIST/HIPAA checks, the runner and the aggregator.
central/scrape/ Node scraping. It existed only to collect the host data those checks ran against.
central/complianceoperator/{manager,pipelines}/ The pre-v2 bridge that funnelled Compliance Operator results into v1 storage.
central/complianceoperator/{checkresults,profiles,rules,scans,scansettingbinding}/ v1 Compliance Operator datastores, found during this work. Nothing outside themselves imported them.
scale/tests/compliance_test.go Scale test for the above.

central/complianceoperator/v2/ is untouched, and so is every v2-suffixed sensor pipeline. Compliance v2 is not affected by this PR.

Three judgement calls worth a look

Change Why
MsgFromSensor_ScrapeUpdate no longer has a case in the sensor connection handler Older sensors can still send it. It now falls through to eventPipeline.Run and is dropped there. This is deliberate: the message is inert once the controller is gone, and reserving the proto fields belongs to the follow-up PR that cuts the Sensor side. Flagging it because it is the one behavioural change here rather than a pure deletion.
The search service's Aggregator dependency is removed outright, not stubbed WithAggregator, the builder field and the serviceImpl field all go. Its only consumer was the SearchCategory_COMPLIANCE autocomplete entry, so a stub would have been unreachable code on a public builder interface.
COMPLIANCE_STANDARD and COMPLIANCE_CONTROL dropped from the global index options map Both resolved to central/compliance/standards/index. They are 1.0-only categories, distinct from anything v2 registers.

Not in this PR

  • The Sensor and DaemonSet side: compliance/collection/compliance_checks/ and the scrape path in sensor/common/compliance/, plus reserving ScrapeConfig/TriggerRun in compliance_iservice.proto.
  • The Postgres tables. GORM AutoMigrate adds but never drops, so these need an explicit migration — and the count is 10, not 5: the original compliance_{configs,domains,run_metadata,run_results,strings} plus the five v1 Compliance Operator tables (compliance_operator_{check_results,profiles,rules,scans,scan_setting_bindings}) that surfaced when the datastores above turned out to be orphaned. These are distinct from v2's tables.
  • resources.Compliance is intentionally untouched — it is shared with Compliance v2 and is a customer-visible permission name.

User-facing documentation

No CHANGELOG entry. #23399 already covers the Compliance 1.0 removal for release notes; this PR deletes code that is unreachable by the time it lands.

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

Pure deletion, so no new tests. The tests that went are the ones belonging to the deleted packages. central/sensor/service/connection/mocks/connection.go is regenerated output — the Scrapes method and its import are gone because the interface method is.

How I validated my change

  • go build ./... — pass
  • go vet ./... — pass
  • go vet -tags test ./... — pass, type-checking the test-tagged files the way CI does. The only output is pre-existing copies lock value noise from generated easyjson in pkg/compliance/compress, which this branch does not touch.
  • go test -tags test ./central/... — all pass except central/clusters/zip, which panics in init() via testutils.MustBeInTest. I reproduced that in a clean worktree at the base commit, so it is pre-existing and unrelated.
  • grep sweep for central/compliance/, central/scrape and each deleted complianceoperator subpackage across Go and non-Go files (yaml, sh, Makefile, json) — zero hits.
  • gofmt — clean. central/graphql/resolvers/generated.go is deliberately left as the generator emits it; it is not gofmt-clean on master either, and formatting it by hand would break the check-generated-files regeneration diff.

🤖 Co-Generated with Claude Code

taimurhafeez and others added 7 commits October 14, 2026 12:16
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
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>
Stacked: deleting central/compliance/ requires both the API removal
(#23399, which severs central/splunk's import) and the GraphQL removal
(#23438) to be present.
Removes the Compliance 1.0 engine now that nothing calls it: the API
surface went in #23360, the service layer in #23399 and the GraphQL
resolvers in #23438. This deletes the code those PRs orphaned.

Deleted: central/compliance/ (the standards, checks and aggregation
engine), central/scrape/ (node scraping existed only to feed it),
and the pre-v2 Compliance Operator bridge under
central/complianceoperator/{manager,pipelines,checkresults,profiles,
rules,scans,scansettingbinding}/ which funnelled Compliance Operator
results into v1 storage. Only v2/ remains there; Compliance v2 is
untouched.

Two things the diff does not explain:

- The MsgFromSensor_ScrapeUpdate case is gone from the sensor
  connection handler. Older sensors can still send it, so it now falls
  through to the event pipeline and is dropped there. Reserving the
  proto fields belongs to the follow-up that cuts the Sensor side; the
  message is inert either way once the controller is gone.

- The search service's aggregator dependency is removed outright
  rather than stubbed. It only ever served the COMPLIANCE autocomplete
  category, so a stub would have been unreachable code.

The five Compliance 1.0 Postgres tables survive this PR. GORM
AutoMigrate never drops, so they need an explicit migration.

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

openshift-ci Bot commented Oct 15, 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

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Build Images Ready

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

export MAIN_IMAGE_TAG=5.1.x-284-g1e4ac30f5c

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.

1 participant