Skip to content

Conversation

@xiaofan-luan
Copy link
Collaborator

issue: #46887

Add WithForce method to dropDropRoleOption to support force dropping roles.
This fixes the issue where force drop role functionality was not exposed
in the client SDK.

Signed-off-by: xiaofanluan <[email protected]>
@xiaofan-luan xiaofan-luan added the kind/bug Issues or changes related a bug label Jan 14, 2026
@sre-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: xiaofan-luan

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

The pull request process is described 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

@gemini-code-assist
Copy link

Summary of Changes

Hello @xiaofan-luan, 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 enhances the DropRole client API by introducing a forceDrop option. This new capability provides greater control when attempting to remove roles, particularly in situations where a standard drop operation might encounter obstacles. The change ensures that the client can explicitly request a forceful role deletion, improving the robustness and flexibility of role management operations.

Highlights

  • API Enhancement: Introduced a new forceDrop option to the DropRole client API, allowing for forceful removal of roles.
  • Code Structure Update: Modified the dropDropRoleOption struct to include a forceDrop boolean field and updated its Request() method to pass this flag to the underlying milvuspb.DropRoleRequest.
  • Fluent API Addition: Added a WithForce(force bool) method to dropDropRoleOption to provide a fluent way to set the forceDrop flag.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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 by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

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 pull request 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 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. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

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.

@sre-ci-robot sre-ci-robot added the size/S Denotes a PR that changes 10-29 lines. label Jan 14, 2026
@mergify mergify bot added the dco-passed DCO check passed. label Jan 14, 2026
@sre-ci-robot
Copy link
Contributor

[ci-v2-notice]
Notice: New ci-v2 system is enabled for this PR.

To rerun ci-v2 checks, comment with:

  • /ci-rerun-code-check // for ci-v2/code-check
  • /ci-rerun-build // for ci-v2/build
  • /ci-rerun-ut-integration // for ci-v2/ut-integration, will rerun ci-v2/build
  • /ci-rerun-ut-go // for ci-v2/ut-go, will rerun ci-v2/build
  • /ci-rerun-ut-cpp // for ci-v2/ut-cpp
  • /ci-rerun-ut // for all ci-v2/ut-integration, ci-v2/ut-go, ci-v2/ut-cpp, will rerun ci-v2/build
  • /ci-rerun-e2e-arm // for ci-v2/e2e-arm
  • /ci-rerun-e2e-default // for ci-v2/e2e-default

If you have any questions or requests, please contact @zhikunyao.

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 adds a forceDrop option to the DropRole client API. The implementation is straightforward and follows existing patterns. However, it is missing unit tests for the new functionality, which is a critical part of ensuring code quality. I've added a comment with details on the required tests.

Comment on lines +240 to +243
func (opt *dropDropRoleOption) WithForce(force bool) *dropDropRoleOption {
opt.forceDrop = force
return opt
}

Choose a reason for hiding this comment

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

high

This new WithForce method and the associated forceDrop option are not covered by unit tests. It's crucial to add tests to client/milvusclient/rbac_test.go to ensure this new functionality works as expected and to prevent future regressions.

Specifically, you should add test cases to TestDropRole to verify:

  1. When WithForce(true) is called, the ForceDrop field in milvuspb.DropRoleRequest is set to true.
  2. When WithForce is not called, the ForceDrop field defaults to false.

@codecov
Copy link

codecov bot commented Jan 14, 2026

Codecov Report

❌ Patch coverage is 40.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.41%. Comparing base (9373518) to head (2452893).

Files with missing lines Patch % Lines
client/milvusclient/rbac_options.go 40.00% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #47071      +/-   ##
==========================================
- Coverage   76.45%   76.41%   -0.05%     
==========================================
  Files        2016     2016              
  Lines      325600   325604       +4     
==========================================
- Hits       248951   248803     -148     
- Misses      68688    68810     +122     
- Partials     7961     7991      +30     
Components Coverage Δ
Client 75.65% <40.00%> (-0.03%) ⬇️
Core 82.89% <ø> (ø)
Go 74.75% <ø> (-0.07%) ⬇️
Files with missing lines Coverage Δ
client/milvusclient/rbac_options.go 90.54% <40.00%> (-0.97%) ⬇️

... and 30 files with indirect coverage changes

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

@mergify mergify bot added the ci-passed label Jan 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved ci-passed dco-passed DCO check passed. kind/bug Issues or changes related a bug size/S Denotes a PR that changes 10-29 lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants