Fix correctness, concurrency, and style in DLPContentPolicy controller and mock #15467
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.39) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 243 lines diff across 3 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.329
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #15467"
general
weight: 0.35
anhdle-sso
Following review of PR #15398, this PR addresses correctness, concurrency safeguards, encapsulation, and code organization across
pkg/controller/direct/dlp/andmockgcp/mockdlp/:Key Changes
Export(): UpdatedExport()to setmetadata.nameusinga.id.ContentPolicyinstead of the full slash-separated GCP resource patha.id.String(), preventing RFC 1123 naming violations during apply.ListContentPolicies: Cloned protobuf items prior to running defaulting logic and appending to response inmockdlp/contentpolicy.go, preventing data races and memory corruption on stored objects.AdapterForURL: Extended prefix matching to support both//dlp.googleapis.com/andhttps://dlp.googleapis.com/, returning descriptive errors instead of silently swallowing malformed URLs.CreateContentPolicyto avoid duplicateProjects.GetProject()calls.newDLPServiceServerandnewContentPolicyAdapterinstead of direct cross-file struct literal instantiations.dlpServiceServerand placed private helper methods directly below their first callers.pkg/controller/direct/dlp/dlpcontentpolicy_controller_test.goandmockgcp/mockdlp/contentpolicy_test.go.Fixes #15465
``
release-note
``NONE
This pull request was generated by an AI coding agent.
<sub>🤖 Agent session</sub>
<!-- factory:task-output kind=Change task=recipe-fix-20261112-055953-c50d -->