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 1 commit into
Conversation
|
@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 Possibly related issues
Suggested reviewers: 🚥 Pre-merge checks | ✅ 14 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (14 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. |
|
Updated toolchain to Go 1.26.5 to fix security scan! ✅ Applied same fix from CCO-834/835/836 PR: - toolchain go1.26.4
+ toolchain go1.26.5This should resolve the security scan CVEs (SNYK-GOLANG-STDOS-17905377, SNYK-GOLANG-STDCRYPTOTLS-17905406). /test security |
|
Rebased on latest master and applied all CCO-834 fixes! ✅ Changes:
This should now pass all tests! The verify test was failing because vendor/ had outdated library-go. /retest-required |
The golang/mock repository is no longer maintained and recommends migrating to go.uber.org/mock as a maintained fork. Changes: - Updated go.mod dependency from golang/mock v1.7.0-rc.1 to go.uber.org/mock v0.6.0 - Replaced import paths in 27 test files - Updated toolchain to Go 1.26.5 to fix security scan CVEs - Updated library-go to v0.0.0-20260716104731-fdf18b82797f for K8s 1.36 compatibility - Applied gofmt to all affected test files Jira: https://redhat.atlassian.net/browse/CCO-837 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1067 +/- ##
=======================================
Coverage 47.30% 47.30%
=======================================
Files 97 97
Lines 12614 12614
=======================================
Hits 5967 5967
Misses 5987 5987
Partials 660 660
🚀 New features to boost your workflow:
|
|
/test e2e-gcp-manual-oidc |
|
/test e2e-hypershift |
|
/test e2e-aws-ovn |
|
/test e2e-azure-manual-oidc |
|
@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
go.uber.org/mock(including generated mocks).