← Back to Pull requests

Greenfield: Implement direct controller, E2E fixtures, and fuzzer for NetworkServicesServiceLBPolicy #13790

Closed
unknown closed this pull request without merging on Oct 13, 2026 14:48 UTC
View on GitHub
unknown unknown commented on Oct 07, 2026 23:14 UTC
Author

Description


This PR implements the Greenfield direct controller, KRMFuzzer, and E2E test fixtures for NetworkServicesServiceLBPolicy.

Changes


  • Implemented pkg/controller/direct/networkservices/networkservicesservicelbpolicy_controller.go following KCC direct controller standards:

  • - Reconciles NetworkServicesServiceLBPolicy with GCP using official GAPIC REST client (gcp.NewRESTClient).
    - Implements Find, Create, Update, Delete, and Export operations.
    - Compares spec fields and labels using top-level field diffing (common.DiffForTopLevelFields).
    - Supports deletion defense and status condition management.
  • Registered NetworkServicesServiceLBPolicy in pkg/controller/resourceconfig/static_config.go with DefaultController: k8s.ReconcilerTypeDirect.

  • Implemented round-trip fuzzer pkg/controller/direct/networkservices/networkservicesservicelbpolicy_fuzzer.go registered with fuzztesting.RegisterKRMFuzzer.

  • Added minimal and maximal E2E test fixtures in pkg/test/resourcefixture/testdata/basic/networkservices/v1alpha1/networkservicesservicelbpolicy/:

  • - networkservicesservicelbpolicy-minimal: tests creation, status observation, and re-reconciliation with required fields.
    - networkservicesservicelbpolicy-maximal: tests creation, mutable in-place updates, and re-reconciliation covering spec fields (description, loadBalancingAlgorithm, autoCapacityDrain, failoverConfig, labels).
  • Recorded golden files (_http.log, _identities.yaml, _generated_object_*.golden.yaml) and live REST GET probe audit receipts (_audit_probe.log) directly against real GCP project cnrm-barni-4 using RECORD_AUDIT_PROBE=1 ./hack/record-gcp.
  • Real GCP Testing & Validation


  • Real GCP project used: cnrm-barni-4

  • RECORD_AUDIT_PROBE=1 ./hack/record-gcp "fixtures/^networkservicesservicelbpolicy-minimal$" passed cleanly and verified re-reconciliation.

  • RECORD_AUDIT_PROBE=1 ./hack/record-gcp "fixtures/^networkservicesservicelbpolicy-maximal$" passed cleanly, verified update reconciliation and re-reconciliation.

  • Tested fuzzer: FOCUS=NetworkServicesServiceLBPolicy go test -count=1 -v ./pkg/fuzztesting/fuzztests/ -run=^TestFocusedMappers$ passed.

  • Tested API checks: go test ./tests/apichecks/... passed.

  • Tested CRD template: go test ./pkg/crd/template/... passed.
  • Fixes #13785

    ``release-note
    NONE
    ``

    ---
    This PR was generated by the overseer,greenfield,step/controller,overseer/review agent (powered by the gemini-3.7-flash model).

    Diff: 316 lines (+237 / -79) across 3 files Reviewer: himanigulati01 Review duration: 8133m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.40) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 316 lines diff across 3 files
    0.40
    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%
    56%
    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.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #13790"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% 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: 40.4% (MEDIUM) · Higher = larger blast radius
    40.4%
    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: 56.8% · Lower = rushed or shallow review
    56.8%
    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.5% · Safe to merge
    17.5%