Skip to content

Greenfield: Implement direct controller, E2E fixtures, and fuzzer for VisionAIApplication - #13634

Open
hopper-coder-bot wants to merge 1 commit into
GoogleCloudPlatform:masterfrom
hopper-coder-bot:issue-13597-1790893878
Open

hopper-coder-bot wants to merge 1 commit into
GoogleCloudPlatform:masterfrom
hopper-coder-bot:issue-13597-1790893878

Conversation

@hopper-coder-bot

Copy link
Copy Markdown
Collaborator

Description

This PR implements the direct controller, E2E fixtures, and fuzzer for the greenfield resource VisionAIApplication (visionai.cnrm.cloud.google.com/v1alpha1).

Key Changes

  • Controller Implementation:
    • Implemented pkg/controller/direct/visionai/visionaiapplication_controller.go supporting Find, Create, Update, Delete, and Export operations using the GAPIC REST client (cloud.google.com/go/visionai/apiv1).
    • Added ParentString() helper on VisionAIApplicationIdentity with unit tests in apis/visionai/v1alpha1/visionaiapplication_identity_test.go.
    • Handled mutable-but-unreadable eventDeliveryConfig in compareVisionAIApplication using updateTime / observedGeneration matching.
  • Mappers & Fuzzer:
    • Added generate-mapper to apis/visionai/generate.sh and generated pkg/controller/direct/visionai/mapper.generated.go.
    • Implemented KRM typed fuzzer pkg/controller/direct/visionai/visionaiapplication_fuzzer.go covering all Spec and Status/ObservedState fields.
    • Enhanced direct.Struct_ToProto in pkg/controller/direct/maputils.go to handle empty JSON raw payloads gracefully.
  • Registration:
    • Registered visionai in pkg/controller/direct/register/register.go.
    • Registered VisionAIApplication in pkg/controller/resourceconfig/static_config.go.
  • E2E Fixtures & Golden Files:
    • Created minimal and maximal test fixtures under pkg/test/resourcefixture/testdata/basic/visionai/v1alpha1/visionaiapplication/.
    • Successfully recorded and verified E2E golden files against real GCP using RECORD_AUDIT_PROBE=1 ./hack/record-gcp in project cnrm-barni-4.
    • Updated tests/apichecks/testdata/exceptions/alpha-missingfields.txt.

Fixes #13597

NONE

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

@hopper-coder-bot hopper-coder-bot added overseer greenfield Indicates implementation of a new resource (vs migration) step/controller overseer/review labels Oct 2, 2026
@hopper-coder-bot

Copy link
Copy Markdown
Collaborator Author

GCP Audit Logs Verification

The following audit log entries verify that the direct controller for VisionAIApplication successfully actuated and interacted with the live GCP endpoints:

[
  {
    "logName": "projects/cnrm-barni-4/logs/cloudaudit.googleapis.com%2Factivity",
    "methodName": "google.cloud.visionai.v1.AppPlatform.CreateApplication",
    "resourceName": "projects/cnrm-barni-4/locations/us-central1/applications/visionaiapplication-minimal-atokyeqpfl5cbdi",
    "serviceName": "visionai.googleapis.com",
    "timestamp": "2026-10-01T23:38:33Z"
  },
  {
    "logName": "projects/cnrm-barni-4/logs/cloudaudit.googleapis.com%2Factivity",
    "methodName": "google.cloud.visionai.v1.AppPlatform.UpdateApplication",
    "resourceName": "projects/cnrm-barni-4/locations/us-central1/applications/visionaiapplication-minimal-atokyeqpfl5cbdi",
    "serviceName": "visionai.googleapis.com",
    "timestamp": "2026-10-01T23:38:34Z"
  },
  {
    "logName": "projects/cnrm-barni-4/logs/cloudaudit.googleapis.com%2Factivity",
    "methodName": "google.cloud.visionai.v1.AppPlatform.DeleteApplication",
    "resourceName": "projects/cnrm-barni-4/locations/us-central1/applications/visionaiapplication-minimal-atokyeqpfl5cbdi",
    "serviceName": "visionai.googleapis.com",
    "timestamp": "2026-10-01T23:38:37Z"
  }
]
@google-oss-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign barney-s for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@argus-watcher-bot

Copy link
Copy Markdown
Collaborator

🤖 AI Factory started investigating CI check failures for this pull request.

Note: We recommend waiting for the 'ready-for-human' label before leaving review comments. Comments added while the system is actively working may be associated with outdated commits once a new commit is pushed, causing them to be ignored.

