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 3 commits 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. |
|
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:
WalkthroughThe dependency graph was upgraded for Kubernetes 1.36, GoMock was migrated to ChangesKubernetes 1.36 upgrade
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant E2ETest
participant KubernetesAPI
participant CCOPod
E2ETest->>KubernetesAPI: Fetch CCO deployment and pods
KubernetesAPI-->>E2ETest: Return readiness and pod status
E2ETest->>CCOPod: Read running pod logs
CCOPod-->>E2ETest: Return controller and cache messages
E2ETest->>KubernetesAPI: Check deployment availability
KubernetesAPI-->>E2ETest: Return Available condition
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 |
942ee30 to
a110ff6
Compare
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 |
|
/retest |
… tests 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. Update to official library-go with HasSyncedChecker support. Update toolchain to Go 1.26.5 to fix security scan. Add e2e tests for K8s 1.36 HasSyncedChecker functionality and controller manager startup verification. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
/test e2e-hypershift |
64c953c to
52f1dd1
Compare
|
/test e2e-hypershift |
1 similar comment
|
/test e2e-hypershift |
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 test files and generated mocks - Vendored new dependency Depends on CCO-834 (K8s 1.36 upgrade) for Go version compatibility. Jira: https://redhat.atlassian.net/browse/CCO-837 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Fixes Snyk HIGH severity vulnerabilities: - SNYK-GOLANG-GOOGLEGOLANGORGGRPCINTERNALXDSRBAC-18172577 (Incorrect Authorization) - SNYK-GOLANG-GOOGLEGOLANGORGGRPCINTERNALTRANSPORT-18172578 (Incorrect Authorization) Both fixed in grpc v1.82.1.
|
/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. |
|
Hey! The two manual-oidc tests keep failing consistently across multiple retests (tried July 17 and July 23, same failures
Both are OpenShift platform tests (sig-auth and sig-network-edge), not CCO-specific tests. This PR only swaps the import paths from github.com/golang/mock to go.uber.org/mock, so I'm not sure how it could affect platform auth or networking. Interestingly, PR #1004 from March modified the same pkg/gcp/mock/client_generated.go file and the GCP manual-oidc test passed fine then. Have you seen these tests fail recently on other PRs, or should I keep retesting? Not sure if this is something that needs |
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).