Skip to content

CNF-23394: mockgen deprecated: use uber-go/mock instead#73

Open
sebrandon1 wants to merge 1 commit into
openshift:mainfrom
sebrandon1:mockgen_deprecation
Open

CNF-23394: mockgen deprecated: use uber-go/mock instead#73
sebrandon1 wants to merge 1 commit into
openshift:mainfrom
sebrandon1:mockgen_deprecation

Conversation

@sebrandon1
Copy link
Copy Markdown
Member

@sebrandon1 sebrandon1 commented Nov 14, 2025

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
    • Updated testing framework dependencies across the project to newer versions for improved compatibility and long-term maintainability.

@openshift-ci openshift-ci Bot requested review from RadekManak and nrb November 14, 2025 15:57
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Nov 14, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign radekmanak for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 18, 2025
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 19, 2025
@sebrandon1
Copy link
Copy Markdown
Member Author

/retest

1 similar comment
@sebrandon1
Copy link
Copy Markdown
Member Author

/retest

@sebrandon1 sebrandon1 force-pushed the mockgen_deprecation branch from 13eb179 to 2071c29 Compare March 20, 2026 19:44
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 20, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 08150089-5c48-41eb-806b-ec2d8f18f4bb

📥 Commits

Reviewing files that changed from the base of the PR and between 2071c29 and 05a4657.

⛔ Files ignored due to path filters (3)
  • go.sum is excluded by !**/*.sum
  • vendor/github.com/golang/mock/CONTRIBUTORS is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/golang/mock/mockgen/reflect.go is excluded by !**/vendor/**, !vendor/**
📒 Files selected for processing (7)
  • go.mod
  • pkg/actuators/client/mock/client_mock_generated.go
  • pkg/actuators/machine/actuator_test.go
  • pkg/actuators/machine/machine_scope_test.go
  • pkg/actuators/machine/reconciler_test.go
  • pkg/actuators/machineset/controller_test.go
  • tools.go
🚧 Files skipped from review as they are similar to previous changes (3)
  • pkg/actuators/machine/actuator_test.go
  • pkg/actuators/machineset/controller_test.go
  • pkg/actuators/machine/reconciler_test.go

Walkthrough

Replaces the mocking library from github.com/golang/mock to go.uber.org/mock across the repo: updates go.mod, the tools blank import for mockgen, the generated mock file import, and gomock imports in several test files.

Changes

Mock library migration

Layer / File(s) Summary
Module / Tooling
go.mod, tools.go
Replaced github.com/golang/mock requirement with go.uber.org/mock v0.6.0; changed blank tool import for mockgen to go.uber.org/mock/mockgen.
Generated mocks
pkg/actuators/client/mock/client_mock_generated.go
Updated import path for gomock from github.com/golang/mock/gomock to go.uber.org/mock/gomock.
Test wiring
pkg/actuators/machine/actuator_test.go, pkg/actuators/machine/machine_scope_test.go, pkg/actuators/machine/reconciler_test.go, pkg/actuators/machineset/controller_test.go
Replaced gomock import paths in test files to go.uber.org/mock/gomock; test usage (controllers, matchers, expectations) unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 12
✅ Passed checks (12 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: migrating from the archived golang/mock to the maintained go.uber.org/mock library across the codebase.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed All test names are stable and deterministic. Repository uses standard Go testing with static, descriptive names. PR only updates mock library imports without modifying any test names or structure.
Test Structure And Quality ✅ Passed Check not applicable. This repository uses standard Go testing with Gomega, not Ginkgo. PR only updates mock import paths, not test code.
Microshift Test Compatibility ✅ Passed No new Ginkgo e2e tests added. PR only updates mock library dependency and import paths in existing unit tests. Check not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed PR updates mock dependency (golang/mock → go.uber.org/mock) with import path changes only. No new Ginkgo e2e tests added. Check is inapplicable.
Topology-Aware Scheduling Compatibility ✅ Passed PR only updates mock dependencies and test imports. No deployment manifests, operator code, or scheduling constraints were modified. Check not applicable.
Ote Binary Stdout Contract ✅ Passed PR is not applicable to the OTE Binary Stdout Contract check. It only updates mock library dependencies and import paths in test files. No process-level code changes or stdout writes are introduced.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed This PR does not add any new Ginkgo e2e tests. It only updates mock dependencies (github.com/golang/mock → go.uber.org/mock) in unit tests and build tooling. The custom check is not applicable.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@sebrandon1 sebrandon1 changed the title mockgen deprecated: use uber-go/mock instead CNF-23394: mockgen deprecated: use uber-go/mock instead Apr 30, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Apr 30, 2026
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Apr 30, 2026

@sebrandon1: This pull request references CNF-23394 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.

Details

In response to this:

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

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.

@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 30, 2026
@sebrandon1 sebrandon1 force-pushed the mockgen_deprecation branch from 2071c29 to 05a4657 Compare May 6, 2026 13:17
@openshift-ci openshift-ci Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 6, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 6, 2026

@sebrandon1: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/regression-clusterinfra-ibmcloud-ipi-mapi 05a4657 link false /test regression-clusterinfra-ibmcloud-ipi-mapi
ci/prow/generate 05a4657 link true /test generate

Full PR test history. Your PR dashboard.

Details

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants