← Back to Pull requests

Greenfield: Implement direct controller, E2E fixtures, and fuzzer for ObservabilityTraceScope #15832

Closed
unknown closed this pull request without merging on Nov 17, 2026 07:38 UTC
View on GitHub
unknown unknown commented on Nov 16, 2026 09:24 UTC
Author

This pull request was generated by an AI coding agent.

Implements the Greenfield direct controller, round-trip fuzzer, and E2E fixtures for ObservabilityTraceScope under observability.cnrm.cloud.google.com/v1alpha1 following Greenfield Step 2 (.gemini/skills/kcc-direct-controller-logic-greenfield-implementer/SKILL.md):

  • Generated deterministic direct controller and round-trip fuzzer for ObservabilityTraceScope using controllerbuilder generate-controller and generate-fuzzer with --prepopulate-resource.

  • Registered ObservabilityTraceScope in pkg/controller/direct/register/register.go and pkg/controller/resourceconfig/static_config.go.

  • Added cloud.google.com/go/observability dependency and synchronized mockgcp/go.mod.

  • Replaced temporary local pb stubs with the official GAPIC client library (cloud.google.com/go/observability/apiv1/observabilitypb), updating dev/tools/controllerbuilder/pkg/codegen/mappergenerator.go and regenerating mapper.generated.go.

  • Created minimal and maximal E2E fixtures under pkg/test/resourcefixture/testdata/basic/observability/v1alpha1/observabilitytracescope/.

  • Recorded authentic golden HTTP logs and audit probes (_http.log and _audit_probe.log) against real GCP project cnrm-barni-4 using RECORD_AUDIT_PROBE=1 ./hack/record-gcp. Both minimal and maximal fixtures passed all 7/7 lifecycle validation checks.

  • Updated tests/apichecks/testdata/exceptions/alpha-missingfields.txt as all Spec fields are now 100% covered.

  • Documented service learnings in .gemini/journals/observability.md.
  • Real GCP Verification Details


  • GCP Project: cnrm-barni-4

  • Fixtures Verified:

  • - observabilitytracescope-minimal: Created, validated, and deleted.
    - observabilitytracescope-maximal: Created, updated (in-place description change), validated, and deleted.

    Workflow feedback


    None. The generator tooling and record-gcp lifecycle harness ran cleanly without issues.

    ``release-note
    NONE

    
    Fixes #15813
    
    <sub>🤖 [Agent session](https://staging.repoagent.dev/#/overseers/kcc/task-session/fix-k8s-config-connector-15813/recipe-fix-20261116-071728-2dcb)</sub>
    
    <!-- factory:task-output kind=Change task=recipe-fix-20261116-071728-2dcb -->
    
    ---
    
    ### Greenfield: Implement MockGCP and Alignment for ObservabilityTraceScope
    
    Implements Phase 3 (MockGCP and Alignment) for `ObservabilityTraceScope` under `observability.cnrm.cloud.google.com/v1alpha1`.
    
    ### Changes Made
    - Created `mockobservability` service under `mockgcp/mockobservability/` implementing CRUD operations (`CreateTraceScope`, `GetTraceScope`, `UpdateTraceScope`, `DeleteTraceScope`, `ListTraceScopes`).
    - Added proto definition and generated gRPC-gateway reverse proxy for `google.cloud.observability.v1`.
    - Registered `mockobservability` in `mockgcp/register.go`.
    - Added scoped normalizer in `mockgcp/mockobservability/normalize.go` for `.createTime` and `.updateTime`.
    - Added comprehensive unit tests in `mockgcp/mockobservability/tracescope_test.go` covering full lifecycle, validation errors, and defensive copy immutability.
    - Updated `config/tests/samples/create/harness.go` to include `ObservabilityTraceScope` in supported MockGCP types.
    - Generated `_http_mock.log` files for `observabilitytracescope-minimal` and `observabilitytracescope-maximal` fixtures via `hack/compare-mock`.
    - Verified `TestGoldenLogAlignment` and `./dev/ci/presubmits/tests-e2e-fixtures-suite observability` pass cleanly with zero discrepancies.
    
    Fixes #15840
    
    
    release-note
    NONE
    
    This pull request was generated by an AI coding agent.
    
    <!-- factory:group-step issue=15840 -->
    
    ---
    
    ### chore: release `ObservabilityTraceScope`
    
    Release `ObservabilityTraceScope` (`observability.cnrm.cloud.google.com/v1alpha1`) by removing it 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/observability/v1alpha1/observabilitytracescope/` (`observabilitytracescope-minimal` and `observabilitytracescope-maximal`) have been verified to have authentic real-GCP golden logs (`_http.log`), audit probe logs (`_audit_probe.log`), HTTP lifecycle reports (`_http_report.md`), and mock golden logs (`_http_mock.log`). Both fixtures pass all mock and e2e checks cleanly.
    
    Fixes #15846
    
    
    release-note
    New Alpha Resources (Direct Reconciler):
    ObservabilityTraceScope
    `

    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.

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

    Diff: 601 lines (+450 / -151) across 7 files Reviewer: ada-coder-bot Review duration: 1334m
    All Vouch review confidence checks passed
    Residual risk 0.22 = Change Risk (0.55) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.55 · 601 lines diff across 7 files
    0.55
    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.383
    Shallow Review Depth shallow_review_depth
    0.289
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #15832"
    general weight: 0.35
    Reviewers
    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: 55.1% (MEDIUM) · Higher = larger blast radius
    55.1%
    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: 21.8% · Safe to merge
    21.8%