Skip to content

Bump github.com/vektra/mockery to v3.5.1 #6550

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 18, 2025

Conversation

liaolecheng
Copy link
Contributor

@liaolecheng liaolecheng commented Jul 17, 2025

What type of PR is this?
/kind cleanup

What this PR does / why we need it:
This upgrade follows the security fix referenced in vektra/mockery#1086 to address the identified security concern.

Which issue(s) this PR fixes:
Part of #6489

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

Dependencies: Upgraded vektra/mockery to v3.5.1, switching to a configuration-driven approach via mockery.yaml and removing deprecated v2 flags like --inpackage and --name.

@Copilot Copilot AI review requested due to automatic review settings July 17, 2025 09:26
@karmada-bot
Copy link
Collaborator

@liaolecheng: The label(s) kind/dependency-upgrade cannot be applied, because the repository doesn't have them.

In response to this:

PR: Upgrade mockery dependency from v2.53.3 to v3.5.1

What type of PR is this?

/kind dependency-upgrade

What this PR does / why we need it:

This upgrade follows the security fix referenced in vektra/mockery#1086 to address the identified security concern.

Changes:

  • Configuration Format: V3 requires an explicit configuration file. A new mockery.yaml file has been added to the repository to define mock generation rules. In v2, this was optional and relied on command-line flags, which are now deprecated.
  • Command-Line Flags: Some v2-era flags (e.g., --inpackage, --name) are removed in v3. All go:generate directives have been updated to use the new configuration-driven approach.

Which issue(s) this PR fixes:

Bump Kubernetes dependency from v1.32.3 to v1.33.2

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.

@karmada-bot
Copy link
Collaborator

Welcome @liaolecheng! It looks like this is your first PR to karmada-io/karmada 🎉

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR upgrades the mockery dependency from v2.53.3 to v3.5.1 to address a security vulnerability. The upgrade requires migrating from command-line flag-based configuration to a configuration file-based approach that is mandatory in v3.

  • Adds new mockery.yaml configuration file to define mock generation rules
  • Updates go:generate directives to use configuration-driven approach instead of deprecated flags
  • Regenerates mock files with the new v3 mockery format and enhanced functionality

Reviewed Changes

Copilot reviewed 6 out of 394 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pkg/estimator/service/mockery.yaml New configuration file for mockery v3 defining mock generation settings
pkg/estimator/service/mock_EstimatorClient.go Regenerated mock with v3 format including new expecter pattern and improved type safety
pkg/estimator/service/doc.go Updated go:generate directive to use config file instead of command-line flags
hack/update-estimator-protobuf.sh Updated mockery installation path from v2 to v3
hack/tools/tools.go Updated mockery import path from v2 to v3
go.mod Updated mockery dependency and related transitive dependencies to v3.5.1

@karmada-bot karmada-bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Jul 17, 2025
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary of Changes

Hello @liaolecheng, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request primarily focuses on upgrading the mockery dependency to its latest major version, v3.5.1, to incorporate a critical security fix. This change necessitates significant updates to the mock generation process, moving from command-line flags to a dedicated configuration file, and involves a broad update of related Go module dependencies.

Highlights

  • Dependency Upgrade: Upgraded the github.com/vektra/mockery dependency from v2.53.3 to v3.5.1. This upgrade addresses a security vulnerability identified in Mockery v2.
  • Mockery Configuration Update: Introduced a new mockery.yaml configuration file to define mock generation rules. Mockery v3 requires an explicit configuration file, deprecating the command-line flags used in v2. All go:generate directives have been updated to use this new configuration-driven approach.
  • Go Module and Tooling Adjustments: Updated go.mod and go.sum to reflect the Mockery v3 dependency and associated transitive dependencies. Corresponding updates were made in hack/tools/tools.go and hack/update-estimator-protobuf.sh to ensure tooling compatibility with Mockery v3.
  • Mock File Regeneration: The mock file pkg/estimator/service/mock_EstimatorClient.go has been regenerated to align with Mockery v3's output format and internal logic, including changes to method signatures and helper structs.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly upgrades github.com/vektra/mockery from v2 to v3 to address a security fix. The changes accurately reflect the migration from command-line flags to the new mockery.yaml configuration file, and all related go:generate directives and scripts have been updated accordingly. The overall change is well-executed and improves the project's security and tooling. I have one minor suggestion to adjust the log level for a better developer experience.

@codecov-commenter
Copy link

codecov-commenter commented Jul 17, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 0% with 96 lines in your changes missing coverage. Please review.

Project coverage is 45.40%. Comparing base (cf45b57) to head (868be81).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
pkg/estimator/service/mock_EstimatorClient.go 0.00% 96 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6550      +/-   ##
==========================================
- Coverage   45.45%   45.40%   -0.06%     
==========================================
  Files         687      687              
  Lines       56335    56397      +62     
==========================================
- Hits        25607    25605       -2     
- Misses      29131    29194      +63     
- Partials     1597     1598       +1     
Flag Coverage Δ
unittests 45.40% <0.00%> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@liaolecheng liaolecheng force-pushed the update/mockery-to-v3.5.1 branch from e52c342 to d515ab0 Compare July 17, 2025 09:49
@liaolecheng liaolecheng force-pushed the update/mockery-to-v3.5.1 branch 5 times, most recently from cb92b34 to d42f3a1 Compare July 18, 2025 02:44
Signed-off-by: liaolecheng <[email protected]>
@liaolecheng liaolecheng force-pushed the update/mockery-to-v3.5.1 branch from d42f3a1 to 868be81 Compare July 18, 2025 03:25
Copy link
Member

@RainbowMango RainbowMango left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Jul 18, 2025
@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: RainbowMango

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

The pull request process is described here

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

@karmada-bot karmada-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 18, 2025
@RainbowMango RainbowMango added this to the v1.15 milestone Jul 18, 2025
@karmada-bot karmada-bot merged commit f53dffe into karmada-io:master Jul 18, 2025
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants