← Back to Pull requests

Add tool to audit request serving node autoscaling status for HCP #1

Closed
unknown closed this pull request without merging on Jan 27, 2026 20:42 UTC
View on GitHub
unknown unknown commented on Jan 23, 2026 15:10 UTC
Author

Add tooling to support Migration Plan for Request Serving Node Autoscaling

Audit Example Output:

$ hcp-node-autoscaling audit --mgmt-cluster-id hs-mc-ibv8l52c0

Auditing management cluster: hs-mc-ibv8l52c0 (28i3jvakrs0i6ctdfiu1ph0v0ea5lfms)
Found 5 OCM namespaces to audit (production and staging)

Management Cluster: 28i3jvakrs0i6ctdfiu1ph0v0ea5lfms
Total Hosted Clusters Scanned: 5

=== GROUP B: Ready for Migration (1 clusters) ===
These clusters can be immediately migrated to autoscaling:

CLUSTER ID                         CLUSTER NAME        NAMESPACE                                      CURRENT SIZE
2o2hoeclbbbpdgu37k7frrjt9j7k0sbk   creed-hcp-test      ocm-staging-2o2hoeclbbbpdgu37k7frrjt9j7k0sbk   m5xl

=== Already Configured (4 clusters) ===
These clusters already have autoscaling annotations set:

CLUSTER ID                         CLUSTER NAME        NAMESPACE                                      CURRENT SIZE
2nlqofmqgncheuf6ljr7khat8ksk8u2h   crimson-qe1         ocm-staging-2nlqofmqgncheuf6ljr7khat8ksk8u2h   m5xl
2nqnmadcrvue9ibet0gaognqjm1he4md   sfmanhcp            ocm-staging-2nqnmadcrvue9ibet0gaognqjm1he4md   m5xl
2ns52e7h5qm664le1p37pm90jl4j9v1t   dt-hcp-auto         ocm-staging-2ns52e7h5qm664le1p37pm90jl4j9v1t   m5xl
2nto5tnphh185ao4394ltrt8urchm1mc   shawn-welly-hcp     ocm-staging-2nto5tnphh185ao4394ltrt8urchm1mc   m5xl

Summary:
  - Group A (Needs annotation removal): 0 clusters
  - Group B (Ready for migration): 1 clusters
  - Already configured: 4 clusters
  - Errors: 0 namespaces

Migrate Example Output:

$ hcp-node-autoscaling migrate --service-cluster-id hs-sc-85v02ch40 --mgmt-cluster-id hs-mc-ibv8l52c0

Service Cluster: hs-sc-85v02ch40 (28i2nkqn5q9f3mqirkali89aeuc09bct)
Management Cluster: hs-mc-ibv8l52c0 (28i3jvakrs0i6ctdfiu1ph0v0ea5lfms)
ManifestWork Namespace: hs-mc-ibv8l52c0

INFO[0001] Backplane URL retrieved via OCM environment: https://api.stage.backplane.openshift.com 
INFO[0001] Backplane URL retrieved via OCM environment: https://api.stage.backplane.openshift.com 
Scanning 5 namespaces for migration candidates...

=== Clusters Ready for Migration (1) ===

CLUSTER ID                         CLUSTER NAME        NAMESPACE                                      CURRENT SIZE
2o2hoeclbbbpdgu37k7frrjt9j7k0sbk   creed-hcp-test      ocm-staging-2o2hoeclbbbpdgu37k7frrjt9j7k0sbk   m5xl

These clusters will receive the following annotations:
  - hypershift.openshift.io/topology: dedicated-request-serving-components
  - hypershift.openshift.io/resource-based-cp-auto-scaling: "true"

Continue? (y/N): y

[1/1] Migrating cluster creed-hcp-test (2o2hoeclbbbpdgu37k7frrjt9j7k0sbk)...
  - Patched ManifestWork on service cluster
  - Waiting for sync (timeout: 5 minutes)...
  - Verified: Annotations synced to management cluster
✓ Successfully migrated 2o2hoeclbbbpdgu37k7frrjt9j7k0sbk


=== Migration Summary ===

Total candidates: 1
Successfully migrated: 1
Failed: 0

✓ Successfully Migrated:
  - creed-hcp-test (2o2hoeclbbbpdgu37k7frrjt9j7k0sbk)

Diff: 387 lines (+290 / -97) across 4 files Reviewer: reedcort Review duration: 6092m
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.43) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 387 lines diff across 4 files
0.43
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.357
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #1"
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: 43% (MEDIUM) · Higher = larger blast radius
43%
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: 17% · Safe to merge
17%