← Back to Pull requests

feat : ARO-24013 | Remove direct autoscaler patch call from RP and pass autoscaler via patch cluster #5784

Closed
unknown closed this pull request without merging on Jul 24, 2026 11:27 UTC
View on GitHub
unknown unknown commented on Jun 25, 2026 06:26 UTC
Author

Jira Issue


Remove direct autoscaler patch call from RP and pass autoscaler via patch cluster

What

  • Removed the explicit API call to patch autoscaler from RP and instead pass autoscaler data as part of the Patch Cluster request.

  • Nest autoscaler into the cluster builder in dispatch config / BuildCSCluster, and simplify create/update paths (PostCluster, frontend, create/dispatch controllers) to a single cluster payload.

  • Remove the unused autoscaler client API and update related mocks/tests accordingly.
  • Why

  • To align RP behavior with async autoscaler update model.
  • <!-- Briefly explain why this change is needed -->

    Testing

    Testing is required for feature completion and tests should be part of the pull
    request along with the feature changes.

    Describe the testing provided. If you did not add tests, provide a clear
    justification.

  • Unit tests

  • (internal/ocm/convert_test.go) - Already test autoscaler builder construction
  • Integration tests

  • Updated mock properly extracts autoscaler history for verification
  • E2E tests
  • No New Tests Required: This is a refactoring change that doesn't alter external behavior - the ARM API contract remains unchanged. Existing tests validate the consolidated approach.

    Manual Testing

    1. patch autoscaler call was present in patch cluster RP call. After changes it is removed and confirmed using logs
    Before changes patch cluster and patch autoscaler call is present in logs-
    
    <img width="2994" height="364" alt="image" src="https://github.com/user-attachments/assets/2b3bfd37-8c70-426f-a64e-6fae8142bf0d" />

    After changes only patch cluster call is present in logs -
    <img width="1498" height="217" alt="image" src="https://github.com/user-attachments/assets/475993d0-5e83-4630-aeec-16f8768e4028" />

    2. Patch Cluster with autoscaler payload. Check the autoscaler is updated.
    
    Autoscaler values before patch
    <img width="2994" height="398" alt="image" src="https://github.com/user-attachments/assets/26c92869-4912-48c9-9d7b-217897041c0f" />

    Patch cluster payload -

    {
      "properties": {
        "autoscaling": {
          "maxNodesTotal": 5,
          "maxPodGracePeriodSeconds": 1200,
          "podPriorityThreshold": -10
        }
      }
    }
    

    Success -
    <img width="2994" height="1752" alt="image" src="https://github.com/user-attachments/assets/14bba6aa-aa24-4ac6-a5a7-0083d5551476" />

    Get Autoscaler changes to check the updation -
    <img width="2950" height="436" alt="image" src="https://github.com/user-attachments/assets/03621c5d-d566-4799-a09e-b78738469ed8" />

    Special notes for your reviewer

    <!-- optional -->

    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 graph/UI/metrics 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 test will be covered in https://github.com/Azure/ARO-HCP/pull/5932 this PR.

    Diff: 496 lines (+372 / -124) across 6 files Reviewer: nimrodshn Review duration: 42061m
    All Vouch review confidence checks passed
    Residual risk 0.19 = Change Risk (0.47) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.47 · 496 lines diff across 6 files
    0.47
    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.371
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #5784"
    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: 47.5% (MEDIUM) · Higher = larger blast radius
    47.5%
    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: 18.8% · Safe to merge
    18.8%
    Repository