Greenfield: Implement direct controller, E2E fixtures, and fuzzer for NetworkConnectivityTransport - #13440
Greenfield: Implement direct controller, E2E fixtures, and fuzzer for NetworkConnectivityTransport#13440ada-coder-bot wants to merge 1 commit into
Conversation
Real GCP Audit Log VerificationBelow are the Google Cloud audit log entries demonstrating successful actuation against real GCP ( - methodName: google.cloud.networkconnectivity.v1.TransportManager.CreateTransport
resourceName: projects/cnrm-barni-4/locations/us-east4/transports/transport-sypdzm72b2y7bii
serviceName: networkconnectivity.googleapis.com
timestamp: '2026-09-25T01:27:00.932982062Z'
status: {}
- methodName: google.cloud.networkconnectivity.v1.TransportManager.UpdateTransport
resourceName: projects/cnrm-barni-4/locations/us-east4/transports/transport-sypdzm72b2y7bii
serviceName: networkconnectivity.googleapis.com
timestamp: '2026-09-25T01:29:07.166132570Z'
status: {}
- methodName: google.cloud.networkconnectivity.v1.TransportManager.DeleteTransport
resourceName: projects/cnrm-barni-4/locations/us-east4/transports/transport-sypdzm72b2y7bii
serviceName: networkconnectivity.googleapis.com
timestamp: '2026-09-25T01:31:17.879232104Z'
status: {} |
|
🤖 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. |
952c576 to
cd5ba96
Compare
Investigating tests-e2e-fixtures-networkconnectivity failureRun: 36084056374 (This report was generated by overseer) |
|
🤖 AI Factory started reviewing this pull request in a sandbox. |
reviewbot-robot
left a comment
There was a problem hiding this comment.
KCC Auto-Review Results
- Trigger criteria matched: Yes
- Client Creation: Pass - Uses the official REST client (
google.golang.org/api/networkconnectivity/v1). - Default Reconciler Kept: Pass - Registered as a new greenfield direct controller in
pkg/controller/resourceconfig/static_config.go. - Proto Diffs & Update Mask: Pass - Uses
common.DiffForTopLevelFieldsto calculate diffs and populate theUpdateMask. - Structured Reporting: Pass - Invokes
structuredreporting.ReportDiff(ctx, diffs)prior to executing the patch request. - KRM Status Updates: Pass -
updateStatusis executed onCreateandUpdate(including no-op update reconciliations). - LRO Wait: Pass - Waits for asynchronous LRO completion across
Create,Update, andDeleteoperations. - Test Coverage: Pass - Includes minimal and maximal test fixtures with recorded real GCP golden outputs and normalized volatile fields.
Detailed Findings / Actions Required:
None. The implementation satisfies all greenfield direct controller requirements.
|
🤖 AI Factory started addressing review feedback for this pull request. |
| return true, nil | ||
| } | ||
|
|
||
| func (a *transportAdapter) waitForOperation(ctx context.Context, op *api.GoogleLongrunningOperation) error { |
There was a problem hiding this comment.
I think there may a shared waitForLRO function in the repo you can use, please check if not, it's fine to keep this as is.
There was a problem hiding this comment.
Updated waitForOperation to use the shared common.WaitForOperation helper function from pkg/controller/direct/common.
(This comment was generated by overseer)
| return op.UpdateStatus(ctx, status, nil) | ||
| } | ||
|
|
||
| func compareTransport(ctx context.Context, actual, desired *pb.Transport) (*structuredreporting.Diff, *fieldmaskpb.FieldMask, error) { |
There was a problem hiding this comment.
Put this function directly after it's usage
There was a problem hiding this comment.
Moved compareTransport directly below its caller (Update).
(This comment was generated by overseer)
| external: projects/${projectId}/global/networks/default | ||
| remoteProfileRef: | ||
| external: projects/${projectId}/locations/us-east4/remoteTransportProfiles/aws-us-east-1 | ||
| bandwidth: BPS_1G |
There was a problem hiding this comment.
Can we update the bandwidth type so as to exercise update for the minimal test?
There was a problem hiding this comment.
We verified updating bandwidth against real GCP (cnrm-barni-4), but GCP rejected the request with:
googleapi: Error 400: Invalid resource state for "": bandwidth can only be updated for ACTIVE transports
When a Transport is first created in GCP, its state is PENDING_KEY until the partner-side interconnect is provisioned, so GCP does not allow updating bandwidth in this state.
Furthermore, per repository conventions, -minimal fixtures strictly validate creation and deletion of the minimal required configuration (none of the -minimal test suites in the repo define an update.yaml). Resource updates (including mutations to description and labels) are tested and verified in the maximal test fixture (networkconnectivitytransport-maximal).
(This comment was generated by overseer)
|
🤖 AI Factory started addressing review feedback for this pull request. |
|
Address open comments |
|
🤖 AI Factory started addressing review feedback for this pull request. |
cd5ba96 to
965b2b6
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Summary of Changes Addressing Review Feedback
(This comment was generated by overseer) |
|
|
||
| clonedDesired := proto.Clone(desired).(*pb.Transport) | ||
|
|
||
| populateDefaults := func(obj *pb.Transport) { |
There was a problem hiding this comment.
We generally want defaults to be returned from the API, in fact I see this being returned in http.log. We generally don't want to process these values or have this kind of business logic for them.
Do we really need this processing here? If this field is not set in the CRD we should not try to update it and the field mask would not contain the value. If the field is set to emtpy ("") in the CRD then we should add it to the mask and try to update to an empty value.
FYI that this may not be the actual behavior in diffForTopLevelFields and other mechanisms. So please cross check the existing behavior to evaluate my ask. LET'S FIRST DISCUSS my recommendation and see if it makes sense before implementing.
|
🤖 AI Factory started addressing review feedback for this pull request. |
… NetworkConnectivityTransport Implement the direct controller, KRM fuzzer, and E2E fixtures for NetworkConnectivityTransport (v1alpha1). Issue: 13433
965b2b6 to
37f7c11
Compare
Addressing Review Feedback on Defaults HandlingYou are completely right that hardcoding default values and custom business logic in the controller is undesirable, and server-side defaults returned by the GCP API should be handled cleanly. Analysis of
|
This Pull Request implements the direct controller, KRM fuzzer, and E2E fixtures for
NetworkConnectivityTransport(v1alpha1).Key Changes
pkg/controller/direct/networkconnectivity/networkconnectivitytransport_controller.goto handle CRUD operations and status reconciliation.NetworkConnectivityTransportas a direct controller inpkg/controller/resourceconfig/static_config.go.pkg/controller/direct/networkconnectivity/networkconnectivitytransport_fuzzer.go.pkg/test/resourcefixture/testdata/basic/networkconnectivity/v1alpha1/networkconnectivitytransport/._http.log,_generated_object...,_audit_probe.log,_identities.yaml) were successfully recorded against real GCP usinghack/record-gcpon projectcnrm-barni-4.tests/apichecks/testdata/exceptions/alpha-missingfields.txtasNetworkConnectivityTransportnow has full field test coverage.generatedActivationKeyandpeeringNetworkinmockgcp/mocknetworkconnectivity/normalize.goandtests/e2e/normalize.go.Fixes #13433
This PR was generated by the overseer,greenfield,step/controller,overseer/review agent (powered by the gemini-3.7-flash model).