CCO-837: Replace deprecated golang/mock with go.uber.org/mock#1067
CCO-837: Replace deprecated golang/mock with go.uber.org/mock#1067ericahinkleRH wants to merge 5 commits into
Conversation
Update Kubernetes dependencies to v0.36.0 and controller-runtime to v0.24.0. Bump openshift/api for compatibility with APIs removed in Kubernetes 1.36. Regenerate codegen and apply a temporary library-go vendor patch for HasSyncedChecker until openshift/library-go#2171 merges. Assisted-by: Claude
Track the temporary vendor patch for HasSyncedChecker() in deps.diff as required by the verify-deps check.
Per review feedback from dlom, the library-go vendor patch is not needed. Using the clean version from go mod vendor instead.
The golang/mock repository is no longer maintained and recommends migrating to go.uber.org/mock as a maintained fork. This commit replaces github.com/golang/mock with go.uber.org/mock across the codebase: - Updated go.mod dependency from v1.7.0-rc.1 to v0.6.0 - Replaced import paths in 27 test files - Fixed gomock API compatibility in utils_test.go where InOrder() now expects variadic any parameters Note: Some tests still fail due to the openshift/library-go#2171 dependency (HasSyncedChecker method requirement), which is unrelated to this mock library migration. Assisted-by: Claude Sonnet 4.5 <noreply@anthropic.com>
|
@ericahinkleRH: This pull request references CCO-837 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. |
|
No actionable comments were generated in the recent review. 🎉 WalkthroughThe module dependency graph was upgraded, the legacy GoMock dependency was replaced with ChangesGoMock and dependency migration
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 14 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (14 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dlom, ericahinkleRH 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 |
Blocker StatusThis PR is blocked by the same upstream dependency as PR #1066 (CCO-834): Waiting on: openshift/library-go#2171 to merge The Once library-go#2171 merges, this PR should be ready to merge. |
|
@ericahinkleRH: 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
Replaces the deprecated
github.com/golang/mocklibrary with the maintained forkgo.uber.org/mock.The golang/mock repository is no longer maintained and officially recommends migrating to go.uber.org/mock:
Changes
github.com/golang/mock v1.7.0-rc.1togo.uber.org/mock v0.6.0go.uber.org/mock/gomockinstead ofgithub.com/golang/mock/gomockpkg/operator/utils/gcp/utils_test.goto handle gomock API change whereInOrder()now expects variadicanyparametersTest Status
✅ All mockgen-related tests pass successfully
❌ Some tests fail due to unrelated blocker: openshift/library-go#2171 (HasSyncedChecker method requirement)
This PR has the same library-go dependency blocker as PR #1066 (CCO-834). Both PRs are waiting for openshift/library-go#2171 to merge before tests can fully pass.
Test Plan
Ran
make test- all tests that can run pass. Failures are exclusively from the library-go blocker, not from the mock library migration.Summary by CodeRabbit
Chores
Tests