← Back to Pull requests

Greenfield: Implement direct controller, E2E fixtures, and fuzzer for SaaSServiceMgmtSaaS #15389

Closed
unknown closed this pull request without merging on Nov 11, 2026 20:08 UTC
View on GitHub
unknown unknown commented on Nov 11, 2026 06:18 UTC
Author

Implements direct controller, fuzzer, and E2E test fixtures for SaaSServiceMgmtSaaS under saasservicemgmt.cnrm.cloud.google.com/v1alpha1 following Greenfield Step 2:

  • Autogenerated direct controller and fuzzer via controllerbuilder.

  • Standardized direct controller to use GAPIC REST client, normalize references, reconcile metadata labels via label.GCPLabels and common.CompareGreenfieldSpecAndLabels, and support export.

  • Added round-trip fuzzer with unmapped proto fields triaged.

  • Registered SaaSServiceMgmtSaaS in pkg/controller/resourceconfig/static_config.go.

  • Added minimal and maximal E2E test fixtures, covering all CRD fields.

  • Recorded and verified golden logs and audit probes against real GCP project cnrm-barni-4 with 7/7 validation checks passing.

  • Updated mockgcp/mocksaasservicemgmt/normalize.go with normalizer rules for lastTransitionTime and randomized blueprintRepo suffix.

  • Updated tests/apichecks/testdata/exceptions/alpha-missingfields.txt.

  • Documented findings in .gemini/journals/saasservicemgmt.md.
  • Fixes #15384

    Workflow feedback


    In SaaSServiceMgmtSaaS, although proto comments state that locations is optional, real GCP enforces at creation time that at least one location must be provided (400 Bad Request: Need to specify at least one location for a SaaS). Minimal fixtures for resources with such API-level semantic validation must include the minimum required elements to succeed against real GCP.

    ``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-15384/recipe-fix-20261111-050220-8862)</sub>
    
    <!-- factory:task-output kind=Change task=recipe-fix-20261111-050220-8862 -->
    
    ---
    
    ### Greenfield: Implement MockGCP and Alignment for SaaSServiceMgmtSaaS
    
    Implements MockGCP support and golden HTTP log alignment for `SaaSServiceMgmtSaaS` under `saasservicemgmt.cnrm.cloud.google.com/v1alpha1` following Greenfield Step 3 (`kcc-direct-mockgcp-implementer/SKILL.md`):
    
    - Implemented CRUD and List handlers for SaaS in `mockgcp/mocksaasservicemgmt/saas.go`.
    - Modeled live GCP behavior: stripped OutputOnly / volatile fields from create/update responses, and simulated background provisioning of `blueprintRepo`, `state`, and `conditions` on update.
    - Added unit test suite in `mockgcp/mocksaasservicemgmt/saas_test.go` covering full lifecycle, parent validation, field mask updates, and list operations.
    - Added `SaaSServiceMgmtSaaS` to the supported GroupKind allowlist in `config/tests/samples/create/harness.go`.
    - Generated and verified mock HTTP logs (`_http_mock.log`) for both minimal and maximal fixtures with zero discrepancies against real GCP golden logs.
    - Documented learnings in `.gemini/journals/saasservicemgmt.md`.
    
    Fixes #15408
    
    
    release-note
    NONE
    
    This pull request was generated by an AI coding agent.
    
    <!-- factory:group-step issue=15408 -->
    
    ---
    
    ### Greenfield: Release SaaSServiceMgmtSaaS (remove it from BLOCKED_KINDS)
    
    Removes `SaaSServiceMgmtSaaS` 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/saasservicemgmt/v1alpha1/saasservicemgmtsaas/` (`saasservicemgmtsaas-minimal` and `saasservicemgmtsaas-maximal`) have been verified to have authentic real-GCP golden logs (`_http.log`), audit probe logs (`_audit_probe.log`), and mock golden logs (`_http_mock.log`).
    
    ### 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
    
    Fixes #15425
    
    
    release-note
    New Alpha Resources (Direct Reconciler):
    SaaSServiceMgmtSaaS
    ``

    This pull request was generated by an AI coding agent.

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

    Diff: 489 lines (+366 / -123) across 6 files Reviewer: lovelace-coder-bot Review duration: 830m
    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 · 489 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 #15389"
    general weight: 0.35
    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.4% (MEDIUM) · Higher = larger blast radius
    47.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: 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.7% · Safe to merge
    18.7%