BCH-1346: Expose id/status/driftRiskId on the leveraged-controls projection#455
Conversation
…-controls projection The downstream UI's Inherited Capability panel needs the link's own id (to call ReAttest, whose route path requires it) and status (to know a link is drifted at all) — neither existed on leveragedControlResponse. Adds both, plus a batched driftRiskId lookup (via the same dedupe-key convention ReAttest already uses) so a drifted link's warning can carry a direct reference to the risk it created, rather than just a status label.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthrough
ChangesLeveragedControls projection
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@CodeRabbit review |
✅ Action performedReview finished.
|
Summary
id,status, anddriftRiskIdtoleveragedControlResponse(GET /oscal/system-security-plans/:id/leveraged-controls, BCH-1338/1339/1341).compliance-framework/ui) needs the link's ownidto callPOST .../leveraged-controls/:linkId/attest, andstatusto know a link is drifted at all — neither existed on this response before.driftRiskIdis resolved via a batched query using the samededupe-key = "leverage-drift:<linkId>"conventionReAttestalready uses, so a drifted link's UI warning can link directly to the risk record, not just show a status label.Test plan
go build ./...,go vet ./...cleangolangci-lint run ./internal/api/handler/oscal/...— 0 issuesdriftRiskId), drifted link with an open drift risk (driftRiskIdpopulated, verified against the actual risk id), revoked link (nodriftRiskId)go test ./...greenmake reviewable(swag + lint + integration tests against real Postgres) passesstatus: "drifted"and a resolvabledriftRiskIdSummary by CodeRabbit
New Features
Bug Fixes