CNTRLPLANE-3610: Decouple CAPI provider Go module dependencies - #8704
CNTRLPLANE-3610: Decouple CAPI provider Go module dependencies#8704csrwng wants to merge 1 commit into
Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
@csrwng: This pull request references CNTRLPLANE-3610 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
Skipping CI for Draft Pull Request. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThis PR adds a stamp-file based CAPI sync workflow and tooling: a Go copier (hack/copy-capi-types) with tests, a provider sync script (hack/capi-sync-provider.sh), per-provider vendored module manifests under hack/capi-vendor/, Makefile targets to run/verify capi-sync and to generate CRDs from workspace modules, go.mod replace mappings to local pkg/capi modules, .gitignore and golangci settings updates, and a large set of new/updated Cluster API provider API type files under pkg/capi/* (AWS, Azure, Agent, GCP, IBMCloud, KubeVirt, OpenStack) plus related go.mod files. Sequence DiagramsequenceDiagram
participant DevMake as Makefile/update
participant SyncScript as hack/capi-sync-provider.sh
participant Copier as hack/copy-capi-types
participant Vendor as hack/capi-vendor/*
participant PkgCAPI as pkg/capi/*
participant ControllerGen as controller-gen
DevMake->>SyncScript: invoke capi-sync per provider
SyncScript->>Vendor: download upstream module (go mod download)
SyncScript->>Copier: run copier (--src upstream --dst pkg/capi/<provider>)
Copier->>PkgCAPI: write copied/stripped Go files
SyncScript->>ControllerGen: run controller-gen with workspace paths
ControllerGen->>PkgCAPI: generate CRDs
DevMake->>DevMake: touch ./pkg/capi/<provider>/.synced (stamp)
Suggested reviewers
✨ Finishing Touches🧪 Generate unit tests (beta)
|
|
/pipeline required |
|
Scheduling tests matching the |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: csrwng The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@hack/capi-vendor/openstack/go.mod`:
- Around line 5-55: Add the OSV query result for the newly pinned direct
dependency sigs.k8s.io/cluster-api-provider-openstack v0.13.3 to the PR notes:
run an osv.dev query (or use `govulncheck`/OSV API) for module
"sigs.k8s.io/cluster-api-provider-openstack" at version "v0.13.3", capture the
JSON response (which returned an empty object {}), and paste that output into
the PR description or changelog entry so the absence of vulnerabilities is
documented alongside the go.mod change.
In `@hack/copy-capi-types/main.go`:
- Around line 167-227: The cascade loop correctly gathers all functions to
remove into funcRemoveSet but stripDecls is still called with the original
crossFileRemove slice, so newly discovered removals are never stripped; change
the final call to stripDecls to pass the fully-expanded removal set by
converting funcRemoveSet into a slice of *ast.FuncDecl (and/or build a new
removal slice variable) and use that in place of crossFileRemove when calling
stripDecls; keep existing crossNames usage for the reason field.
In `@Makefile`:
- Around line 560-565: The .synced target only depends on
hack/capi-vendor/%/go.mod and CONTROLLER_GEN, so update the rule for
$(DIR)/pkg/capi/%/.synced to also depend on the sync script and any copy/vendor
helper inputs that affect generated output (e.g.
$(DIR)/hack/capi-sync-provider.sh and
$(DIR)/hack/capi-vendor/%/vendor_imports.go and/or the copy tool binary variable
used during sync). In practice add those filenames/variables to the prerequisite
list for the $(DIR)/pkg/capi/%/.synced target so changes to
hack/capi-sync-provider.sh, vendor_imports.go, or the copy tool will invalidate
the .synced stamp and force re-running the cd/tidy/sync sequence.
In `@pkg/capi/azure/api/v1beta1/azureasomanagedmachinepooltemplate_types.go`:
- Around line 24-32: The Template field in
AzureASOManagedMachinePoolTemplateSpec is using the wrong resource type
(AzureASOManagedControlPlaneResource) causing machine-pool fields like
providerIDList to be omitted; update the Template field's type to
AzureASOManagedMachinePoolResource (i.e., change the struct field Template
AzureASOManagedControlPlaneResource to Template
AzureASOManagedMachinePoolResource) so the CRD uses the machine-pool schema, and
run codegen/CRD generation to regenerate manifests after the change.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: 74050ac9-95dd-4433-a9ec-ccf6efc47fa4
⛔ Files ignored due to path filters (128)
go.sumis excluded by!**/*.sumhack/capi-vendor/agent/go.sumis excluded by!**/*.sumhack/capi-vendor/aws/go.sumis excluded by!**/*.sumhack/capi-vendor/azure/go.sumis excluded by!**/*.sumhack/capi-vendor/gcp/go.sumis excluded by!**/*.sumhack/capi-vendor/ibmcloud/go.sumis excluded by!**/*.sumhack/capi-vendor/kubevirt/go.sumis excluded by!**/*.sumhack/capi-vendor/openstack/go.sumis excluded by!**/*.sumhack/workspace/go.workis excluded by!**/*.workpkg/capi/agent/v1alpha1/zz_generated.deepcopy.gois excluded by!**/zz_generated*.go,!**/zz_generated*pkg/capi/agent/v1beta1/zz_generated.deepcopy.gois excluded by!**/zz_generated*.go,!**/zz_generated*pkg/capi/aws/api/v1beta1/zz_generated.deepcopy.gois excluded by!**/zz_generated*.go,!**/zz_generated*pkg/capi/aws/api/v1beta2/zz_generated.deepcopy.gois excluded by!**/zz_generated*.go,!**/zz_generated*pkg/capi/aws/exp/api/v1beta1/zz_generated.deepcopy.gois excluded by!**/zz_generated*.go,!**/zz_generated*pkg/capi/aws/exp/api/v1beta2/zz_generated.deepcopy.gois excluded by!**/zz_generated*.go,!**/zz_generated*pkg/capi/azure/api/v1beta1/zz_generated.deepcopy.gois excluded by!**/zz_generated*.go,!**/zz_generated*pkg/capi/gcp/api/v1beta1/zz_generated.deepcopy.gois excluded by!**/zz_generated*.go,!**/zz_generated*pkg/capi/ibmcloud/api/v1beta1/zz_generated.deepcopy.gois excluded by!**/zz_generated*.go,!**/zz_generated*pkg/capi/ibmcloud/api/v1beta2/zz_generated.deepcopy.gois excluded by!**/zz_generated*.go,!**/zz_generated*pkg/capi/kubevirt/api/v1alpha1/zz_generated.deepcopy.gois excluded by!**/zz_generated*.go,!**/zz_generated*pkg/capi/openstack/api/v1alpha1/zz_generated.deepcopy.gois excluded by!**/zz_generated*.go,!**/zz_generated*pkg/capi/openstack/api/v1beta1/zz_generated.deepcopy.gois excluded by!**/zz_generated*.go,!**/zz_generated*vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/CHANGELOG.mdis excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/LICENSE.txtis excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/README.mdis excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/assets.jsonis excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/autorest.mdis excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/availabilitysets_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/build.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/capacityreservationgroups_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/capacityreservations_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/ci.ymlis excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/client_factory.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudserviceoperatingsystems_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudserviceroleinstances_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudserviceroles_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudservices_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudservicesupdatedomain_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/communitygalleries_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/communitygalleryimages_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/communitygalleryimageversions_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/constants.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/dedicatedhostgroups_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/dedicatedhosts_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/diskaccesses_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/diskencryptionsets_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/diskrestorepoint_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/disks_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleries_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleryapplications_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleryapplicationversions_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleryimages_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleryimageversions_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/gallerysharingprofile_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/images_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/loganalytics_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/models.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/models_serde.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/operations_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/options.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/proximityplacementgroups_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/resourceskus_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/responses.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/restorepointcollections_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/restorepoints_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/sharedgalleries_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/sharedgalleryimages_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/sharedgalleryimageversions_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/snapshots_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/sshpublickeys_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/time_rfc3339.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/usage_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineextensionimages_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineextensions_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineimages_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineimagesedgezone_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineruncommands_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachines_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetextensions_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetrollingupgrades_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesets_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetvmextensions_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetvmruncommands_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetvms_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinesizes_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/asaskevich/govalidator/v11/.gitignoreis excluded by!vendor/**,!**/vendor/**vendor/github.com/asaskevich/govalidator/v11/.travis.ymlis excluded by!vendor/**,!**/vendor/**vendor/github.com/asaskevich/govalidator/v11/CODE_OF_CONDUCT.mdis excluded by!vendor/**,!**/vendor/**vendor/github.com/asaskevich/govalidator/v11/CONTRIBUTING.mdis excluded by!vendor/**,!**/vendor/**vendor/github.com/asaskevich/govalidator/v11/LICENSEis excluded by!vendor/**,!**/vendor/**vendor/github.com/asaskevich/govalidator/v11/README.mdis excluded by!vendor/**,!**/vendor/**vendor/github.com/asaskevich/govalidator/v11/arrays.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/asaskevich/govalidator/v11/converter.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/asaskevich/govalidator/v11/doc.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/asaskevich/govalidator/v11/error.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/asaskevich/govalidator/v11/numerics.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/asaskevich/govalidator/v11/patterns.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/asaskevich/govalidator/v11/types.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/asaskevich/govalidator/v11/utils.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/asaskevich/govalidator/v11/validator.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/asaskevich/govalidator/v11/wercker.ymlis excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/CHANGELOG.mdis excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/LICENSE.txtis excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_AssociateAccessPolicy.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_AssociateEncryptionConfig.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_AssociateIdentityProviderConfig.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreateAccessEntry.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreateAddon.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreateCapability.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreateCluster.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreateEksAnywhereSubscription.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreateFargateProfile.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreateNodegroup.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreatePodIdentityAssociation.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeleteAccessEntry.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeleteAddon.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeleteCapability.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeleteCluster.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeleteEksAnywhereSubscription.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeleteFargateProfile.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeleteNodegroup.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeletePodIdentityAssociation.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeregisterCluster.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeAccessEntry.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeAddon.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeAddonConfiguration.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeAddonVersions.gois excluded by!vendor/**,!**/vendor/**
📒 Files selected for processing (172)
.gitignore.golangci.ymlMakefilego.modhack/capi-sync-provider.shhack/capi-vendor/agent/go.modhack/capi-vendor/agent/vendor_imports.gohack/capi-vendor/aws/go.modhack/capi-vendor/aws/vendor_imports.gohack/capi-vendor/azure/go.modhack/capi-vendor/azure/vendor_imports.gohack/capi-vendor/gcp/go.modhack/capi-vendor/gcp/vendor_imports.gohack/capi-vendor/ibmcloud/go.modhack/capi-vendor/ibmcloud/vendor_imports.gohack/capi-vendor/kubevirt/go.modhack/capi-vendor/kubevirt/vendor_imports.gohack/capi-vendor/openstack/go.modhack/capi-vendor/openstack/vendor_imports.gohack/copy-capi-types/main.gopkg/capi/agent/go.modpkg/capi/agent/v1alpha1/agentcluster_types.gopkg/capi/agent/v1alpha1/agentmachine_types.gopkg/capi/agent/v1alpha1/agentmachinetemplate_types.gopkg/capi/agent/v1alpha1/groupversion_info.gopkg/capi/agent/v1alpha1/types.gopkg/capi/agent/v1beta1/agentcluster_types.gopkg/capi/agent/v1beta1/agentmachine_types.gopkg/capi/agent/v1beta1/agentmachinetemplate_types.gopkg/capi/agent/v1beta1/groupversion_info.gopkg/capi/agent/v1beta1/types.gopkg/capi/aws/api/v1beta1/awscluster_types.gopkg/capi/aws/api/v1beta1/awsclustertemplate_types.gopkg/capi/aws/api/v1beta1/awsidentity_types.gopkg/capi/aws/api/v1beta1/awsmachine_types.gopkg/capi/aws/api/v1beta1/awsmachinetemplate_types.gopkg/capi/aws/api/v1beta1/bastion.gopkg/capi/aws/api/v1beta1/conditions_consts.gopkg/capi/aws/api/v1beta1/doc.gopkg/capi/aws/api/v1beta1/groupversion_info.gopkg/capi/aws/api/v1beta1/network_types.gopkg/capi/aws/api/v1beta1/s3bucket.gopkg/capi/aws/api/v1beta1/tags.gopkg/capi/aws/api/v1beta1/types.gopkg/capi/aws/api/v1beta2/awscluster_types.gopkg/capi/aws/api/v1beta2/awsclustertemplate_types.gopkg/capi/aws/api/v1beta2/awsidentity_types.gopkg/capi/aws/api/v1beta2/awsmachine_types.gopkg/capi/aws/api/v1beta2/awsmachinetemplate_types.gopkg/capi/aws/api/v1beta2/bastion.gopkg/capi/aws/api/v1beta2/conditions_consts.gopkg/capi/aws/api/v1beta2/defaults.gopkg/capi/aws/api/v1beta2/doc.gopkg/capi/aws/api/v1beta2/groupversion_info.gopkg/capi/aws/api/v1beta2/network_types.gopkg/capi/aws/api/v1beta2/s3bucket.gopkg/capi/aws/api/v1beta2/tags.gopkg/capi/aws/api/v1beta2/types.gopkg/capi/aws/api/v1beta2/webhooks.gopkg/capi/aws/exp/api/v1beta1/awsmachinepool_types.gopkg/capi/aws/exp/api/v1beta1/conditions_consts.gopkg/capi/aws/exp/api/v1beta1/doc.gopkg/capi/aws/exp/api/v1beta1/finalizers.gopkg/capi/aws/exp/api/v1beta1/groupversion_info.gopkg/capi/aws/exp/api/v1beta1/types.gopkg/capi/aws/exp/api/v1beta2/awsmachinepool_types.gopkg/capi/aws/exp/api/v1beta2/conditions_consts.gopkg/capi/aws/exp/api/v1beta2/doc.gopkg/capi/aws/exp/api/v1beta2/finalizers.gopkg/capi/aws/exp/api/v1beta2/groupversion_info.gopkg/capi/aws/exp/api/v1beta2/types.gopkg/capi/aws/exp/api/v1beta2/validation.gopkg/capi/aws/go.modpkg/capi/azure/api/v1beta1/azureasomanagedcluster_types.gopkg/capi/azure/api/v1beta1/azureasomanagedclustertemplate_types.gopkg/capi/azure/api/v1beta1/azureasomanagedcontrolplane_types.gopkg/capi/azure/api/v1beta1/azureasomanagedcontrolplanetemplate_types.gopkg/capi/azure/api/v1beta1/azureasomanagedmachinepool_types.gopkg/capi/azure/api/v1beta1/azureasomanagedmachinepooltemplate_types.gopkg/capi/azure/api/v1beta1/azurecluster_default.gopkg/capi/azure/api/v1beta1/azurecluster_types.gopkg/capi/azure/api/v1beta1/azurecluster_validation.gopkg/capi/azure/api/v1beta1/azureclusteridentity_types.gopkg/capi/azure/api/v1beta1/azureclustertemplate_default.gopkg/capi/azure/api/v1beta1/azureclustertemplate_types.gopkg/capi/azure/api/v1beta1/azureclustertemplate_validation.gopkg/capi/azure/api/v1beta1/azureimage_validation.gopkg/capi/azure/api/v1beta1/azuremachine_default.gopkg/capi/azure/api/v1beta1/azuremachine_types.gopkg/capi/azure/api/v1beta1/azuremachine_validation.gopkg/capi/azure/api/v1beta1/azuremachinetemplate_types.gopkg/capi/azure/api/v1beta1/azuremanagedcluster_types.gopkg/capi/azure/api/v1beta1/azuremanagedclustertemplate_types.gopkg/capi/azure/api/v1beta1/azuremanagedcontrolplane_default.gopkg/capi/azure/api/v1beta1/azuremanagedcontrolplane_types.gopkg/capi/azure/api/v1beta1/azuremanagedcontrolplanetemplate_default.gopkg/capi/azure/api/v1beta1/azuremanagedcontrolplanetemplate_types.gopkg/capi/azure/api/v1beta1/azuremanagedmachinepool_types.gopkg/capi/azure/api/v1beta1/azuremanagedmachinepooltemplate_types.gopkg/capi/azure/api/v1beta1/consts.gopkg/capi/azure/api/v1beta1/doc.gopkg/capi/azure/api/v1beta1/groupversion_info.gopkg/capi/azure/api/v1beta1/tags.gopkg/capi/azure/api/v1beta1/types.gopkg/capi/azure/api/v1beta1/types_class.gopkg/capi/azure/api/v1beta1/types_template.gopkg/capi/azure/go.modpkg/capi/gcp/api/v1beta1/doc.gopkg/capi/gcp/api/v1beta1/endpoints.gopkg/capi/gcp/api/v1beta1/gcpcluster_types.gopkg/capi/gcp/api/v1beta1/gcpclustertemplate_types.gopkg/capi/gcp/api/v1beta1/gcpmachine_types.gopkg/capi/gcp/api/v1beta1/gcpmachinetemplate_types.gopkg/capi/gcp/api/v1beta1/groupversion_info.gopkg/capi/gcp/api/v1beta1/labels.gopkg/capi/gcp/api/v1beta1/tags.gopkg/capi/gcp/api/v1beta1/types.gopkg/capi/gcp/go.modpkg/capi/ibmcloud/api/v1beta1/conditions_consts.gopkg/capi/ibmcloud/api/v1beta1/doc.gopkg/capi/ibmcloud/api/v1beta1/groupversion_info.gopkg/capi/ibmcloud/api/v1beta1/ibmpowervscluster_types.gopkg/capi/ibmcloud/api/v1beta1/ibmpowervsclustertemplate_types.gopkg/capi/ibmcloud/api/v1beta1/ibmpowervsimage_types.gopkg/capi/ibmcloud/api/v1beta1/ibmpowervsmachine_types.gopkg/capi/ibmcloud/api/v1beta1/ibmpowervsmachinetemplate_types.gopkg/capi/ibmcloud/api/v1beta1/ibmvpccluster_types.gopkg/capi/ibmcloud/api/v1beta1/ibmvpcmachine_types.gopkg/capi/ibmcloud/api/v1beta1/ibmvpcmachinetemplate_types.gopkg/capi/ibmcloud/api/v1beta1/types.gopkg/capi/ibmcloud/api/v1beta2/conditions_consts.gopkg/capi/ibmcloud/api/v1beta2/doc.gopkg/capi/ibmcloud/api/v1beta2/groupversion_info.gopkg/capi/ibmcloud/api/v1beta2/ibmpowervscluster_types.gopkg/capi/ibmcloud/api/v1beta2/ibmpowervsclustertemplate_types.gopkg/capi/ibmcloud/api/v1beta2/ibmpowervsimage_types.gopkg/capi/ibmcloud/api/v1beta2/ibmpowervsmachine_types.gopkg/capi/ibmcloud/api/v1beta2/ibmpowervsmachinetemplate_types.gopkg/capi/ibmcloud/api/v1beta2/ibmvpccluster_types.gopkg/capi/ibmcloud/api/v1beta2/ibmvpcclustertemplate_types.gopkg/capi/ibmcloud/api/v1beta2/ibmvpcmachine_types.gopkg/capi/ibmcloud/api/v1beta2/ibmvpcmachinetemplate_types.gopkg/capi/ibmcloud/api/v1beta2/types.gopkg/capi/ibmcloud/go.modpkg/capi/kubevirt/api/v1alpha1/condition_consts.gopkg/capi/kubevirt/api/v1alpha1/doc.gopkg/capi/kubevirt/api/v1alpha1/groupversion_info.gopkg/capi/kubevirt/api/v1alpha1/kubevirtcluster_types.gopkg/capi/kubevirt/api/v1alpha1/kubevirtclustertemplate_types.gopkg/capi/kubevirt/api/v1alpha1/kubevirtmachine_types.gopkg/capi/kubevirt/api/v1alpha1/kubevirtmachinetemplate_types.gopkg/capi/kubevirt/go.modpkg/capi/openstack/api/v1alpha1/conditions_consts.gopkg/capi/openstack/api/v1alpha1/doc.gopkg/capi/openstack/api/v1alpha1/groupversion_info.gopkg/capi/openstack/api/v1alpha1/openstackfloatingippool_types.gopkg/capi/openstack/api/v1alpha1/openstackserver_types.gopkg/capi/openstack/api/v1alpha1/types.gopkg/capi/openstack/api/v1beta1/conditions_consts.gopkg/capi/openstack/api/v1beta1/doc.gopkg/capi/openstack/api/v1beta1/groupversion_info.gopkg/capi/openstack/api/v1beta1/identity_types.gopkg/capi/openstack/api/v1beta1/openstackcluster_types.gopkg/capi/openstack/api/v1beta1/openstackclustertemplate_types.gopkg/capi/openstack/api/v1beta1/openstackmachine_types.gopkg/capi/openstack/api/v1beta1/openstackmachinetemplate_types.gopkg/capi/openstack/api/v1beta1/types.gopkg/capi/openstack/go.modpkg/capi/openstack/pkg/utils/errors/errors.gopkg/capi/openstack/pkg/utils/errors/terminal.gopkg/capi/openstack/pkg/utils/optional/types.gosupport/api/capi_types.go
💤 Files with no reviewable changes (2)
- pkg/capi/aws/api/v1beta1/tags.go
- pkg/capi/aws/api/v1beta1/network_types.go
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8704 +/- ##
=======================================
Coverage 43.28% 43.28%
=======================================
Files 771 771
Lines 95503 95503
=======================================
Hits 41335 41335
Misses 51284 51284
Partials 2884 2884
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
/pipeline required |
|
Scheduling tests matching the |
bryan-cox
left a comment
There was a problem hiding this comment.
Overall this is excellent work — decoupling K8s bumps from CAPI provider releases is a significant operational improvement.
Two items I'd like addressed before merge (the GenDecl cascade gap in Pass 2 and broadening callsAny); the rest are suggestions and nits.
No tests for the 750-line AST tool is a concern I'd like discussed — even a small TestProcessFile with testdata/ fixtures would dramatically reduce regression risk.
AI Test Failure AnalysisJob: Generated by hypershift-analyze-e2e-failure post-step using Claude claude-opus-4-6 |
Test Resultse2e-aws
e2e-aks
|
AI Test Failure AnalysisJob: Generated by hypershift-analyze-e2e-failure post-step using Claude claude-opus-4-6 |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
hack/copy-capi-types/main.go (1)
494-513:⚠️ Potential issue | 🟠 MajorInclude receiver/parameter/result types in
referencesAnyfor cascade stripping
referencesAnyonly inspectsfn.Body, so cascade stripping can miss stripped symbols referenced solely infn.Recv, parameter types, or result types, leaving invalid generated code.Suggested fix
func referencesAny(fn *ast.FuncDecl, symbols map[string]bool) bool { - if fn.Body == nil { - return false - } - found := false - ast.Inspect(fn.Body, func(n ast.Node) bool { - if found { - return false - } - ident, ok := n.(*ast.Ident) - if ok && symbols[ident.Name] { - found = true - } - return true - }) - return found + check := func(n ast.Node) bool { + found := false + ast.Inspect(n, func(node ast.Node) bool { + if found { + return false + } + ident, ok := node.(*ast.Ident) + if ok && symbols[ident.Name] { + found = true + } + return true + }) + return found + } + + if fn.Recv != nil { + for _, f := range fn.Recv.List { + if check(f.Type) { + return true + } + } + } + if fn.Type.Params != nil { + for _, f := range fn.Type.Params.List { + if check(f.Type) { + return true + } + } + } + if fn.Type.Results != nil { + for _, f := range fn.Type.Results.List { + if check(f.Type) { + return true + } + } + } + return fn.Body != nil && check(fn.Body) }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@hack/copy-capi-types/main.go` around lines 494 - 513, The function referencesAny currently only inspects fn.Body and therefore misses identifiers referenced in the method receiver, parameter types, and result types; update referencesAny to also inspect fn.Recv, fn.Type.Params and fn.Type.Results (visit their *ast.FieldList nodes) and search for *ast.Ident the same way you do for the body so that any identifier used in receiver or signature types sets found=true; reuse the same ast.Inspect logic (or factor out an inspectNode helper) to walk those AST nodes (fn.Recv, fn.Type.Params, fn.Type.Results) in addition to fn.Body to ensure cascade stripping catches symbols referenced in signatures.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@hack/copy-capi-types/main.go`:
- Around line 494-513: The function referencesAny currently only inspects
fn.Body and therefore misses identifiers referenced in the method receiver,
parameter types, and result types; update referencesAny to also inspect fn.Recv,
fn.Type.Params and fn.Type.Results (visit their *ast.FieldList nodes) and search
for *ast.Ident the same way you do for the body so that any identifier used in
receiver or signature types sets found=true; reuse the same ast.Inspect logic
(or factor out an inspectNode helper) to walk those AST nodes (fn.Recv,
fn.Type.Params, fn.Type.Results) in addition to fn.Body to ensure cascade
stripping catches symbols referenced in signatures.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: 0db6d833-6d48-4995-9e2e-c3ea1e482c95
📒 Files selected for processing (4)
.golangci.ymlMakefilehack/capi-sync-provider.shhack/copy-capi-types/main.go
✅ Files skipped from review due to trivial changes (1)
- .golangci.yml
c7eb668 to
af5fced
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
hack/copy-capi-types/main_test.go (1)
184-208: 💤 Low valueTest helper constructs a synthetic FuncDecl for interface methods, but this may not accurately test
referencesAny.For the "no body" test case (line 149-154), the code constructs a synthetic
FuncDeclfrom interface method signatures. However,referencesAnyreturnsfalsewhenfn.Body == nil(line 504), so the test correctly passes. The synthetic construction is unnecessarily complex.Simplified approach
The test could be simplified to just parse a function declaration without a body (e.g., an external function declaration):
{ name: "When a function has no body, it should return false", src: `package p func External()`, // no body symbols: map[string]bool{"Bar": true}, want: false, },🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@hack/copy-capi-types/main_test.go` around lines 184 - 208, The test helper builds a synthetic *ast.FuncDecl from interface methods which is unnecessary because referencesAny(fn) already returns false when fn.Body == nil; instead simplify the test by creating/using a parsed FuncDecl with no body (i.e., a real function declaration lacking a body) rather than constructing one from interface types. Locate the test that creates fn from file.Decls and replace that path with a simpler case that parses "func External()" (or equivalent) so the resulting *ast.FuncDecl has nil Body and the test exercises referencesAny directly.hack/capi-sync-provider.sh (1)
25-27: 💤 Low value
run_gois defined but never called.The
run_go()helper function sets proper Go environment variables but is only used insidecopy_types(). Themod_cache_dir()function at line 32 duplicates the environment setup inline instead of usingrun_go.Suggested consistency improvement
mod_cache_dir() { local module="$1" - (cd "$MOD_DIR" && GO111MODULE=on GOWORK=off GOFLAGS= go mod download -json "$module") | jq -r '.Dir' + (cd "$MOD_DIR" && GO111MODULE=on GOWORK=off GOFLAGS= run_go mod download -json "$module") | jq -r '.Dir' }Note: This would require
run_goto be available in the subshell context or the function body to be restructured.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@hack/capi-sync-provider.sh` around lines 25 - 27, The helper run_go() is defined but not used in mod_cache_dir(), which duplicates its Go env setup; update mod_cache_dir() to call run_go instead of inlining GO111MODULE/GOWORK/GOFLAGS so the environment is centralized (either call run_go in the same shell or export the function into the subshell with export -f run_go before using it), and remove the duplicated env variables in mod_cache_dir() so copy_types(), mod_cache_dir(), and any other callers all use run_go() consistently.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@hack/copy-capi-types/main.go`:
- Around line 339-341: The parse error is currently swallowed by the `if err !=
nil { continue }` check; instead, log the failure so it’s visible for debugging.
Replace the silent `continue` in the parsing loop with a call to the project
logger (or fmt/stderr) that records the filename/identifier being parsed and the
`err` value (include any position info if available), then decide to continue or
abort as appropriate; look for the parsing call that produces `err` and update
that branch to emit a clear error message referencing the file being parsed and
`err`.
---
Nitpick comments:
In `@hack/capi-sync-provider.sh`:
- Around line 25-27: The helper run_go() is defined but not used in
mod_cache_dir(), which duplicates its Go env setup; update mod_cache_dir() to
call run_go instead of inlining GO111MODULE/GOWORK/GOFLAGS so the environment is
centralized (either call run_go in the same shell or export the function into
the subshell with export -f run_go before using it), and remove the duplicated
env variables in mod_cache_dir() so copy_types(), mod_cache_dir(), and any other
callers all use run_go() consistently.
In `@hack/copy-capi-types/main_test.go`:
- Around line 184-208: The test helper builds a synthetic *ast.FuncDecl from
interface methods which is unnecessary because referencesAny(fn) already returns
false when fn.Body == nil; instead simplify the test by creating/using a parsed
FuncDecl with no body (i.e., a real function declaration lacking a body) rather
than constructing one from interface types. Locate the test that creates fn from
file.Decls and replace that path with a simpler case that parses "func
External()" (or equivalent) so the resulting *ast.FuncDecl has nil Body and the
test exercises referencesAny directly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: 10ea9f40-42c0-417a-9c6c-f20e0789f642
📒 Files selected for processing (5)
.golangci.ymlMakefilehack/capi-sync-provider.shhack/copy-capi-types/main.gohack/copy-capi-types/main_test.go
✅ Files skipped from review due to trivial changes (1)
- .golangci.yml
There was a problem hiding this comment.
♻️ Duplicate comments (1)
hack/copy-capi-types/main.go (1)
338-341:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winParse errors in cross-file cascade are silently ignored.
If re-parsing a file fails, the error is swallowed with
continue. This could mask corruption introduced during Pass 1 stripping, making debugging difficult.Suggested fix: log the parse failure
file, err := parser.ParseFile(fset, r.base, content, parser.ParseComments) if err != nil { + log.Printf("warning: failed to re-parse %s in cross-file cascade: %v", r.base, err) continue }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@hack/copy-capi-types/main.go` around lines 338 - 341, The loop silently continues when parser.ParseFile(fset, r.base, content, parser.ParseComments) returns an error, which hides parse failures; update the handler for parser.ParseFile in main.go to log the failure with context (include r.base and the parse error) instead of silently continuing—use the existing logger or fmt/log to emit a clear message referencing parser.ParseFile, fset, r.base and err, and consider failing fast (returning the error) if a parse error indicates corruption from Pass 1 rather than merely continuing.
🧹 Nitpick comments (1)
hack/capi-sync-provider.sh (1)
105-123: 💤 Low value
upstream_modulesilently returns empty for unknown providers.If
upstream_moduleis called with an unrecognized provider (e.g., due to a typo or adding a new provider without updating this function),MODULE_PATHwill be empty, causingcontroller-gento fail with a confusing error. The maincasestatement already exits on unknown providers, so this is unlikely, but adding a fallback improves debuggability.Suggested fix
upstream_module() { case "$1" in agent) echo "github.com/openshift/cluster-api-provider-agent/api" ;; aws) echo "sigs.k8s.io/cluster-api-provider-aws/v2" ;; azure) echo "sigs.k8s.io/cluster-api-provider-azure" ;; gcp) echo "sigs.k8s.io/cluster-api-provider-gcp" ;; ibmcloud) echo "sigs.k8s.io/cluster-api-provider-ibmcloud" ;; kubevirt) echo "sigs.k8s.io/cluster-api-provider-kubevirt" ;; openstack) echo "sigs.k8s.io/cluster-api-provider-openstack" ;; + *) echo "ERROR: upstream_module: unknown provider: $1" >&2; exit 1 ;; esac }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@hack/capi-sync-provider.sh` around lines 105 - 123, upstream_module currently returns empty for unknown providers, which leads to a confusing failure when MODULE_PATH is blank; update the upstream_module function to include a default (*) branch that prints a clear error to stderr (including the bad provider value from "$1") and exits non‑zero, and additionally guard the MODULE_PATH usage before invoking controller-gen (check that MODULE_PATH is non-empty and, if not, print an explanatory error and exit) so the script fails fast with a helpful message; refer to upstream_module and MODULE_PATH/controller-gen invocation for where to make these changes.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Duplicate comments:
In `@hack/copy-capi-types/main.go`:
- Around line 338-341: The loop silently continues when parser.ParseFile(fset,
r.base, content, parser.ParseComments) returns an error, which hides parse
failures; update the handler for parser.ParseFile in main.go to log the failure
with context (include r.base and the parse error) instead of silently
continuing—use the existing logger or fmt/log to emit a clear message
referencing parser.ParseFile, fset, r.base and err, and consider failing fast
(returning the error) if a parse error indicates corruption from Pass 1 rather
than merely continuing.
---
Nitpick comments:
In `@hack/capi-sync-provider.sh`:
- Around line 105-123: upstream_module currently returns empty for unknown
providers, which leads to a confusing failure when MODULE_PATH is blank; update
the upstream_module function to include a default (*) branch that prints a clear
error to stderr (including the bad provider value from "$1") and exits non‑zero,
and additionally guard the MODULE_PATH usage before invoking controller-gen
(check that MODULE_PATH is non-empty and, if not, print an explanatory error and
exit) so the script fails fast with a helpful message; refer to upstream_module
and MODULE_PATH/controller-gen invocation for where to make these changes.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: 153b69f1-c044-4ef1-9906-54c0382495d3
⛔ Files ignored due to path filters (127)
go.sumis excluded by!**/*.sumhack/capi-vendor/agent/go.sumis excluded by!**/*.sumhack/capi-vendor/aws/go.sumis excluded by!**/*.sumhack/capi-vendor/azure/go.sumis excluded by!**/*.sumhack/capi-vendor/gcp/go.sumis excluded by!**/*.sumhack/capi-vendor/ibmcloud/go.sumis excluded by!**/*.sumhack/capi-vendor/kubevirt/go.sumis excluded by!**/*.sumhack/capi-vendor/openstack/go.sumis excluded by!**/*.sumhack/workspace/go.workis excluded by!**/*.workpkg/capi/agent/v1alpha1/zz_generated.deepcopy.gois excluded by!**/zz_generated*.go,!**/zz_generated*pkg/capi/agent/v1beta1/zz_generated.deepcopy.gois excluded by!**/zz_generated*.go,!**/zz_generated*pkg/capi/aws/api/v1beta1/zz_generated.deepcopy.gois excluded by!**/zz_generated*.go,!**/zz_generated*pkg/capi/aws/api/v1beta2/zz_generated.deepcopy.gois excluded by!**/zz_generated*.go,!**/zz_generated*pkg/capi/aws/exp/api/v1beta1/zz_generated.deepcopy.gois excluded by!**/zz_generated*.go,!**/zz_generated*pkg/capi/aws/exp/api/v1beta2/zz_generated.deepcopy.gois excluded by!**/zz_generated*.go,!**/zz_generated*pkg/capi/azure/api/v1beta1/zz_generated.deepcopy.gois excluded by!**/zz_generated*.go,!**/zz_generated*pkg/capi/gcp/api/v1beta1/zz_generated.deepcopy.gois excluded by!**/zz_generated*.go,!**/zz_generated*pkg/capi/ibmcloud/api/v1beta1/zz_generated.deepcopy.gois excluded by!**/zz_generated*.go,!**/zz_generated*pkg/capi/ibmcloud/api/v1beta2/zz_generated.deepcopy.gois excluded by!**/zz_generated*.go,!**/zz_generated*pkg/capi/kubevirt/api/v1alpha1/zz_generated.deepcopy.gois excluded by!**/zz_generated*.go,!**/zz_generated*pkg/capi/openstack/api/v1alpha1/zz_generated.deepcopy.gois excluded by!**/zz_generated*.go,!**/zz_generated*pkg/capi/openstack/api/v1beta1/zz_generated.deepcopy.gois excluded by!**/zz_generated*.go,!**/zz_generated*vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/CHANGELOG.mdis excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/LICENSE.txtis excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/README.mdis excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/assets.jsonis excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/autorest.mdis excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/availabilitysets_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/build.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/capacityreservationgroups_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/capacityreservations_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/ci.ymlis excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/client_factory.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudserviceoperatingsystems_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudserviceroleinstances_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudserviceroles_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudservices_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudservicesupdatedomain_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/communitygalleries_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/communitygalleryimages_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/communitygalleryimageversions_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/constants.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/dedicatedhostgroups_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/dedicatedhosts_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/diskaccesses_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/diskencryptionsets_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/diskrestorepoint_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/disks_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleries_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleryapplications_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleryapplicationversions_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleryimages_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleryimageversions_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/gallerysharingprofile_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/images_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/loganalytics_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/models.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/models_serde.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/operations_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/options.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/proximityplacementgroups_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/resourceskus_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/responses.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/restorepointcollections_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/restorepoints_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/sharedgalleries_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/sharedgalleryimages_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/sharedgalleryimageversions_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/snapshots_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/sshpublickeys_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/time_rfc3339.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/usage_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineextensionimages_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineextensions_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineimages_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineimagesedgezone_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineruncommands_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachines_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetextensions_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetrollingupgrades_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesets_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetvmextensions_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetvmruncommands_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetvms_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinesizes_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/asaskevich/govalidator/v11/.gitignoreis excluded by!vendor/**,!**/vendor/**vendor/github.com/asaskevich/govalidator/v11/.travis.ymlis excluded by!vendor/**,!**/vendor/**vendor/github.com/asaskevich/govalidator/v11/CODE_OF_CONDUCT.mdis excluded by!vendor/**,!**/vendor/**vendor/github.com/asaskevich/govalidator/v11/CONTRIBUTING.mdis excluded by!vendor/**,!**/vendor/**vendor/github.com/asaskevich/govalidator/v11/LICENSEis excluded by!vendor/**,!**/vendor/**vendor/github.com/asaskevich/govalidator/v11/README.mdis excluded by!vendor/**,!**/vendor/**vendor/github.com/asaskevich/govalidator/v11/arrays.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/asaskevich/govalidator/v11/converter.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/asaskevich/govalidator/v11/doc.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/asaskevich/govalidator/v11/error.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/asaskevich/govalidator/v11/numerics.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/asaskevich/govalidator/v11/patterns.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/asaskevich/govalidator/v11/types.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/asaskevich/govalidator/v11/utils.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/asaskevich/govalidator/v11/validator.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/asaskevich/govalidator/v11/wercker.ymlis excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/CHANGELOG.mdis excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/LICENSE.txtis excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_client.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_AssociateAccessPolicy.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_AssociateEncryptionConfig.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_AssociateIdentityProviderConfig.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreateAccessEntry.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreateAddon.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreateCapability.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreateCluster.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreateEksAnywhereSubscription.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreateFargateProfile.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreateNodegroup.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_CreatePodIdentityAssociation.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeleteAccessEntry.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeleteAddon.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeleteCapability.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeleteCluster.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeleteEksAnywhereSubscription.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeleteFargateProfile.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeleteNodegroup.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeletePodIdentityAssociation.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DeregisterCluster.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeAccessEntry.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeAddon.gois excluded by!vendor/**,!**/vendor/**vendor/github.com/aws/aws-sdk-go-v2/service/eks/api_op_DescribeAddonConfiguration.gois excluded by!vendor/**,!**/vendor/**
📒 Files selected for processing (173)
.gitignore.golangci.ymlMakefilego.modhack/capi-sync-provider.shhack/capi-vendor/agent/go.modhack/capi-vendor/agent/vendor_imports.gohack/capi-vendor/aws/go.modhack/capi-vendor/aws/vendor_imports.gohack/capi-vendor/azure/go.modhack/capi-vendor/azure/vendor_imports.gohack/capi-vendor/gcp/go.modhack/capi-vendor/gcp/vendor_imports.gohack/capi-vendor/ibmcloud/go.modhack/capi-vendor/ibmcloud/vendor_imports.gohack/capi-vendor/kubevirt/go.modhack/capi-vendor/kubevirt/vendor_imports.gohack/capi-vendor/openstack/go.modhack/capi-vendor/openstack/vendor_imports.gohack/copy-capi-types/main.gohack/copy-capi-types/main_test.gopkg/capi/agent/go.modpkg/capi/agent/v1alpha1/agentcluster_types.gopkg/capi/agent/v1alpha1/agentmachine_types.gopkg/capi/agent/v1alpha1/agentmachinetemplate_types.gopkg/capi/agent/v1alpha1/groupversion_info.gopkg/capi/agent/v1alpha1/types.gopkg/capi/agent/v1beta1/agentcluster_types.gopkg/capi/agent/v1beta1/agentmachine_types.gopkg/capi/agent/v1beta1/agentmachinetemplate_types.gopkg/capi/agent/v1beta1/groupversion_info.gopkg/capi/agent/v1beta1/types.gopkg/capi/aws/api/v1beta1/awscluster_types.gopkg/capi/aws/api/v1beta1/awsclustertemplate_types.gopkg/capi/aws/api/v1beta1/awsidentity_types.gopkg/capi/aws/api/v1beta1/awsmachine_types.gopkg/capi/aws/api/v1beta1/awsmachinetemplate_types.gopkg/capi/aws/api/v1beta1/bastion.gopkg/capi/aws/api/v1beta1/conditions_consts.gopkg/capi/aws/api/v1beta1/doc.gopkg/capi/aws/api/v1beta1/groupversion_info.gopkg/capi/aws/api/v1beta1/network_types.gopkg/capi/aws/api/v1beta1/s3bucket.gopkg/capi/aws/api/v1beta1/tags.gopkg/capi/aws/api/v1beta1/types.gopkg/capi/aws/api/v1beta2/awscluster_types.gopkg/capi/aws/api/v1beta2/awsclustertemplate_types.gopkg/capi/aws/api/v1beta2/awsidentity_types.gopkg/capi/aws/api/v1beta2/awsmachine_types.gopkg/capi/aws/api/v1beta2/awsmachinetemplate_types.gopkg/capi/aws/api/v1beta2/bastion.gopkg/capi/aws/api/v1beta2/conditions_consts.gopkg/capi/aws/api/v1beta2/defaults.gopkg/capi/aws/api/v1beta2/doc.gopkg/capi/aws/api/v1beta2/groupversion_info.gopkg/capi/aws/api/v1beta2/network_types.gopkg/capi/aws/api/v1beta2/s3bucket.gopkg/capi/aws/api/v1beta2/tags.gopkg/capi/aws/api/v1beta2/types.gopkg/capi/aws/api/v1beta2/webhooks.gopkg/capi/aws/exp/api/v1beta1/awsmachinepool_types.gopkg/capi/aws/exp/api/v1beta1/conditions_consts.gopkg/capi/aws/exp/api/v1beta1/doc.gopkg/capi/aws/exp/api/v1beta1/finalizers.gopkg/capi/aws/exp/api/v1beta1/groupversion_info.gopkg/capi/aws/exp/api/v1beta1/types.gopkg/capi/aws/exp/api/v1beta2/awsmachinepool_types.gopkg/capi/aws/exp/api/v1beta2/conditions_consts.gopkg/capi/aws/exp/api/v1beta2/doc.gopkg/capi/aws/exp/api/v1beta2/finalizers.gopkg/capi/aws/exp/api/v1beta2/groupversion_info.gopkg/capi/aws/exp/api/v1beta2/types.gopkg/capi/aws/exp/api/v1beta2/validation.gopkg/capi/aws/go.modpkg/capi/azure/api/v1beta1/azureasomanagedcluster_types.gopkg/capi/azure/api/v1beta1/azureasomanagedclustertemplate_types.gopkg/capi/azure/api/v1beta1/azureasomanagedcontrolplane_types.gopkg/capi/azure/api/v1beta1/azureasomanagedcontrolplanetemplate_types.gopkg/capi/azure/api/v1beta1/azureasomanagedmachinepool_types.gopkg/capi/azure/api/v1beta1/azureasomanagedmachinepooltemplate_types.gopkg/capi/azure/api/v1beta1/azurecluster_default.gopkg/capi/azure/api/v1beta1/azurecluster_types.gopkg/capi/azure/api/v1beta1/azurecluster_validation.gopkg/capi/azure/api/v1beta1/azureclusteridentity_types.gopkg/capi/azure/api/v1beta1/azureclustertemplate_default.gopkg/capi/azure/api/v1beta1/azureclustertemplate_types.gopkg/capi/azure/api/v1beta1/azureclustertemplate_validation.gopkg/capi/azure/api/v1beta1/azureimage_validation.gopkg/capi/azure/api/v1beta1/azuremachine_default.gopkg/capi/azure/api/v1beta1/azuremachine_types.gopkg/capi/azure/api/v1beta1/azuremachine_validation.gopkg/capi/azure/api/v1beta1/azuremachinetemplate_types.gopkg/capi/azure/api/v1beta1/azuremanagedcluster_types.gopkg/capi/azure/api/v1beta1/azuremanagedclustertemplate_types.gopkg/capi/azure/api/v1beta1/azuremanagedcontrolplane_default.gopkg/capi/azure/api/v1beta1/azuremanagedcontrolplane_types.gopkg/capi/azure/api/v1beta1/azuremanagedcontrolplanetemplate_default.gopkg/capi/azure/api/v1beta1/azuremanagedcontrolplanetemplate_types.gopkg/capi/azure/api/v1beta1/azuremanagedmachinepool_types.gopkg/capi/azure/api/v1beta1/azuremanagedmachinepooltemplate_types.gopkg/capi/azure/api/v1beta1/consts.gopkg/capi/azure/api/v1beta1/doc.gopkg/capi/azure/api/v1beta1/groupversion_info.gopkg/capi/azure/api/v1beta1/tags.gopkg/capi/azure/api/v1beta1/types.gopkg/capi/azure/api/v1beta1/types_class.gopkg/capi/azure/api/v1beta1/types_template.gopkg/capi/azure/go.modpkg/capi/gcp/api/v1beta1/doc.gopkg/capi/gcp/api/v1beta1/endpoints.gopkg/capi/gcp/api/v1beta1/gcpcluster_types.gopkg/capi/gcp/api/v1beta1/gcpclustertemplate_types.gopkg/capi/gcp/api/v1beta1/gcpmachine_types.gopkg/capi/gcp/api/v1beta1/gcpmachinetemplate_types.gopkg/capi/gcp/api/v1beta1/groupversion_info.gopkg/capi/gcp/api/v1beta1/labels.gopkg/capi/gcp/api/v1beta1/tags.gopkg/capi/gcp/api/v1beta1/types.gopkg/capi/gcp/go.modpkg/capi/ibmcloud/api/v1beta1/conditions_consts.gopkg/capi/ibmcloud/api/v1beta1/doc.gopkg/capi/ibmcloud/api/v1beta1/groupversion_info.gopkg/capi/ibmcloud/api/v1beta1/ibmpowervscluster_types.gopkg/capi/ibmcloud/api/v1beta1/ibmpowervsclustertemplate_types.gopkg/capi/ibmcloud/api/v1beta1/ibmpowervsimage_types.gopkg/capi/ibmcloud/api/v1beta1/ibmpowervsmachine_types.gopkg/capi/ibmcloud/api/v1beta1/ibmpowervsmachinetemplate_types.gopkg/capi/ibmcloud/api/v1beta1/ibmvpccluster_types.gopkg/capi/ibmcloud/api/v1beta1/ibmvpcmachine_types.gopkg/capi/ibmcloud/api/v1beta1/ibmvpcmachinetemplate_types.gopkg/capi/ibmcloud/api/v1beta1/types.gopkg/capi/ibmcloud/api/v1beta2/conditions_consts.gopkg/capi/ibmcloud/api/v1beta2/doc.gopkg/capi/ibmcloud/api/v1beta2/groupversion_info.gopkg/capi/ibmcloud/api/v1beta2/ibmpowervscluster_types.gopkg/capi/ibmcloud/api/v1beta2/ibmpowervsclustertemplate_types.gopkg/capi/ibmcloud/api/v1beta2/ibmpowervsimage_types.gopkg/capi/ibmcloud/api/v1beta2/ibmpowervsmachine_types.gopkg/capi/ibmcloud/api/v1beta2/ibmpowervsmachinetemplate_types.gopkg/capi/ibmcloud/api/v1beta2/ibmvpccluster_types.gopkg/capi/ibmcloud/api/v1beta2/ibmvpcclustertemplate_types.gopkg/capi/ibmcloud/api/v1beta2/ibmvpcmachine_types.gopkg/capi/ibmcloud/api/v1beta2/ibmvpcmachinetemplate_types.gopkg/capi/ibmcloud/api/v1beta2/types.gopkg/capi/ibmcloud/go.modpkg/capi/kubevirt/api/v1alpha1/condition_consts.gopkg/capi/kubevirt/api/v1alpha1/doc.gopkg/capi/kubevirt/api/v1alpha1/groupversion_info.gopkg/capi/kubevirt/api/v1alpha1/kubevirtcluster_types.gopkg/capi/kubevirt/api/v1alpha1/kubevirtclustertemplate_types.gopkg/capi/kubevirt/api/v1alpha1/kubevirtmachine_types.gopkg/capi/kubevirt/api/v1alpha1/kubevirtmachinetemplate_types.gopkg/capi/kubevirt/go.modpkg/capi/openstack/api/v1alpha1/conditions_consts.gopkg/capi/openstack/api/v1alpha1/doc.gopkg/capi/openstack/api/v1alpha1/groupversion_info.gopkg/capi/openstack/api/v1alpha1/openstackfloatingippool_types.gopkg/capi/openstack/api/v1alpha1/openstackserver_types.gopkg/capi/openstack/api/v1alpha1/types.gopkg/capi/openstack/api/v1beta1/conditions_consts.gopkg/capi/openstack/api/v1beta1/doc.gopkg/capi/openstack/api/v1beta1/groupversion_info.gopkg/capi/openstack/api/v1beta1/identity_types.gopkg/capi/openstack/api/v1beta1/openstackcluster_types.gopkg/capi/openstack/api/v1beta1/openstackclustertemplate_types.gopkg/capi/openstack/api/v1beta1/openstackmachine_types.gopkg/capi/openstack/api/v1beta1/openstackmachinetemplate_types.gopkg/capi/openstack/api/v1beta1/types.gopkg/capi/openstack/go.modpkg/capi/openstack/pkg/utils/errors/errors.gopkg/capi/openstack/pkg/utils/errors/terminal.gopkg/capi/openstack/pkg/utils/optional/types.gosupport/api/capi_types.go
💤 Files with no reviewable changes (2)
- pkg/capi/aws/api/v1beta1/network_types.go
- pkg/capi/aws/api/v1beta1/tags.go
✅ Files skipped from review due to trivial changes (10)
- .gitignore
- hack/capi-vendor/agent/go.mod
- hack/capi-vendor/azure/vendor_imports.go
- hack/capi-vendor/aws/vendor_imports.go
- pkg/capi/azure/api/v1beta1/groupversion_info.go
- .golangci.yml
- pkg/capi/agent/go.mod
- hack/capi-vendor/openstack/vendor_imports.go
- pkg/capi/azure/api/v1beta1/consts.go
- pkg/capi/aws/go.mod
🚧 Files skipped from review as they are similar to previous changes (59)
- hack/capi-vendor/gcp/go.mod
- hack/capi-vendor/kubevirt/vendor_imports.go
- pkg/capi/azure/api/v1beta1/azureasomanagedclustertemplate_types.go
- pkg/capi/azure/api/v1beta1/doc.go
- pkg/capi/agent/v1beta1/groupversion_info.go
- hack/capi-vendor/ibmcloud/go.mod
- hack/capi-vendor/aws/go.mod
- pkg/capi/aws/api/v1beta1/s3bucket.go
- pkg/capi/agent/v1beta1/agentmachine_types.go
- pkg/capi/azure/api/v1beta1/azuremanagedcontrolplanetemplate_default.go
- hack/capi-vendor/gcp/vendor_imports.go
- hack/capi-vendor/agent/vendor_imports.go
- hack/capi-vendor/openstack/go.mod
- pkg/capi/azure/api/v1beta1/azureclustertemplate_default.go
- pkg/capi/azure/api/v1beta1/azuremanagedclustertemplate_types.go
- hack/capi-vendor/ibmcloud/vendor_imports.go
- hack/capi-vendor/azure/go.mod
- pkg/capi/aws/api/v1beta2/groupversion_info.go
- pkg/capi/aws/api/v1beta2/s3bucket.go
- pkg/capi/aws/api/v1beta2/awsmachinetemplate_types.go
- hack/capi-vendor/kubevirt/go.mod
- pkg/capi/azure/api/v1beta1/azureasomanagedmachinepooltemplate_types.go
- pkg/capi/azure/api/v1beta1/azureclustertemplate_validation.go
- pkg/capi/azure/api/v1beta1/azuremanagedmachinepooltemplate_types.go
- pkg/capi/azure/api/v1beta1/azureclustertemplate_types.go
- pkg/capi/aws/api/v1beta2/doc.go
- pkg/capi/azure/api/v1beta1/azuremanagedcontrolplanetemplate_types.go
- pkg/capi/azure/api/v1beta1/azuremanagedcluster_types.go
- pkg/capi/agent/v1beta1/agentcluster_types.go
- pkg/capi/agent/v1beta1/agentmachinetemplate_types.go
- pkg/capi/azure/api/v1beta1/types_class.go
- pkg/capi/azure/api/v1beta1/azureasomanagedcontrolplane_types.go
- pkg/capi/azure/api/v1beta1/azureasomanagedmachinepool_types.go
- pkg/capi/azure/api/v1beta1/types_template.go
- pkg/capi/azure/api/v1beta1/tags.go
- pkg/capi/aws/api/v1beta2/defaults.go
- pkg/capi/aws/api/v1beta2/awscluster_types.go
- pkg/capi/azure/api/v1beta1/azuremachine_default.go
- pkg/capi/azure/api/v1beta1/types.go
- pkg/capi/aws/api/v1beta2/awsmachine_types.go
- pkg/capi/azure/api/v1beta1/azureclusteridentity_types.go
- pkg/capi/azure/api/v1beta1/azureasomanagedcluster_types.go
- pkg/capi/azure/api/v1beta1/azuremachine_validation.go
- pkg/capi/aws/api/v1beta2/webhooks.go
- pkg/capi/aws/api/v1beta2/awsidentity_types.go
- pkg/capi/aws/api/v1beta2/tags.go
- pkg/capi/aws/api/v1beta2/awsclustertemplate_types.go
- pkg/capi/aws/api/v1beta2/types.go
- pkg/capi/aws/api/v1beta2/bastion.go
- go.mod
- pkg/capi/azure/api/v1beta1/azuremanagedcontrolplane_default.go
- pkg/capi/aws/api/v1beta2/conditions_consts.go
- pkg/capi/azure/api/v1beta1/azuremachinetemplate_types.go
- hack/copy-capi-types/main_test.go
- pkg/capi/azure/api/v1beta1/azuremachine_types.go
- pkg/capi/azure/api/v1beta1/azuremanagedcontrolplane_types.go
- pkg/capi/aws/api/v1beta2/network_types.go
- pkg/capi/azure/api/v1beta1/azurecluster_default.go
- pkg/capi/azure/api/v1beta1/azurecluster_validation.go
cblecker
left a comment
There was a problem hiding this comment.
Overall this is a solid approach — AST-based stripping is the right design, the test coverage is good (76%, 66 subtests), and the CI safety net via verify-capi-sync is well thought out.
A few things I noticed that weren't covered in the earlier review rounds — mostly around error handling in the shell scripts and Makefile, plus some dead code in the import cleanup logic. Nothing blocking, but worth cleaning up.
cblecker
left a comment
There was a problem hiding this comment.
Thanks for addressing all the feedback from the last round. The approach is clean — stamp-based incremental sync, clear verify target with actionable errors, and good test coverage on the copy tool.
Left a few more comments on the cascade logic and a note about the verify-parallel interaction. The main one worth looking at is referencesAny only inspecting the function body and not the signature.
|
/pipeline required |
|
Scheduling tests matching the |
AI Test Failure AnalysisJob: Generated by hypershift-analyze-e2e-failure post-step using Claude claude-opus-4-6 |
jparrill
left a comment
There was a problem hiding this comment.
Dropped some comments. Thanks!
56b78d7 to
6ea4c13
Compare
|
The Test Failure Analysis CompleteJob Information
Test Failure AnalysisErrorSummaryThe verify job's "check for uncommitted changes" step ( Root CauseThe PR ("Decouple CAPI provider Go module dependencies") performs a large-scale restructuring of how CAPI provider dependencies are managed. It introduces:
The PR also modifies the vendored OpenStack CAPI provider types in
All of these type changes alter the kubebuilder markers that Recommendations
Evidence
|
Copy CAPI infrastructure provider API types from vendored sources into pkg/capi/<provider>/<version>/ using an AST-based tool that strips external dependencies not needed by HyperShift. This decouples the Go module dependency on CAPI infrastructure providers so they no longer require simultaneous bumps during CAPI version upgrades. All 7 providers (AWS, Azure, GCP, IBM Cloud, KubeVirt, OpenStack, Agent) are now local. Makefile CRD generation targets, codespell, and golangci-lint are updated to use the local paths. Generated CRDs are identical to main. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
Stale PRs are closed after 21d of inactivity. If this PR is still relevant, comment to refresh it or remove the stale label. If this PR is safe to close now please do so with /lifecycle stale |
|
@csrwng: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Summary
Decouples HyperShift's Go module dependency on CAPI infrastructure providers (AWS, Azure, GCP, IBM Cloud, KubeVirt, OpenStack, Agent) so that bumping K8s core dependencies no longer requires waiting for all upstream CAPI providers to release compatible versions first.
Instead of importing CAPI provider modules directly (which pulls in their full transitive dependency trees including specific K8s versions), this PR copies only the API types HyperShift needs into local
pkg/capi/<provider>/packages. Each provider gets its own Go module declaring the upstream module name, and the maingo.modusesreplacedirectives to redirect imports to the local copies. This preserves upstream import paths throughout the codebase.Key changes
hack/copy-capi-types/main.go): strips unused functions, defaults, and validation while preserving types, constants, and deepcopyhack/capi-sync-provider.sh): re-syncs types from a specific upstream version on demandhack/capi-vendor/<provider>/): pin upstream versions independently, used only by the sync scripthack/workspace/go.work): enables controller-gen CRD and deepcopy generation across provider modules.syncedsentinel filesImpact
Supersedes #8697.
Jira: https://redhat.atlassian.net/browse/CNTRLPLANE-3610
Test plan
make verifypassesmake testpassesmake capi-sync-forceround-trips cleanly (no diff)Summary by CodeRabbit
New Features
Chores