Skip to content

CNF-23391: mockgen deprecated: use uber-go/mock instead#197

Open
sebrandon1 wants to merge 1 commit intoopenshift:mainfrom
sebrandon1:mockgen_deprecation
Open

CNF-23391: mockgen deprecated: use uber-go/mock instead#197
sebrandon1 wants to merge 1 commit intoopenshift: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 internal testing dependencies for improved development infrastructure and maintenance.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Nov 14, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.60%. Comparing base (6c48650) to head (c90eb57).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #197   +/-   ##
=======================================
  Coverage   58.60%   58.60%           
=======================================
  Files           5        5           
  Lines         244      244           
=======================================
  Hits          143      143           
  Misses         87       87           
  Partials       14       14           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@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 19, 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 21, 2025
@sebrandon1
Copy link
Copy Markdown
Member Author

/retest

@sebrandon1 sebrandon1 force-pushed the mockgen_deprecation branch from 922f4dd to c90eb57 Compare April 30, 2026 19:01
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 30, 2026

Walkthrough

The project switches its mocking framework dependency from github.com/golang/mock to go.uber.org/mock, updating the module requirement and corresponding test file imports to use the new package source.

Changes

Cohort / File(s) Summary
Mock dependency migration
go.mod, controllers/machineset_controller_test.go
Replaces github.com/golang/mock v1.6.0 with go.uber.org/mock v0.6.0 in module dependencies and updates the gomock import path in the test file accordingly.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 11 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description addresses the core change (deprecation and migration to maintained library) with context, but it doesn't follow the repository's template structure with required sections like 'What is being added', testing checklist, or manual testing steps. Add the required sections from the template: explain the change in 'What is being added', complete the testing checklist, and provide manual testing steps or explain why none are needed.
✅ Passed checks (11 passed)
Check name Status Explanation
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 Ginkgo test names in modified controllers/machineset_controller_test.go use static, descriptive strings without dynamic information or interpolation.
Test Structure And Quality ✅ Passed This PR is a pure dependency migration from archived github.com/golang/mock to maintained go.uber.org/mock with no test logic changes.
Microshift Test Compatibility ✅ Passed PR only updates mock library dependency from github.com/golang/mock to go.uber.org/mock with corresponding import changes; no new Ginkgo e2e tests added.
Single Node Openshift (Sno) Test Compatibility ✅ Passed PR only migrates mock library dependencies; no new Ginkgo e2e tests are being added.
Topology-Aware Scheduling Compatibility ✅ Passed PR only updates mock library dependencies in test files and go.mod; does not modify deployment manifests, operator code, or controllers with scheduling constraints.
Ote Binary Stdout Contract ✅ Passed This PR only updates the mock library dependency and does not introduce any new stdout writes in process-level code.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The custom check for IPv6 and disconnected network test compatibility applies only to new Ginkgo e2e tests. This PR only updates mock library imports and dependencies without adding any new tests.
Title check ✅ Passed The title accurately reflects the main change: migrating from the deprecated github.com/golang/mock to go.uber.org/mock, which is the primary purpose of this PR.

✏️ 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.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 30, 2026

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

Summary by CodeRabbit

  • Chores
  • Updated internal testing dependencies for improved development infrastructure and maintenance.

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
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 30, 2026

@sebrandon1: The following test 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/validate c90eb57 link true /test validate

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.

4 participants