feat(cleanup-sweeper): trace ARM deletion requests (AROSLSRE-2340) #7338
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.48) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.48 · 397 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.358
Shallow Review Depth
shallow_review_depth
0.289
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #7338"
general
weight: 0.35
raelga
AROSLSRE-2340
What
Adds run and Prow build metadata to cleanup-sweeper logs, plus request IDs, response IDs, HTTP status, and attempt numbers for ARM DELETE requests. Role-assignment logs include the discovery decision and the fresh principal check before deletion.
Assignments that return 404 are reported as already absent, not deleted by this run. The cleanup guide explains how to use the fields and where attribution stops.
Why
A shared Azure identity does not identify which process issued a deletion. These logs connect a request to the sweeper run and the decision that sent it, when matching Azure evidence is available.
Testing
Fake ARM and Graph transports cover successful deletion, GET/DELETE 404s, retained principals, permission failures, best-effort failures, dry-run, SDK retries, and step retries. Assertions check the request ID on the wire, response status and IDs, metadata propagation, and safe logging on transport errors.
The race run serializes test cases because Graph SDK client construction writes to a global backing-store factory. The unchanged
TestWorkflowBuilderscases reproduce that race independently. Cleanup runner goroutines still run under the race detector. No live Azure deletions are needed for these tests.Special notes for your reviewer
Orphan selection, Graph safety checks, retry limits, and permissions stay unchanged. The per-attempt audit entries log selected metadata, not bodies, credentials, query parameters, or arbitrary headers. Existing runner and command error logs are unchanged and can include SDK response bodies or transport URLs. The separate certificate data-plane command is outside this ARM audit path.
This does not identify the source of historical requests without matching evidence. An HTTP response is not proof that asynchronous cleanup finished, and Azure does not guarantee that every response ID appears in Activity Log.
PR Checklist
If E2E tests are included:
demonstrate that the test is able to detect a defect/error and fail with
proper error message and logs which communicates nature of the problem.