@hopper-coder-bot

Copy link
Copy Markdown
Collaborator Author

Investigating validate-ensure failure

Run: 36950806733
Name: validate-ensure
Cause: Code Error
Details: The validate-ensure presubmit runs make ensure (go mod tidy -compat=1.26.0), which detected that cloud.google.com/go/visionai v1.3.0 was tagged as indirect in go.mod despite being directly imported by the new VisionAIApplication direct controller. Running make ensure promoted cloud.google.com/go/visionai to a direct dependency in go.mod.
Action Taken: Ran make ensure locally, updated go.mod, amended the commit, and pushed the updated branch.

(This report was generated by overseer)

@argus-watcher-bot

Copy link
Copy Markdown
Collaborator

🤖 AI Factory started investigating CI check failures for this pull request.

Note: We recommend waiting for the 'ready-for-human' label before leaving review comments. Comments added while the system is actively working may be associated with outdated commits once a new commit is pushed, causing them to be ignored.

@hopper-coder-bot

Copy link
Copy Markdown
Collaborator Author

Investigating unit-tests-1-of-4 failure

Run: 36956229857
Name: unit-tests-1-of-4
Cause: Test Failure
Details: TestRegisteredTemplatesMatchCAI in pkg/gcpurls failed because the registered URL template for VisionAI (//visionai.googleapis.com/projects/{project}/locations/{location}/applications/{application}) was not present in the Cloud Asset Inventory metadata file (cloudassetinventory_names.jsonl) and was missing from the ignoredTemplates allowlist in pkg/gcpurls/registry_test.go.
Action Taken: Added //visionai.googleapis.com/projects/{}/locations/{}/applications/{} to ignoredTemplates in pkg/gcpurls/registry_test.go, verified pkg/gcpurls and unit tests shard 1 pass, amended the commit, and pushed the updated branch.

Investigating tests-e2e-direct-iam failure

Run: 36956229857
Name: tests-e2e-direct-iam
Cause: Flake
Details: The test fixture awsworkloadidentitypoolprovider failed due to a race condition during parallel envtest setup (setup-envtest: line 39: .../envtest-bin/etcd: Text file busy). This is an infrastructure flake unrelated to the changes in this PR.
Action Taken: None directly on the test; pushing the updated branch triggers a clean CI rerun for all presubmits.

(This report was generated by overseer)

@argus-watcher-bot

Copy link
Copy Markdown
Collaborator

🤖 AI Factory started investigating CI check failures for this pull request.

Note: We recommend waiting for the 'ready-for-human' label before leaving review comments. Comments added while the system is actively working may be associated with outdated commits once a new commit is pushed, causing them to be ignored.

@hopper-coder-bot

Copy link
Copy Markdown
Collaborator Author

Investigating tests-e2e-fixtures-gkehub failure

Run: 36962944141
Name: tests-e2e-fixtures-gkehub
Cause: Flake
Details: The test fixture gkehubfleet-minimal failed due to a race condition during parallel envtest setup (harness.go:279: error starting test environment: unable to start control plane itself: failed to start the controlplane. retried 5 times: fork/exec .../envtest-bin/etcd: text file busy). This is an infrastructure flake unrelated to the changes in this PR.
Action Taken: Triggered a rerun of the failed jobs via gh run rerun 36962944141 --failed.

(This report was generated by overseer)

@argus-watcher-bot

Copy link
Copy Markdown
Collaborator

🤖 AI Factory started reviewing this pull request in a sandbox.

@reviewbot-robot reviewbot-robot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

KCC Auto-Review Results

  • Trigger criteria matched: Yes
  • Client Creation: Pass
  • Default Reconciler Kept: Pass
  • Proto Diffs & Update Mask: Pass
  • Structured Reporting: Pass
  • KRM Status Updates: Pass
  • LRO Wait: Pass
  • Test Coverage: Pass

Detailed Findings / Actions Required:

None. The Greenfield direct controller implementation, type fuzzer, and minimal/maximal test fixtures follow all Config Connector standards and guidelines.

@argus-watcher-bot

Copy link
Copy Markdown
Collaborator

🤖 AI Factory started addressing review feedback for this pull request.

@hopper-coder-bot

Copy link
Copy Markdown
Collaborator Author

All automated review checks from reviewbot-robot have passed with no findings or actions required. All CI presubmit workflows have completed successfully on the latest commit.

(This comment was generated by overseer)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

greenfield Indicates implementation of a new resource (vs migration) overseer/ready-for-human overseer step/controller

3 participants