mockgen deprecated: use uber-go/mock instead#561
mockgen deprecated: use uber-go/mock instead#561sebrandon1 wants to merge 1 commit intoopenshift:masterfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: sebrandon1 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 |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #561 +/- ##
=======================================
Coverage 53.59% 53.59%
=======================================
Files 123 123
Lines 6165 6165
=======================================
Hits 3304 3304
Misses 2668 2668
Partials 193 193
🚀 New features to boost your workflow:
|
|
/retest |
2d4374d to
5e6e2cb
Compare
7ac5511 to
d6506cd
Compare
|
/retest |
d6506cd to
d25a4af
Compare
WalkthroughThis pull request migrates the codebase from golang/mock to uber-go/mock, refactors mock structs by adding isgomock fields for gomock compatibility, renames generic mock parameters (arg0, arg1, etc.) to descriptive names, updates kubebuilder marker formatting, adds go:generate directive comments, and applies miscellaneous formatting adjustments across the codebase. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes ✨ Finishing Touches
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.5.0)Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
mocks/client.go (1)
13-17: Regenerate mocks in the mocks/ directory with the current mockgen version.The mocks/client.go (MockDvoClient) and mocks/builder.go (MockDvoClientBuilder) lack the
isgomock struct{}field present in all other generated mocks in the repository. This indicates the mocks/ directory was generated with an older mockgen version. Regenerate both files to align with the current format used throughout the codebase (e.g., pkg/dvo/mocks/, pkg/notifier/mocks/).🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@mocks/client.go` around lines 13 - 17, Regenerate the mock files for MockDvoClient and MockDvoClientBuilder using the current mockgen version so they include the missing isgomock struct{} field (the other generated mocks in the repo have this field); run mockgen against the DvoClient interface and replace the contents of the existing mocks/client.go and mocks/builder.go with the newly generated output so the MockDvoClient and MockDvoClientBuilder types match the modern mockgen format.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@mocks/client.go`:
- Around line 13-17: Regenerate the mock files for MockDvoClient and
MockDvoClientBuilder using the current mockgen version so they include the
missing isgomock struct{} field (the other generated mocks in the repo have this
field); run mockgen against the DvoClient interface and replace the contents of
the existing mocks/client.go and mocks/builder.go with the newly generated
output so the MockDvoClient and MockDvoClientBuilder types match the modern
mockgen format.
|
@sebrandon1: The following test 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