← Back to Pull requests

gcp-hcp-cleanup-on-demand: accept the full gcphcpctl infra ID family #89874

Open
unknown opened this pull request with 318 lines diff across 3 files
View on GitHub
unknown unknown commented on Dec 03, 2026 18:45 UTC
Author

What

Widens the three infra ID validations in gcp-hcp-cleanup-on-demand-commands.sh (the SHARED_DIR/hosted-cluster-infra-id check, the cluster-status cross-check, and the worker-label recovery) from the exact shape ^e2e-hc-[0-9a-f]{4}$ to the whole family ^e2e-hc(-[0-9a-f]{1,6})?-[0-9a-f]{4}$. The cluster-name and nodepool-name validations are unchanged.

Why

gcphcpctl iam create --cluster-name (gcp-hcp-ctl) derives the infra ID from the cluster name, truncated at the release contract's maximumInfraIDLength, plus a random 4-hex suffix. Today's bound (12) truncates e2e-hc-<6hex> names to the e2e-hc prefix, so recorded IDs match the current exact shape. A future catalog bound increase (13-18+) would record IDs like e2e-hc-a1b2-9f8e or e2e-hc-a1b2c3-9f8e; the step would then exit 1 with fallback cleanup infra ID is invalid before running network destroy/iam destroy, leaving the run's network and IAM resources behind in the persistent customer project.

Safety

The family stays tightly scoped to this suite's e2e-hc- naming: an optional single hex segment of at most 6 chars (the cluster-name suffix, possibly truncated), then exactly 4 hex. The step's other guards (cluster name ^e2e-hc-[0-9a-f]{6}$, nodepool ${cluster_name}-np, E2E_TARGET_ allowlists, project equality) are unchanged and still bound the cleanup target.

Companion to openshift-online/gcp-hcp-infra#3166 (the HC E2E suites' migration to the receipt flow), whose lifecycle suite asserts the same family on the IDs it records, so a bound change that outgrows this family fails the suite at iam create instead of silently breaking the post-step.

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

<!-- coderabbit-ai-generated:v1 -->

Summary by CodeRabbit

This PR changes the on-demand GCP HCP cleanup fallback in ci-operator/step-registry/gcp-hcp/cleanup-on-demand/gcp-hcp-cleanup-on-demand-commands.sh.

The script now accepts infra IDs in the form e2e-hc[-<1–6 hex>]-<4 hex>. Before this change, it accepted only e2e-hc-<4 hex>. The change applies to three checks: the SHARED_DIR/hosted-cluster-infra-id check, the cluster-status cross-check, and worker-label recovery.

Without this change, a longer infra ID would stop the script before network destroy and iam destroy. The cluster-name, nodepool-name, E2E_TARGET_, and project checks are unchanged. The PR description reports no test results.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Diff: 318 lines (+238 / -80) across 3 files Reviewer: gbarabasz Review duration: 2396m
All Vouch review confidence checks passed
Residual risk 0.34 = Change Risk (0.64) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.64 · 318 lines diff across 3 files
0.64
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
0.02
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
46%
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.345
Shallow Review Depth shallow_review_depth
0.344
Sensitive Paths sensitive_paths
0.064
Real PR Conversation Timeline
1 comments
"Review active on #89874"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 46.7% reviewed sensitive_module
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: 63.6% (MEDIUM) · Higher = larger blast radius
63.6%
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: 46.7% · Lower = rushed or shallow review
46.7%
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: 33.9% · Safe to merge
33.9%