ci(uat): clear an orphaned flow-logs log group before AWS bringup #4011
All Vouch review confidence checks passed
Residual risk 0.20 = Change Risk (0.50) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.50 · 623 lines diff across 7 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.385
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #4011"
general
weight: 0.35
dims
Summary
Before Bringup, the AWS UAT workflow now deletes an orphaned VPC flow-logs log group left by an earlier attempt of the same run, so a re-run no longer fails minutes into Bringup on
ResourceAlreadyExistsException.Motivation / Context
A re-run attempt reuses the run ID, so
DEPLOYMENT_IDand every name derived from it repeat. When the previous attempt was destroyed, a flow-log delivery still in flight recreated/aws/vpc/<DEPLOYMENT_ID>-flow-logsbehind Terraform's delete, unmanaged and with no flow log attached. The re-run's Bringup then failed creating the same group, after about 18 minutes and with the capacity reservation held.Fixes: #3006
Type of Change
Component(s) Affected
cmd/aicr,pkg/cli)cmd/aicrd,pkg/server)pkg/recipe)pkg/bundler,pkg/component)pkg/collector,pkg/snapshotter)pkg/validator)pkg/errors,pkg/k8s)docs/,examples/).github/workflows/uat-aws.yaml,tests/uat/lib,infra/uat-aws-account/README.mdImplementation Notes
Bringup Infra, under the same condition (skipped fordaytime-down). It looks up the exact group name; if the group exists and no flow log uses it, it deletes it.main, the re-run's Bringup converges on that state and teardown removes it at the end. Stopping before Bringup would also skip teardown (it is gated on Bringup having run) and leak that deployment. So the step never deletes a group in use, which is what the issue's fail-closed rule protects, and otherwise leaves that case exactly as it is today, with a notice.:suffix), because a flow log created with a destination ARN may not report a group name, which a server-sidelog-group-namefilter would miss. A failed or unreadable lookup stops the run without deleting anything./aws/vpc/<DEPLOYMENT_ID>-flow-logs, comes from the actuator's Terraform error quoted in the issue; the actuator's source is not in this repo. A different name would make the step a no-op, not delete anything else./aws/vpc/aicr-uat-groups (the UAT janitor is #3669).infra/uat-aws-account/README.mdnames the new log-group calls under CloudWatch Logs; the role already grants them.Testing
make qualify: passes, including the new shell test.tests/uat/lib/aws-flow-logs-preflight_test.sh(run bymake test-shell) extracts the step with yq and runs it against a stubaws. It checks that the step sits right beforeBringup Infraunder the same condition, and 11 cases: no group; a longer name sharing the prefix; an orphan; flow logs of other groups; a group in use by name, by destination ARN, and by a:*ARN; failed log-group and flow-log lookups; an unreadable flow-log response; a failed delete. It fails rather than skips when yq or jq is missing.pipefailremoved, the flow-log lookup's failure swallowed, the step's condition inverted.Risk Assessment
Rollout notes: N/A. CI only.
Checklist
make testwith-race)make lint)git commit -s -S) — GPG signing info