Skip to content

refactor: Remove PlatformRefs field from LiveState (control-plane differ)#2138

Merged
bjcoombs merged 1 commit intodevelopfrom
remove-platform-ref--7--control-plane-differ
Apr 6, 2026
Merged

refactor: Remove PlatformRefs field from LiveState (control-plane differ)#2138
bjcoombs merged 1 commit intodevelopfrom
remove-platform-ref--7--control-plane-differ

Conversation

@bjcoombs
Copy link
Copy Markdown
Collaborator

@bjcoombs bjcoombs commented Apr 6, 2026

Summary

  • Removes PlatformRefs from LiveState struct in services/control-plane/internal/differ/live_state.go
  • Removes PlatformRefs: live.PlatformRefs from filterTenantOwned return value
  • Simplifies comment on filterTenantOwned to remove stale PlatformRefs references
  • Removes TestFilterTenantOwned_SagaOverride_Retained test (tested PlatformRefs propagation)
  • Renames TestFilterTenantOwned_PreservesSystemAndPlatformRefMaps to TestFilterTenantOwned_PreservesSystemCodesMap and strips PlatformRefs assertions
  • Removes unused sagaNames test helper

Context

PlatformRefs was a documentation-only field. Tenant override sagas (is_system=false with a platform_ref) are not in SystemCodes, so they pass through filterTenantOwned without any special handling. The field tracked metadata that was never used for filtering logic, adding complexity with no behavioural value.

Part of the broader remove-platform-ref refactor.

Test plan

  • go test ./services/control-plane/internal/differ/... -count=1 - all tests pass
  • go build ./services/control-plane/... - compiles cleanly
  • golangci-lint - 0 issues

PlatformRefs was a documentation-only field tracking tenant override
sagas. Since tenant overrides are not in SystemCodes, they pass through
filterTenantOwned without any special handling. The field added no
behavioural value and is removed along with the associated test cases.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 6, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1f6cf8de-a531-468f-ad05-73cc2bc0989b

📥 Commits

Reviewing files that changed from the base of the PR and between 28e0e04 and 1bc670e.

📒 Files selected for processing (2)
  • services/control-plane/internal/differ/live_state.go
  • services/control-plane/internal/differ/live_state_filter_test.go

📝 Walkthrough

Walkthrough

The PlatformRefs field is removed from the LiveState struct, eliminating platform override resource tracking. All associated logic, comments, and test coverage for this field are deleted. The filtering behavior now only excludes resources whose codes appear in SystemCodes.

Changes

Cohort / File(s) Summary
LiveState struct refactoring
services/control-plane/internal/differ/live_state.go
Removed PlatformRefs field from LiveState struct and eliminated all corresponding field initialization and assignment logic. The filterTenantOwned function no longer handles platform override resources.
Test updates
services/control-plane/internal/differ/live_state_filter_test.go
Removed TestFilterTenantOwned_SagaOverride_Retained test that verified saga override retention behavior. Renamed and simplified TestFilterTenantOwned_PreservesSystemAndPlatformRefMaps to only assert SystemCodes map preservation. Deleted sagaNames helper function that was only used in the removed test.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely summarizes the main change: removing the PlatformRefs field from the LiveState struct in the control-plane differ module.
Description check ✅ Passed The description is directly related to the changeset, providing a clear summary of what was removed, why it was removed (documentation-only field with no behavioral value), and verification that tests pass.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch remove-platform-ref--7--control-plane-differ

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

@claude
Copy link
Copy Markdown

claude Bot commented Apr 6, 2026

Claude Code Review

Commit: 1bc670ec | CI: running (builds/tests/lint pending)

Summary

Clean removal of the unused PlatformRefs field from LiveState. PlatformRefs was documentation-only metadata. Tenant overrides (is_system=false with platform_ref) are not in SystemCodes, so they pass through filterTenantOwned without any special handling. The field added complexity with no behavioral value.

The implementation is correct:

  • Field removed from struct
  • Field removed from filterTenantOwned return
  • Comment simplified to remove stale references
  • Test for PlatformRefs propagation removed (tested behavior that no longer exists)
  • Remaining test renamed to accurately reflect its narrower scope
  • Unused sagaNames helper removed
  • No remaining references to PlatformRefs in either file at HEAD

This satisfies the stated scope of the remove-platform-ref refactor for the control-plane differ.

Risk Assessment

Area Level Detail
Blast radius Low Struct field removal, no callers depended on it for logic
Rollback Safe Pure deletion, revert is trivial
Scale Low No runtime behavior change
Cross-system Low Field was internal to differ package
Migration N/A No database changes

Findings

No issues found. The change is a straightforward dead-code removal with appropriate test updates.

Bot Review Notes

No unresolved bot threads found. CodeRabbit review still in progress.

Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

Clean dead-code removal. No domain risks, no behavioral changes, tests appropriately updated. See summary comment for details.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@bjcoombs bjcoombs merged commit 328fdee into develop Apr 6, 2026
44 checks passed
@bjcoombs bjcoombs deleted the remove-platform-ref--7--control-plane-differ branch April 6, 2026 09:46
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.

1 participant