← Back to Pull requests

Implement direct controller and test fixtures for BeyondCorpAppGateway #14611

Open
unknown opened this pull request with 279 lines diff across 3 files
View on GitHub
unknown unknown commented on Oct 29, 2026 07:29 UTC
Author

This pull request implements the direct controller and test fixtures for BeyondCorpAppGateway (beyondcorp.cnrm.cloud.google.com/v1alpha1) following the kcc-direct-controller-implementer and kcc-direct-controller-logic-brownfield skills.

Key Changes


  • Direct Controller Implementation:

  • - Implemented Adapter under pkg/controller/direct/beyondcorp/beyondcorpappgateway/beyondcorpappgateway_controller.go using the official cloud.google.com/go/beyondcorp/appgateways/apiv1 GAPIC client.
    - Implemented Find, Create, Update, Delete, and Export / AdapterForURL.
    - Propagated GCP labels from KRM metadata.labels using label.GCPLabels.
    - Handled GCP resource immutability: Since GCP does not support updates for BeyondCorp AppGateways, Update() uses common.CompareBrownfieldSpecAndLabels to detect spec or label diffs and returns an error explaining that the resource is immutable, while allowing steady-state re-reconciliation to proceed without issuing mutating requests.
  • Dual Controller Registration:

  • - Added k8s.ReconcilerTypeDirect to SupportedControllers for BeyondCorpAppGateway in pkg/controller/resourceconfig/static_config.go while keeping DefaultController as k8s.ReconcilerTypeTerraform.
  • Fuzzer Test & Golden Files:

  • - Added round-trip fuzzer test beyondcorpappgateway_fuzzer_test.go.
    - Generated and aligned golden mock files (_http_mock.log, _http_old_controller_mock.log, _final_object_old_controller.golden.yaml, _http_mock.diff, _final_object.diff).
    - Verified that both direct and fallback legacy reconcilers pass all tests (creation, readiness, re-reconciliation, and deletion).
  • Journals:

  • - Added migration journals in .gemini/skills/kcc-direct-controller-implementer/journal/BeyondCorpAppGateway.md and .gemini/skills/kcc-direct-controller-logic-brownfield/journal/BeyondCorpAppGateway.md.

    Fixes #14589

    ``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-20261029-062337-126b -->

    Diff: 279 lines (+209 / -70) across 3 files Reviewer: maqiuyujoyce Review duration: 53817m
    All Vouch review confidence checks passed
    Residual risk 0.26 = Change Risk (0.47) × (1 − Review Confidence (0.45)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.47 · 279 lines diff across 3 files
    0.47
    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%
    44%
    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
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.337
    Real PR Conversation Timeline
    1 comments
    "Review active on #14611"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 44.7% 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: 46.6% (MEDIUM) · Higher = larger blast radius
    46.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: 44.7% · Lower = rushed or shallow review
    44.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: 25.8% · Safe to merge
    25.8%