Fix Real Findings from the Promotion PR's Fresh Review Pass - #1047
Conversation
qodo-code-review and coderabbitai on PR #1046 (develop -> main), against the full diff menu.ps1 first introduced: - A failed non-default -Ref fetch or checkout left HUB_FETCHED unset, so final cleanup skipped the cloned hub and its ownership marker entirely, the same false-ownership hazard already fixed for the initial clone failure. HUB_FETCHED is now set the moment the initial clone lands, before -Ref's own fetch/checkout can fail. Fixed in both menu.ps1 and menu.sh. - An unrecognized menu choice returned exit code 2, which collided with a driven tool's own legitimate exit code 2 (scripts/carry.py's "repository is not uniquely registered", reproduced from this session's own earlier testing): Invoke-InteractiveMenu would silently swallow that tool's real failure as if the menu choice itself had been invalid. Replaced with a dedicated BAD_CHOICE flag, matching how QUIT is already kept apart from a return code. Fixed in both files. - Windows PowerShell 5.1 reading the script through Invoke-Expression (or a similar pipe) has an empty $PSCommandPath, and the PowerShell-7 handoff ran unconditionally before ever checking for a console, so a piped-in run could fail handing off to pwsh instead of reaching the "download and run it" message. Verified against a real Invoke-Expression on Windows PowerShell 5.1. Guarded in both menu.ps1 and bootstrap.ps1, which shares the same startup order; the repeated remedy text is now the shared Show-DownloadAndRunRemedy in each file. Declined on the same PR, with evidence in the thread: the header comment (same shape as menu.sh/bootstrap.ps1, already merged), and the mutex's release timing (same accepted trade-off as menu.sh's flock, already documented in the code).
PR Summary by QodoFix Host Menu Cleanup, Exit-Code Handling, and PowerShell Handoff
AI Description
Diagram
High-Level Assessment
Files changed (3) |
Code Review by Qodo🐞 Bugs (0)📘 Rule violations (0)📎 Requirement gaps (0)Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can reply 'qodo' on any finding to push back, ask questions, or dig deeper |
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 (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe host setup scripts now preserve cloned-hub cleanup state, separate invalid menu choices from task exit codes, and share download-and-run instructions for unsupported piped-in PowerShell execution. ChangesHost setup reliability
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk:⚪ Minimal · up to The PR makes targeted fixes to cleanup, exit-code handling, and PowerShell startup behavior; no actionable merge-blocking risk remains beyond normal checks and review. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Title checkExplanation The title accurately identifies the pull request as fixing findings from a review of the promotion PR. It is concise and related to the three bug fixes in the changeset, although it does not name each specific fix. Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 1 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
Summary
Fixes three real bugs the promotion PR's (#1046) fresh review pass over the full menu.ps1/menu.sh diff surfaced, in both files:
-Reffetch or checkout leftHUB_FETCHEDunset, so final cleanup skipped the cloned hub and its ownership marker entirely, the same false-ownership hazard already fixed for the initial clone failure on PR Add menu.ps1, the Windows Counterpart to menu.sh #1045.HUB_FETCHEDis now set the moment the initial clone lands, before-Ref's own fetch/checkout can fail.scripts/carry.py's "repository is not uniquely registered", reproduced from earlier testing on PR Add menu.ps1, the Windows Counterpart to menu.sh #1045):Invoke-InteractiveMenuwould silently swallow that tool's real failure as if the menu choice itself had been invalid. Replaced with a dedicatedBAD_CHOICEflag.Invoke-Expression(or a similar pipe) has an empty$PSCommandPath, and the PowerShell-7 handoff ran unconditionally before ever checking for a console, so a piped-in run could fail handing off topwshinstead of reaching the "download and run it" message. Guarded in bothmenu.ps1andbootstrap.ps1, which shares the same startup order.Two other findings on PR #1046 were declined with evidence in the review thread rather than fixed here: the file header comment (same shape as
menu.sh/bootstrap.ps1, already merged) and the mutex's release timing (same accepted trade-off asmenu.sh'sflock, already documented in the code).Verification
menu.ps1/bootstrap.ps1parse clean under both pwsh 7 and real Windows PowerShell 5.1, and lint clean againstPSScriptAnalyzerSettings.psd1.menu.shpassesbash -n.$PSCommandPathfix against a realInvoke-Expressionon Windows PowerShell 5.1: prints the download remedy instead of crashing the handoff. Confirmed no regression to the normal-Fileinvocation.HUB_FETCHED/cleanup fix and theBAD_CHOICEfix functionally in bothmenu.ps1andmenu.sh..husky/pre-commit(ruff, mypy, prose_lint, eol) passes clean.🤖 Generated with Claude Code
Summary by CodeRabbit