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 mock dependency and module requirements to align with newer tooling; no behavior or public APIs changed.

@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 (3b59c4f) to head (499e9a3).

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

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 30, 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: 7bbd556e-769b-4bad-b22a-4e7e53b48765

📥 Commits

Reviewing files that changed from the base of the PR and between c90eb57 and 499e9a3.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (2)
  • controllers/machineset_controller_test.go
  • go.mod
🚧 Files skipped from review as they are similar to previous changes (1)
  • go.mod

Walkthrough

The project switches its mocking framework dependency from github.com/golang/mock to go.uber.org/mock, updating the module requirement in go.mod and the gomock import path in controllers/machineset_controller_test.go.

Changes

Mock dependency migration

Layer / File(s) Summary
Data Shape
go.mod
Replaces github.com/golang/mock v1.6.0 with go.uber.org/mock v0.6.0 in the module require block.
Tests / Imports
controllers/machineset_controller_test.go
Updates test import from github.com/golang/mock/gomock to go.uber.org/mock/gomock; other imports unchanged.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 10 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Single Node Openshift (Sno) Test Compatibility ⚠️ Warning PR adds Ginkgo e2e tests that assume multi-node clusters without SNO protections. Tests create machine pools and validate syncing across nodes without topology checks. Add [Skipped:SingleReplicaTopology] to e2e test names or guard with infrastructure.Status.ControlPlaneTopology checks. E2e tests create pools and test label/taint syncing across multiple nodes, incompatible with SNO single-node deployments.
Description check ❓ Inconclusive The description explains the rationale (archived upstream library) and references a tracking issue, but lacks the structured template sections like 'What is being added?', testing checklist, and manual test steps. Consider filling out the repository's description template with sections for what is being changed, testing checklist items, and manual testing steps for clarity and consistency.
✅ Passed checks (10 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: migrating from the archived golang/mock to the maintained uber-go/mock library.
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 declarations use static, deterministic strings with no dynamic content (no generated names, timestamps, UUIDs, variables). No test names were modified by this PR.
Test Structure And Quality ✅ Passed PR updates mock library dependency only (golang/mock → go.uber.org/mock). No test logic or structure changes. API-compatible, tests remain unmodified and valid.
Microshift Test Compatibility ✅ Passed No new Ginkgo e2e tests are added in this PR. The PR only upgrades the mock library dependency from github.com/golang/mock to go.uber.org/mock without modifying test structure or adding new tests.
Topology-Aware Scheduling Compatibility ✅ Passed PR only updates test mocking library (go.mod, test imports). No deployment manifests, operator code, or scheduling constraints are modified.
Ote Binary Stdout Contract ✅ Passed PR updates mock library from golang/mock to go.uber.org/mock. Changes limited to test imports and go.mod. No process-level stdout violations introduced.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed Updates gomock dependency from golang/mock to go.uber.org/mock. No new e2e tests added that require IPv4/disconnected checks. Existing tests use fake clients or have no IPv4 assumptions.

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

@sebrandon1 sebrandon1 force-pushed the mockgen_deprecation branch from c90eb57 to 499e9a3 Compare May 5, 2026 22:35
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 5, 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 499e9a3 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