mockgen deprecated: use uber-go/mock instead#157
mockgen deprecated: use uber-go/mock instead#157sebrandon1 wants to merge 3 commits intoopenshift:mainfrom
Conversation
|
[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 |
e6d9150 to
876c2ae
Compare
876c2ae to
fec1f65
Compare
|
/retest |
fec1f65 to
7b46ac5
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Pro Cache: Disabled due to data retention organization setting Knowledge base: Disabled due to data retention organization setting 📒 Files selected for processing (1)
WalkthroughReplaces gomock dependency and tooling from Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
pkg/client/mock/client_generated.go (1)
71-443: Normalize recorder argument types in generated mocks from mixedinterface{}andanyto consistentany.The mock file shows three recorder methods using
interface{}(AllocateHosts, DescribeHosts, ReleaseHosts) while most others useany. Since both are equivalent in Go 1.18+, normalizing toanyacross all generated recorder methods will reduce noise in future mock regeneration diffs.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@pkg/client/mock/client_generated.go` around lines 71 - 443, Recorder methods AllocateHosts, DescribeHosts, and ReleaseHosts use interface{} for their parameter types while other recorder methods use any; update the signatures in MockClientMockRecorder so the parameter type is any (replace interface{} with any) for AllocateHosts, DescribeHosts, and ReleaseHosts to normalize generated mock recorder argument types (match methods like DescribeImages, DescribeVpcs, etc.).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@pkg/client/mock/client_generated.go`:
- Around line 71-443: Recorder methods AllocateHosts, DescribeHosts, and
ReleaseHosts use interface{} for their parameter types while other recorder
methods use any; update the signatures in MockClientMockRecorder so the
parameter type is any (replace interface{} with any) for AllocateHosts,
DescribeHosts, and ReleaseHosts to normalize generated mock recorder argument
types (match methods like DescribeImages, DescribeVpcs, etc.).
ℹ️ Review info
Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge base: Disabled due to data retention organization setting
⛔ Files ignored due to path filters (23)
go.sumis excluded by!**/*.sumvendor/github.com/golang/mock/CONTRIBUTORSis excluded by!**/vendor/**,!vendor/**vendor/github.com/golang/mock/mockgen/reflect.gois excluded by!**/vendor/**,!vendor/**vendor/github.com/golang/mock/mockgen/version.1.11.gois excluded by!**/vendor/**,!vendor/**vendor/go.uber.org/mock/AUTHORSis excluded by!**/vendor/**,!vendor/**vendor/go.uber.org/mock/LICENSEis excluded by!**/vendor/**,!vendor/**vendor/go.uber.org/mock/gomock/call.gois excluded by!**/vendor/**,!vendor/**vendor/go.uber.org/mock/gomock/callset.gois excluded by!**/vendor/**,!vendor/**vendor/go.uber.org/mock/gomock/controller.gois excluded by!**/vendor/**,!vendor/**vendor/go.uber.org/mock/gomock/doc.gois excluded by!**/vendor/**,!vendor/**vendor/go.uber.org/mock/gomock/matchers.gois excluded by!**/vendor/**,!vendor/**vendor/go.uber.org/mock/gomock/string.gois excluded by!**/vendor/**,!vendor/**vendor/go.uber.org/mock/mockgen/archive.gois excluded by!**/vendor/**,!vendor/**vendor/go.uber.org/mock/mockgen/deprecated.gois excluded by!**/vendor/**,!vendor/**vendor/go.uber.org/mock/mockgen/generic.gois excluded by!**/vendor/**,!vendor/**vendor/go.uber.org/mock/mockgen/gob.gois excluded by!**/vendor/**,!vendor/**vendor/go.uber.org/mock/mockgen/mockgen.gois excluded by!**/vendor/**,!vendor/**vendor/go.uber.org/mock/mockgen/model/model.gois excluded by!**/vendor/**,!vendor/**vendor/go.uber.org/mock/mockgen/model/model_gotypes.gois excluded by!**/vendor/**,!vendor/**vendor/go.uber.org/mock/mockgen/package_mode.gois excluded by!**/vendor/**,!vendor/**vendor/go.uber.org/mock/mockgen/parse.gois excluded by!**/vendor/**,!vendor/**vendor/go.uber.org/mock/mockgen/version.gois excluded by!**/vendor/**,!vendor/**vendor/modules.txtis excluded by!**/vendor/**,!vendor/**
📒 Files selected for processing (10)
go.modpkg/actuators/machine/actuator_test.gopkg/actuators/machine/controller_test.gopkg/actuators/machine/instances_test.gopkg/actuators/machine/loadbalancers_test.gopkg/actuators/machine/machine_scope_test.gopkg/actuators/machine/reconciler_test.gopkg/client/client.gopkg/client/mock/client_generated.gotools.go
Update the remaining github.com/golang/mock import to go.uber.org/mock that was missed in the initial migration.
Sort go.uber.org/mock/gomock after github.com imports to satisfy goimports check.
|
@sebrandon1: 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. |
https://github.com/golang/mock is marked as archived as of
June 27, 2023. They recommend using go.uber.org/mock.This PR attempts to change the dependency to one that is maintained.
Tracking issue: redhat-best-practices-for-k8s/telco-bot#45
Summary by CodeRabbit
Chores
Tests