-
Notifications
You must be signed in to change notification settings - Fork 961
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
Bump github.com/vektra/mockery to v3.5.1 #6550
Conversation
@liaolecheng: The label(s) In response to this:
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. |
Welcome @liaolecheng! It looks like this is your first PR to karmada-io/karmada 🎉 |
There was a problem hiding this 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 |
There was a problem hiding this 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. Allgo:generate
directives have been updated to use this new configuration-driven approach. - Go Module and Tooling Adjustments: Updated
go.mod
andgo.sum
to reflect the Mockery v3 dependency and associated transitive dependencies. Corresponding updates were made inhack/tools/tools.go
andhack/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
-
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. ↩
There was a problem hiding this 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 ReportAttention: Patch coverage is
❗ 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
e52c342
to
d515ab0
Compare
cb92b34
to
d42f3a1
Compare
Signed-off-by: liaolecheng <[email protected]>
d42f3a1
to
868be81
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve
[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 |
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?: