fix(scripts): backticks in a double-quoted echo run as command substitution - #492
fix(scripts): backticks in a double-quoted echo run as command substitution#492hyperpolymath wants to merge 3 commits into
Conversation
…tution Line 19 wrapped an example in backticks inside a double-quoted string. Backticks there are COMMAND SUBSTITUTION, so bash tried to execute '+ uses: …@<sha>' and printed the message with the example silently deleted. Switched to single quotes. Same defect class as hyperpolymath/Axiom.jl#82. Found by an estate-wide shellcheck sweep of 5,111 tracked scripts across 375 repos. This file was one of 11 that fail to PARSE (SC1073/SC1072) — shellcheck stops analysing at the failure, so anything after it was never checked either. Verified: shellcheck -S error now reports 0 findings for this file.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📜 Recent review details⏰ Context from checks skipped due to timeout. (3)
|
| Layer / File(s) | Summary |
|---|---|
Skip message quoting scripts/fix-close-obsolete-pr.sh |
The no-pinned-uses: skip message now emits literal backticks. Bash no longer attempts command substitution. |
Estimated code review effort: 1 (Trivial) | ~2 minutes
Merge Risk: ⚪ Minimal · up to 33454
This is a localized shell-script quoting fix with no actionable merge-blocking risk remaining after normal checks and review.
Poem
A rabbit checks the shell with care
Backticks now remain in place
The message stays clear
No command runs here
One small fix rests there
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
| Check name | Status | Explanation |
|---|---|---|
| Title check | ✅ Passed | The title clearly identifies the shell-script fix and the command-substitution defect caused by backticks. |
| Description check | ✅ Passed | The description accurately explains the Bash defect, the fix, and the verification result. |
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1… |
| Linked Issues check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
Full details: Docstring Coverage
Explanation
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
- Create stacked PR
- Commit on current branch
📝 Generate docstrings
- Create stacked PR
- Commit on current branch
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.
Comment @coderabbitai help to get the list of available commands.
Up to standards ✅🟢 Issues
|
There was a problem hiding this comment.
Pull Request Overview
The PR correctly identifies and addresses a command substitution bug in scripts/fix-close-obsolete-pr.sh where backticks within double quotes were being executed. However, the current solution of switching to single quotes has triggered a new ShellCheck warning, resulting in the PR being flagged as not up to standards by Codacy.
To resolve this and satisfy the linter while maintaining the fix, the backticks should be escaped within double quotes. Additionally, there is a lack of automated or manual verification scenarios provided in the code to ensure the output remains correct after these changes.
Test suggestions
- Execute the script with a PR diff containing no matching lines and verify the output is 'SKIP: PR has no
+ uses: …@<sha>lines' without shell execution errors.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Execute the script with a PR diff containing no matching lines and verify the output is 'SKIP: PR has no `+ uses: …@<sha>` lines' without shell execution errors.
TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback
Co-authored-by: codacy-production[bot] <61871480+codacy-production[bot]@users.noreply.github.com> Signed-off-by: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com>
Line 19 wrapped an example in backticks inside a double-quoted string. Backticks there are COMMAND SUBSTITUTION, so bash tried to execute '+ uses: …@' and printed the message with the example silently deleted. Switched to single quotes. Same defect class as hyperpolymath/Axiom.jl#82.
Found by an estate-wide shellcheck sweep of 5,111 tracked scripts across 375 repos. This file was one of 11 that fail to parse (
SC1073/SC1072) — shellcheck stops analysing at the failure, so everything after it was never checked either.Verified:
shellcheck -S errornow reports 0 findings for this file.