Repository navigation
fix(bump-submodules): end of input aborts instead of accepting every prompt - #1572
TimeToBuildBob wants to merge 5 commits into
Conversation
…prompt confirm() read an empty answer as "yes" (Enter accepts), and a failed read at end of input left answer empty. Every confirm call sits inside if/||, so set -e did not stop it: with stdin closed or not a terminal and no --yes, the script committed and pushed straight to master. Git-Session-Id: 686b7c0e-aee4-4c6e-bbb4-78e915e2bb44
[Medium impact] Safe to merge; running out of input no longer approves commits or pushes. SummaryThe submodule bump script now stops when a prompt runs out of input instead of treating it as approval.
Reviews (5) · Last reviewed commit: "fix(bump-submodules): clean up a failed ..." · Reviewed by Greptile |
Git-Session-Id: f12543bf-d72f-5ed6-97cb-cee929da5b44
This comment has been minimized.
This comment has been minimized.
🤖 AI code reviewThe PR changes confirm() to abort when read fails. It adds restore_relock() and an EXIT trap to restore uncommitted Cargo.lock changes after an aborted or failed relock. It also adds prompt and relock tests and runs them in the release workflow. Safe to merge — no P0/P1 findingsConfidence 5/5 ✅ No findings. The diff looks correct to me on this pass. Files changed (3) — the diff as I read it
Previous review passes
Reviewed Maintainer commands
|
Git-Session-Id: bb2dcf34-a2f6-4d48-9c9a-0a3159624584
This comment has been minimized.
This comment has been minimized.
Git-Session-Id: bb2dcf34-a2f6-4d48-9c9a-0a3159624584
This comment has been minimized.
This comment has been minimized.
Git-Session-Id: bb2dcf34-a2f6-4d48-9c9a-0a3159624584
|
@greptileai review |
confirm()inscripts/bump-submodules.shtreats an empty answer as yes (Enter accepts). Whenreadhits end of input it fails and leavesanswerempty. Everyconfirmcall sits insideifor||, soset -edoesn't stop the script. Running without--yesfrom a non-terminal stdin (an agent shell, cron,< /dev/null) therefore accepts every commit and push prompt. BecausePUSH=1is the default, those commits go straight tomaster.Fix: a failed
readnow aborts the run and tells you to pass--yesfor unattended runs. Interactive Enter/n/qwork as before.Test:
scripts/tests/test_bump_submodules.pyextractsconfirm()and runs it against real stdin. It is wired into the release workflow's test job next to the other script tests.ACCEPTED).Found in a packaging-scripts review; the reproduction was independently verified.