Skip to content

CNF-23390: mockgen deprecated: use uber-go/mock instead - #125

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

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

Conversation

@sebrandon1

@sebrandon1 sebrandon1 commented Nov 13, 2025

Copy link
Copy Markdown
Member

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 the project’s mock-generation tooling to use a newer supported library.
    • Refreshed development tooling configuration to maintain compatibility with the updated mocking workflow.
    • No changes were made to runtime behavior, user-facing features, or application functionality.

@openshift-ci

openshift-ci Bot commented Nov 13, 2025

Copy link
Copy Markdown
Contributor

[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 nrb 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

@sebrandon1

Copy link
Copy Markdown
Member Author

/retest

@sebrandon1
sebrandon1 force-pushed the mockgen_deprecation branch from 1b706cf to c21c427 Compare March 20, 2026 19:44
@coderabbitai

coderabbitai Bot commented Mar 20, 2026

Copy link
Copy Markdown

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

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: 25426a84-dec7-4e91-a9ca-77d8e93d00a8

📥 Commits

Reviewing files that changed from the base of the PR and between 32a1c22 and 0752177.

⛔ Files ignored due to path filters (4)
  • 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/**
  • vendor/github.com/golang/mock/mockgen/version.1.11.go is excluded by !**/vendor/**, !vendor/**
📒 Files selected for processing (2)
  • go.mod
  • tools/tools.go
🚧 Files skipped from review as they are similar to previous changes (2)
  • tools/tools.go
  • go.mod

Walkthrough

The mock dependency changes from github.com/golang/mock v1.6.0 to go.uber.org/mock v0.5.0. The tools blank import now uses go.uber.org/mock/mockgen.

Changes

Mock library migration

Layer / File(s) Summary
Update mock dependency and tool wiring
go.mod, tools/tools.go
The direct requirement changes to go.uber.org/mock v0.5.0. The mockgen blank import uses the matching module path.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: chrischdi, racheljpg

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes replacing the deprecated github.com/golang/mock dependency with go.uber.org/mock.
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 The PR changes no test files. Existing Ginkgo titles are static: "MachineSet Reconciler" and "when reconciling MachineSets"; no dynamic values appear in titles.
Test Structure And Quality ✅ Passed PASS: The PR changes only go.mod, go.sum, tools/tools.go, and vendored mockgen files; no Ginkgo test files or test behavior changed.
Microshift Test Compatibility ✅ Passed The PR changes dependency, build-tool, and vendored mockgen files only; it adds no *_test.go files, Ginkgo declarations, or MicroShift-sensitive API references.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The commit adds no Ginkgo e2e tests or test files. It only updates mock dependencies, tools/tools.go, go.sum, and vendored mockgen sources, so SNO compatibility checks do not apply.
Topology-Aware Scheduling Compatibility ✅ Passed The commit changes only Go dependency metadata, tools/tools.go, go.sum, and vendored mockgen files; it does not modify manifests, operators, controllers, or scheduling constraints.
Ote Binary Stdout Contract ✅ Passed The PR changes only mock dependencies. The repository builds and deploys cmd/manager, with no openshift-tests or OTE integration; this contract is not applicable.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The commit changes only mock dependencies, tooling imports, go.sum, and vendor files. It adds no Ginkgo tests or test networking, IPv4, or external connectivity assumptions.
No-Weak-Crypto ✅ Passed The PR only changes the mock dependency and mockgen import. No weak-crypto algorithms, custom crypto, or secret comparisons were added.
Container-Privileges ✅ Passed The PR changes only Go dependencies/tool imports; no prohibited privilege settings appear in the diff, and the deployment enforces runAsNonRoot=true with UID 65534.
No-Sensitive-Data-In-Logs ✅ Passed The PR changes dependency wiring and vendored mockgen code only; it adds no application logging or log statements that expose passwords, tokens, PII, hostnames, or customer data.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@sebrandon1 sebrandon1 changed the title mockgen deprecated: use uber-go/mock instead CNF-23390: 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

openshift-ci-robot commented Apr 30, 2026

Copy link
Copy Markdown

@sebrandon1: This pull request references CNF-23390 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 c21c427 to 7b70646 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
@sebrandon1
sebrandon1 force-pushed the mockgen_deprecation branch from 7b70646 to e1e556d Compare June 9, 2026 16:35
@sebrandon1
sebrandon1 force-pushed the mockgen_deprecation branch from e1e556d to 32a1c22 Compare June 18, 2026 17:36
@perdasilva

Copy link
Copy Markdown

/retest

@perdasilva

Copy link
Copy Markdown

@sebrandon1 this has been open for a little while now, is it still relevant?

@sebrandon1
sebrandon1 force-pushed the mockgen_deprecation branch from 32a1c22 to 0752177 Compare July 31, 2026 02:55
@openshift-ci

openshift-ci Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

@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 1b7522d link false /test okd-scos-e2e-aws-ovn
ci/prow/regression-clusterinfra-nutanix-ipi-mapi 0752177 link false /test regression-clusterinfra-nutanix-ipi-mapi

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