Skip to content

Conversation

@licliu
Copy link
Collaborator

@licliu licliu commented Nov 4, 2025

commit 1a73387(Strip surrounding quotes from configuration values) omitted modifications to kdump.sh.

Adds a POSIX-compliant case statement to remove the surrounding quotes.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @licliu, 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 robustness of the kdump.sh script by ensuring that configuration values enclosed in double quotes are correctly interpreted. It introduces a new parsing mechanism to remove these quotes, thereby preventing potential misconfigurations and improving the reliability of the kdump process. This completes a fix that was previously overlooked for this specific script.

Highlights

  • Configuration Value Parsing: Implemented a POSIX-compliant case statement within kdump.sh to automatically strip surrounding double quotes from configuration values during parsing.
  • Previous Omission Addressed: This change specifically addresses an omission from a prior commit (1a73387) which failed to apply similar quote-stripping logic to the kdump.sh script.
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.

commit 1a73387(Strip surrounding quotes from configuration values)
omitted modifications to kdump.sh.

Adds a POSIX-compliant `case` statement to remove the surrounding
quotes.

Assisted-by: Google Gemini
Signed-off-by: Lichen Liu <[email protected]>
Copy link
Contributor

@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 logic to kdump.sh to strip surrounding quotes from configuration values, which was missed in a previous commit. The approach of using a POSIX-compliant case statement is appropriate for this shell script. However, the implementation has a bug in the pattern matching that could lead to incorrect parsing of configuration values. My review includes a suggestion to fix this bug and also to make the quote stripping more robust by handling single quotes.

@licliu
Copy link
Collaborator Author

licliu commented Nov 4, 2025

Hi @prudo1, I realized that kdump.sh was overlooked in #116, so I submitted this patch. Thanks for reviewing!

Copy link
Collaborator

@prudo1 prudo1 left a comment

Choose a reason for hiding this comment

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

Hi Lichen,

true we missed this one... but we also missed an other one in mkdumprd...
That makes me think that it's probably better to remove the quotes in kdump_read_conf rather than in all its users. Although would probably mean to rewrite the function as adding it to the sed expression would most likely make it completely unreadable...

What do you think?

Thanks
Philipp

@prudo1
Copy link
Collaborator

prudo1 commented Nov 6, 2025

Hi Lichen,
I went down the rabbit hole and tried to reimplement kdump_get_conf_val and kdump_read_conf to strip the quotes and get rid of the horrible regexes. The implementation isn't perfect but it seems to work reasonably well.
There are two changes in behavior compared to the current implementation

  1. When the config value contains multiple spaces/tabs the current implementation leaves them unchanged. My implementation will merge them together in a single space.
  2. When a user wants one of multiple possible options the regex changed slightly. In particular the \| needs to be changed to a single |.

Anyway, I've pushed the changes to a branch on my fork in case you want to take a look at it.

Thanks
Philipp

@licliu
Copy link
Collaborator Author

licliu commented Nov 7, 2025

Hi @prudo1, thanks for reviewing this!

I had the same thought before submitting, and I agree that your suggestion is the correct approach.

The main reason I didn't implement it was my lack of confidence with regex. I needed to use an AI tool just to understand the current expression, as it was too long for me to verify manually.

Admittedly, this is in my current sprint, so I was hoping for a quick merge. However, you're right that my current implementation could cause bugs down the line. Your approach makes more sense.

I took a quick look at your code—since it's marked WIP, I didn't dive deep into the details to see if there are problems.

It makes the whole flow much clearer. I also felt before that kdump_read_conf and kdump_get_conf_val were doing redundant work, and it's been bothering me for a while.

I'm planning to remove this issue from my current sprint for now. To avoid duplicating our work, would you be willing to finish this patch?

Thanks,
Lichen

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.

2 participants