Skip to content

CNF-23389: mockgen deprecated: use uber-go/mock instead#194

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

CNF-23389: mockgen deprecated: use uber-go/mock instead#194
sebrandon1 wants to merge 1 commit into
openshift:mainfrom
sebrandon1:mockgen_depreciation

Conversation

@sebrandon1
Copy link
Copy Markdown
Member

@sebrandon1 sebrandon1 commented Nov 13, 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 dependencies to a newer version, enhancing test infrastructure and compatibility.

@openshift-ci openshift-ci Bot requested review from mpatlasov and rhrmo November 13, 2025 21:18
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Nov 13, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: sebrandon1
Once this PR has been reviewed and has the lgtm label, please assign dfajmon 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 14, 2025
@sebrandon1 sebrandon1 force-pushed the mockgen_depreciation branch from d72ca5f to f75ecbe Compare December 2, 2025 17:02
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 2, 2025
@sebrandon1 sebrandon1 force-pushed the mockgen_depreciation branch from f75ecbe to eb72bcd Compare January 16, 2026 17:36
@sebrandon1 sebrandon1 force-pushed the mockgen_depreciation branch from 470795a to 75ae47f 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: 9f529110-4a36-4695-ba8c-5c941cdcb88e

📥 Commits

Reviewing files that changed from the base of the PR and between 842aed3 and 1196dc1.

⛔ Files ignored due to path filters (11)
  • go.sum is excluded by !**/*.sum
  • vendor/github.com/golang/mock/CONTRIBUTORS is excluded by !**/vendor/**, !vendor/**
  • vendor/go.uber.org/mock/AUTHORS is excluded by !**/vendor/**, !vendor/**
  • vendor/go.uber.org/mock/LICENSE is excluded by !**/vendor/**, !vendor/**
  • vendor/go.uber.org/mock/gomock/call.go is excluded by !**/vendor/**, !vendor/**
  • vendor/go.uber.org/mock/gomock/callset.go is excluded by !**/vendor/**, !vendor/**
  • vendor/go.uber.org/mock/gomock/controller.go is excluded by !**/vendor/**, !vendor/**
  • vendor/go.uber.org/mock/gomock/doc.go is excluded by !**/vendor/**, !vendor/**
  • vendor/go.uber.org/mock/gomock/matchers.go is excluded by !**/vendor/**, !vendor/**
  • vendor/go.uber.org/mock/gomock/string.go is excluded by !**/vendor/**, !vendor/**
  • vendor/modules.txt is excluded by !**/vendor/**, !vendor/**
📒 Files selected for processing (6)
  • go.mod
  • pkg/check/datastore_test.go
  • pkg/check/mock/authmanager_generated.go
  • pkg/check/node_cbt_test.go
  • pkg/check/node_cluster_permissions_test.go
  • pkg/check/permissions_test.go

Walkthrough

This PR migrates the mocking framework from github.com/golang/mock to go.uber.org/mock. The change updates the dependency declaration in go.mod and replaces all corresponding import paths in test and generated mock files.

Changes

Mock Framework Migration

Layer / File(s) Summary
Dependency Declaration
go.mod
Removed github.com/golang/mock v1.6.0 and added go.uber.org/mock v0.6.0 in the require block.
Import Path Updates
pkg/check/datastore_test.go, pkg/check/node_cbt_test.go, pkg/check/node_cluster_permissions_test.go, pkg/check/permissions_test.go, pkg/check/mock/authmanager_generated.go
Updated gomock import statements from github.com/golang/mock/gomock to go.uber.org/mock/gomock across all test and generated mock files.

🎯 1 (Trivial) | ⏱️ ~3 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 clearly and specifically describes the main change: replacing deprecated golang/mock with uber-go/mock, which is the primary focus of all modifications 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 PR only updates mock library imports and versions. No Ginkgo tests exist in project. Check is not applicable as no test names were added or modified.
Test Structure And Quality ✅ Passed The custom check is designed for Ginkgo test code quality. This PR contains only import path updates in a repository that uses standard Go testing (testing.T), not Ginkgo. The check is not applicable.
Microshift Test Compatibility ✅ Passed No new Ginkgo e2e tests added. This PR only updates gomock import paths from github.com/golang/mock to go.uber.org/mock. The check applies only to new Ginkgo e2e tests.
Single Node Openshift (Sno) Test Compatibility ✅ Passed PR does not add new Ginkgo e2e tests. It only updates mock library imports in existing unit tests. SNO compatibility check is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed PR only updates test dependencies (golang/mock → uber-go/mock) with no changes to deployment manifests, operator code, controllers, or scheduling constraints. Check is not applicable.
Ote Binary Stdout Contract ✅ Passed PR only updates mock library imports. No process-level stdout writes added. No changes to main(), init(), TestMain(), or suite setup. Code remains compliant with OTE Binary Stdout Contract.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed Check applies only to new Ginkgo e2e tests. This PR updates mock imports in existing unit tests with no new tests added. Project uses standard Go testing, not Ginkgo.

✏️ 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-23389: 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
Contributor

openshift-ci-robot commented Apr 30, 2026

@sebrandon1: This pull request references CNF-23389 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_depreciation branch from 75ae47f to 1196dc1 Compare May 6, 2026 13:15
@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/okd-scos-e2e-aws-ovn d72ca5f link false /test okd-scos-e2e-aws-ovn
ci/prow/verify 1196dc1 link true /test verify

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