fix(automation): fix jq quoting error in pr-triage.sh#16958
fix(automation): fix jq quoting error in pr-triage.sh#16958bdmorgan merged 2 commits intogoogle-gemini:mainfrom
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Summary of ChangesHello @Kimsoo0119, 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 resolves a critical Highlights
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
This pull request correctly resolves a jq syntax error within the pr-triage.sh script. The error was caused by improper shell quoting of backslashes inside a single-quoted string. The proposed fix, which uses jq's native null keyword and the tostring function, is a robust and idiomatic solution that avoids shell quoting complexities altogether. The change is clear, well-explained, and effectively fixes the failing audit-prs workflow. The change is approved.
The previous change incorrectly escaped quotes inside single-quoted strings. In bash single quotes, backslash escapes are not processed, so `\"null\"` is passed literally to jq, causing a syntax error: "unexpected INVALID_CHARACTER (Unix shell quoting issues?)" Fix by using jq's native `null` value with `tostring` instead of trying to embed a quoted string literal. Fixes the audit-prs workflow failure introduced in google-gemini#16657.
cee8646 to
4e60b0d
Compare
|
Thanks @Kimsoo0119 !! |
…16958) Co-authored-by: Bryan Morgan <[email protected]>
…16958) Co-authored-by: Bryan Morgan <[email protected]>
Summary
pr-triage.shaudit-prsworkflow has been failing since chore(automation): ensure status/need-triage is applied and never cleared automatically #16657 was mergedDetails
The previous change in #16657 incorrectly "fixed" quote escaping by adding backslashes inside single-quoted strings:
In bash single quotes, backslash escapes are not processed - they're passed literally. So jq receives
\"null\"instead of"null", causing:Fix: Use jq's native
nullvalue withtostring, which converts to the string"null"- avoiding shell quoting issues entirely.Related Issues
How to Validate
Pre-Merge Checklist