Skip to content

Conversation

@swghosh
Copy link

@swghosh swghosh commented Oct 3, 2025

Adds input params similar to oc adm must-gather flags.

@coderabbitai
Copy link

coderabbitai bot commented Oct 3, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link

Summary of Changes

Hello @swghosh, 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 refactors the plan_mustgather tool by renaming its file and updating its input parameters to more closely resemble the flags available in oc adm must-gather. The changes introduce a comprehensive set of new options for controlling must-gather operations, such as specifying node selectors, host network usage, image lists, and timeouts. While the input schema has been expanded, the underlying handler logic requires further updates to fully utilize these new parameters.

Highlights

  • Tool Refactoring and Renaming: The must_gather_plan tool has been refactored, its implementation moved to a dedicated mustGatherPlan function, and the tool itself renamed to plan_mustgather.
  • Expanded Input Parameters: The input schema for the plan_mustgather tool has been significantly updated to include new parameters such as node_selector, host_network, all_component_images, images, source_dir, timeout, namespace, keep_namespace, and since, offering more detailed control over must-gather operations.
  • Removed Obsolete Parameters: The previous image, dest_dir, and image_stream parameters have been removed from the tool's input schema.
  • Added Tool Annotations: New metadata annotations (e.g., Title, ReadOnlyHint, IdempotentHint) have been added to the plan_mustgather tool for better context and description.
  • Handler Logic Discrepancy: While the input schema has been updated, the mustGatherPlan handler function still references the old image, dest_dir, and image_stream parameters, and contains a TODO comment indicating that further updates are needed to fully utilize the new input parameters.
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.

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 updates the plan_mustgather tool to support more parameters similar to oc adm must-gather. While the new schema for the tool is a good improvement, the implementation has several critical issues. The handler function for the tool has not been updated to use the new parameters, and still references old, removed parameters, making it non-functional. There is also a missing import that will cause a compilation failure. I've left detailed comments on these issues. Additionally, I've pointed out a missing parameter in the new schema and an unused function parameter.

@swghosh swghosh force-pushed the collect-mg branch 3 times, most recently from b72b5fb to a52f04f Compare October 10, 2025 08:42
…lusterOperator annotations

Signed-off-by: Swarup Ghosh <[email protected]>
@swghosh
Copy link
Author

swghosh commented Oct 10, 2025

/gemini review

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 significantly enhances the plan_mustgather tool by adding more input parameters, aligning it more closely with oc adm must-gather. This is a valuable improvement. However, the new implementation introduces several critical issues, including a compilation error due to a missing import, unsafe type assertions that can cause panics, and a logic bug in container creation that will lead to a crash. I've provided suggestions to fix these critical problems. Additionally, I've included some medium-severity recommendations to improve performance and robustness in areas like namespace checking and argument parsing.

}

if err := clusterOperatorsList.EachListItem(appendImageFromAnnotation); err != nil {
return images, err

Choose a reason for hiding this comment

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

medium

When an error occurs while iterating through the list, the function returns a partially populated images slice. It's generally better to return no results (nil) on error to avoid consumers processing incomplete data. This also applies to the error handling for csvList on lines 429 and 433.

return nil, err

Copy link
Author

Choose a reason for hiding this comment

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

this is intentional.

@swghosh
Copy link
Author

swghosh commented Oct 10, 2025

closing in favor of openshift#51

@swghosh swghosh closed this Oct 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant