← Back to Pull requests

Greenfield: Implement direct controller, E2E fixtures, and fuzzer for DesignCenterShare #16811

Closed
unknown closed this pull request without merging on Nov 30, 2026 16:41 UTC
View on GitHub
unknown unknown commented on Nov 30, 2026 05:43 UTC
Author

This pull request was generated by an AI coding agent.

Implement the direct controller, round-trip fuzzer, and minimal/maximal E2E fixtures for DesignCenterShare (designcenter.cnrm.cloud.google.com/v1alpha1) following Greenfield Step 2:

  • Controller & Fuzzer: Generated direct controller and round-trip fuzzer using one-shot controllerbuilder generate-controller and generate-fuzzer with --prepopulate-resource. Verified 200-seed round-trip fuzzer passes (FOCUS=DesignCenterShare go test -v ./pkg/fuzztesting/fuzztests -run TestFocusedMappers).

  • Resource Immutability: The DesignCenter Share API does not support an update RPC (updating shares is not supported). The controller cleanly rejects spec updates.

  • Registration: Registered DesignCenterShare in pkg/controller/resourceconfig/static_config.go with k8s.ReconcilerTypeDirect.

  • E2E Fixtures & Golden Recordings:

  • - Created designcentershare-minimal and designcentershare-maximal fixtures under parent DesignCenterCatalog and grandparent DesignCenterSpace.
    - Recorded golden HTTP logs (_http.log), audit probe logs (_audit_probe.log), golden objects (_generated_object_.golden.yaml), and identity manifests (_identities.yaml) against real GCP (cnrm-barni-4) using RECORD_AUDIT_PROBE=1 ./hack/record-gcp.
    - Both fixtures passed all 7/7 automated lifecycle validation checks.
  • Field Coverage & Exceptions: Removed satisfied missing field exceptions for designcentershares in tests/apichecks/testdata/exceptions/alpha-missingfields.txt.

  • Journal: Added service journal entry in .gemini/journals/designcenter.md.
  • Fixes #16797

    ``release-note
    NONE

    
    ## Real-GCP Verification & Audit Logs
    Recorded in GCP project `cnrm-barni-4`:
    
    yaml
    ---
    insertId: 4i7pczc55r
    logName: projects/cnrm-barni-4/logs/cloudaudit.googleapis.com%2Factivity
    protoPayload:
    '@type': type.googleapis.com/google.cloud.audit.AuditLog
    methodName: google.cloud.designcenter.v1.DesignCenter.CreateShare
    resourceName: projects/cnrm-barni-4/locations/us-central1/spaces/dc-space-xnuffpsbn4ytd3a/catalogs/dc-catalog-xnuffpsbn4ytd3a/shares/designcentershare-maximal-xnuffpsbn4ytd3a
    serviceName: designcenter.googleapis.com
    ---
    insertId: n3ghy1d14pu
    logName: projects/cnrm-barni-4/logs/cloudaudit.googleapis.com%2Factivity
    protoPayload:
    '@type': type.googleapis.com/google.cloud.audit.AuditLog
    methodName: google.cloud.designcenter.v1.DesignCenter.CreateShare
    resourceName: projects/cnrm-barni-4/locations/us-central1/spaces/dc-space-vlfytmdnzpdlpvy/catalogs/dc-catalog-vlfytmdnzpdlpvy/shares/designcentershare-minimal-vlfytmdnzpdlpvy
    serviceName: designcenter.googleapis.com
    
    ## Review Instructions
    
    Use .gemini/skills/reviewgen-greenfield-controller/SKILL.md to conduct the review.
    
    ### KCC Greenfield Controller Auto-Review Results
    * **Trigger criteria matched**: Yes
    * **Post-Judgement, One-Shot Generation, & `static_config.go`**: Pass
    * **Client Creation & Reference Normalization**: Pass
    * **CompareGreenfieldSpec & Structured Reporting**: Pass
    * **LRO Wait & Mandatory Status Updates**: Pass
    * **Fuzzer & Real-GCP Test Coverage**: Pass
    
    #### Detailed Findings / Actions Required:
    None. All Greenfield Step 2 criteria and invariants are satisfied.
    
    <sub>🤖 [Agent session](https://staging.repoagent.dev/#/overseers/kcc/task-session/fix-k8s-config-connector-16797/recipe-fix-20261130-031805-a2ff)</sub>
    
    <!-- factory:task-output kind=Change task=recipe-fix-20261130-031805-a2ff -->
    
    ---
    
    ### Greenfield: Implement MockGCP and Alignment for DesignCenterShare
    
    This pull request was generated by an AI coding agent.
    
    Implement MockGCP emulation and golden log alignment for `DesignCenterShare` (`designcenter.cnrm.cloud.google.com/v1alpha1`) following Greenfield Step 3:
    
    - **Mock Implementation**: Added `shareName` and `parseShareName` in `mockgcp/mockdesigncenter/names.go`. Implemented `GetShare`, `CreateShare`, `DeleteShare`, `ListShares`, and `populateShare` in `mockgcp/mockdesigncenter/share.go`.
    - **LRO & Defaulting**: Emulated asynchronous LRO creation and deletion matching authentic GCP API semantics (empty response for create LRO, Empty response for delete LRO). Defaulted `state` to `IN_SYNC` (1) and populated `createTime`.
    - **Harness & Golden Alignment**: Added `DesignCenterShare` to the MockGCP allowlist in `config/tests/samples/create/harness.go`. Generated `_http_mock.log` for both `designcentershare-minimal` and `designcentershare-maximal` fixtures.
    - **Verification**: Verified 0-diff golden log alignment with `TestGoldenLogAlignment` and verified all 20 tests in `./dev/ci/presubmits/tests-e2e-fixtures-suite designcenter` pass in parallel.
    - **Journal**: Updated `.gemini/journals/designcenter.md` with Greenfield Step 3 findings and implementation details.
    
    Fixes #16821
    
    
    release-note
    NONE
    
    ## Review Instructions
    
    Use .gemini/skills/reviewgen-greenfield-mockgcp/SKILL.md to conduct the review.
    
    ### KCC Greenfield MockGCP (Step 3/4) Auto-Review Results
    * **Step**: 3 (MockGCP)
    * **Real-GCP Baseline Untouched**: Pass
    * **Mock Service & CRUD (Step 3) / Fix Quality (Step 4)**: Pass
    * **Golden Log Alignment & CI Fixtures**: Pass
    * **Normalizer Scoping**: Pass
    * **Scope, Exceptions & `BLOCKED_KINDS`**: Pass
    
    #### Detailed Findings / Actions Required:
    None. All Greenfield Step 3 MockGCP criteria and invariants are satisfied.
    
    <!-- factory:group-step issue=16821 -->
    
    ---
    
    ### Greenfield: Release DesignCenterShare (remove it from BLOCKED_KINDS)
    
    This pull request was generated by an AI coding agent.
    
    Remove `DesignCenterShare` from `BLOCKED_KINDS` in `dev/tasks/build-release-bundle`.
    
    All prerequisites and prior Greenfield steps for `DesignCenterShare` are complete:
    - Direct KRM types, identity, reference, and CRD generated and finalized.
    - Direct controller, fuzzer, and minimal/maximal E2E fixtures implemented.
    - Verified all fixtures under `pkg/test/resourcefixture/testdata/basic/designcenter/v1alpha1/designcentershare/` have authentic real-GCP `_http.log`, `_audit_probe.log`, and `_http_mock.log`.
    - MockGCP CRUD methods implemented and verified; mock E2E fixtures pass cleanly with zero discrepancies.
    - DesignCenterShare is ready to ship in the release bundle.
    
    Fixes #16832
    
    
    release-note
    New Alpha Resources (Direct Reconciler):
    DesignCenterShare
    `

    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 Greenfield Release step criteria and invariants are satisfied.

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

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: reviewbot-robot Review duration: 657m
    All Vouch review confidence checks passed
    Residual risk 0.22 = Change Risk (0.52) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    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
    Real PR Conversation Timeline
    1 comments
    "Review active on #16811"
    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: 52% (MEDIUM) · Higher = larger blast radius
    52%
    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: 22.5% · Safe to merge
    22.5%