← Back to Pull requests

Greenfield: Implement direct controller, E2E fixtures, and fuzzer for ComputeVMExtensionPolicy #15541

Closed
unknown closed this pull request without merging on Nov 13, 2026 17:58 UTC
View on GitHub
unknown unknown commented on Nov 13, 2026 01:15 UTC
Author

Implements the direct controller, round-trip KRM fuzzer, and real-GCP recorded E2E fixtures for ComputeVMExtensionPolicy under compute.cnrm.cloud.google.com/v1alpha1 following Greenfield Step 2 (.gemini/skills/kcc-direct-controller-logic-greenfield-implementer/SKILL.md).

Summary of Changes


  • Controller Implementation: Added pkg/controller/direct/compute/computevmextensionpolicy_controller.go using GAPIC REST client gcp.NewZoneVmExtensionPoliciesRESTClient(ctx, opts...). The controller adheres to all 5 canonical Greenfield standards:

  • - REST client options configured via m.config.RESTClientOptions().
    - Greenfield reference normalization via common.NormalizeGreenfieldReferences(ctx, reader, obj, nil).
    - Identity extraction via ComputeVMExtensionPolicyIdentity (obj.GetIdentity).
    - In-place mutation detection via common.CompareGreenfieldSpec with structuredreporting.ReportDiff.
    - Consistent setStatus execution across all reconcile branches.
  • Reconciler Registration: Registered ComputeVMExtensionPolicy in pkg/controller/resourceconfig/static_config.go with DefaultController: Direct and SupportedControllers: [Direct].

  • Fuzzer: Autogenerated pkg/controller/direct/compute/computevmextensionpolicy_fuzzer.generated.go via controllerbuilder generate-fuzzer --prepopulate-resource. Verified round-trip fidelity with FOCUS=ComputeVMExtensionPolicy go test ./pkg/fuzztesting/fuzztests -run TestFocusedMappers.

  • E2E Golden Fixtures: Created minimal and maximal test fixtures under pkg/test/resourcefixture/testdata/basic/compute/v1alpha1/computevmextensionpolicy/ and recorded authentic HTTP traffic against real GCP using RECORD_AUDIT_PROBE=1 ./hack/record-gcp in project cnrm-barni-4. Verified zero-diff re-reconciliation, clean deletion, and 7/7 automated lifecycle checks (V1–V7).

  • Golden Exceptions: Updated tests/apichecks/testdata/exceptions/alpha-missingfields.txt as all spec fields are now covered by test fixtures.

  • Journals: Documented findings and implementation notes in .gemini/journals/compute.md.
  • Real GCP Verification


  • GCP Project: cnrm-barni-4

  • Cloud Audit Logs:

  • - v1.compute.zoneVmExtensionPolicies.insert
    - v1.compute.zoneVmExtensionPolicies.update
    - v1.compute.zoneVmExtensionPolicies.delete
    - Actuation probe event: RESOURCE_ACTUATED_AND_VERIFIED (logName: projects/cnrm-barni-4/logs/kcc-e2e-actuation-audit)

    Workflow feedback


  • Compute Engine API services with Zone or Region prefix (such as ZoneVmExtensionPolicies) require specifying the exact GAPIC client NewZoneVmExtensionPoliciesRESTClient when initial generation heuristics fall back to parent service scopes.
  • Fixes #15517

    ``release-note
    NONE

    
    This pull request was generated by an AI coding agent.
    
    <sub>🤖 [Agent session](https://staging.repoagent.dev/#/overseers/kcc/task-session/fix-k8s-config-connector-15517/recipe-fix-20261112-225319-cd1e)</sub>
    
    <!-- factory:task-output kind=Change task=recipe-fix-20261112-225319-cd1e -->
    
    ---
    
    ### Greenfield: Implement MockGCP and Alignment for ComputeVMExtensionPolicy
    
    Implement Phase 3 (MockGCP and Alignment) for ComputeVMExtensionPolicy under compute.cnrm.cloud.google.com/v1alpha1.
    
    - Implement ZoneVmExtensionPolicies service in mockgcp/mockcompute/computevmextensionpolicies.go supporting Get, Insert, Update, and Delete operations using GAPIC computepb types and zonal LRO emulation.
    - Register ZoneVmExtensionPolicies HTTP REST routes in mockgcp/mockcompute/service.go using runtime.ForwardResponseMessage for correct header formatting.
    - Add ComputeVMExtensionPolicy to supported mock resources in config/tests/samples/create/harness.go.
    - Configure normalization in mockgcp/mockcompute/normalize.go and tests/e2e/normalize.go for updateTimestamp.
    - Add delete(v, "updateTimestamp") to normalizeRepresentation in pkg/test/resourcefixture/golden_alignment_test.go.
    - Execute hack/compare-mock for both minimal and maximal fixtures, achieving 0 diff against authentic real GCP logs, and generate _http_mock.log files.
    - Record implementation details and service findings in .gemini/journals/compute.md.
    
    This pull request was generated by an AI coding agent.
    
    Fixes #15556
    
    <!-- factory:group-step issue=15556 -->
    
    ---
    
    ### Greenfield: Release ComputeVMExtensionPolicy (remove it from BLOCKED_KINDS)
    
    Removes `ComputeVMExtensionPolicy` from `BLOCKED_KINDS` in `dev/tasks/build-release-bundle` so its CRD ships in the release bundle.
    
    All test fixtures under `pkg/test/resourcefixture/testdata/basic/compute/v1alpha1/computevmextensionpolicy/` (`computevmextensionpolicy-minimal` and `computevmextensionpolicy-maximal`) have verified authentic real-GCP golden logs (`_http.log`), audit probe logs (`_audit_probe.log`), and mock golden logs (`_http_mock.log`).
    
    
    release-note
    New Alpha Resources (Direct Reconciler):
    ComputeVMExtensionPolicy
    `

    Review Instructions

    Use .gemini/skills/reviewgen-greenfield-release/SKILL.md to conduct the review.

    KCC Greenfield Release Auto-Review Results


    Only
    BLOCKED_KINDS Changed: Pass
    Fixture Evidence (_http.log, _audit_probe.log, _http_mock.log`): Pass
  • Release Note: Pass
  • Detailed Findings / Actions Required:


    None. All criteria and invariants are satisfied.

    This pull request was generated by an AI coding agent.

    Fixes #15584

    <!-- factory:group-step issue=15584 -->

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: anhdle-sso Review duration: 1002m
    All Vouch review confidence checks passed
    Residual risk 0.25 = Change Risk (0.57) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.57 · 650 lines diff across 8 files
    0.57
    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.388
    Shallow Review Depth shallow_review_depth
    0.289
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #15541"
    general weight: 0.35
    Reviewers
    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: 57% (MEDIUM) · Higher = larger blast radius
    57%
    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: 24.7% · Safe to merge
    24.7%