← Back to Pull requests

feat(cleanup-sweeper): trace ARM deletion requests (AROSLSRE-2340) #7338

Closed
unknown closed this pull request without merging on Oct 04, 2026 22:39 UTC
View on GitHub
unknown unknown commented on Oct 03, 2026 08:32 UTC
Author

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.

GOTOOLCHAIN=go1.25.7 go test -race -parallel 1 ./tooling/cleanup-sweeper/...
(cd tooling/cleanup-sweeper && GOTOOLCHAIN=go1.25.7 golangci-lint run ./...)
make verify-yamlfmt
make -C config detect-change

The race run serializes test cases because Graph SDK client construction writes to a global backing-store factory. The unchanged TestWorkflowBuilders cases 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

  • PR is scoped to a single task (no mixed concerns)

  • Title follows Conventional Commits format

  • Summary explains the "Why" behind the change

  • Linked to relevant ticket/issue

  • Screenshots included (if dashboards or other UI changes)

  • Self-reviewed the diff

  • CI/CD checks are passing (ignore Tide)

  • Draft PR used for WIP (if applicable)

  • Commit history is clean (rebased/squashed)

  • Tricky code blocks are commented

  • Specific reviewers tagged

  • All comment threads resolved before merge
  • If E2E tests are included:

  • E2E tests follow Principles of Good E2E Test Case Design

  • If new E2E use case is covered (via a new test or new check/verifier),

  • 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.

    Diff: 397 lines (+297 / -100) across 4 files Reviewer: raelga Review duration: 2287m
    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
    0.48
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    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
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 48.2% (MEDIUM) · Higher = larger blast radius
    48.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 19% · Safe to merge
    19%
    Repository