Repository navigation
feat: stop newly started reviews gracefully on Ctrl-C - #90
Open
am-saksham wants to merge 1 commit into
Open
am-saksham wants to merge 1 commit into
am-saksham wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds graceful
Ctrl-C(SIGINT) handling to CLI commands that poll a running review (review,findings --wait,scan,rerun,ci review, and Git hooks).Previously, interrupting a waiting review terminated the process immediately without printing the review link or stopping the remote job—leaving newly started reviews running and consuming credits on the server.
Changes
OnInterrupt) insrc/lib.rs:OnInterrupt::Stop— used only for newly created (!existing) local-patch, pushed-commit, named-file, and Git-hook reviews. Cancels polling immediately and sends a single boundedPOST /reviews/{id}/stop(5s timeout, never retried). PressingCtrl-Ca second time aborts immediately and prints the manualproofline stop <id>command and review URL.OnInterrupt::Detach— used for reused (existing: true) reviews, pull-request reviews,findings --wait,scan,rerun, andci review. Detaches without calling/stopand prints the console URL plusproofline findings --review <id> --wait.src/lib.rs,src/main.rs):Verdict::Interrupted, mapped to exit code130(128 + SIGINT).stderr, keepingstdoutclean for--jsoncallers.src/hooks.rs):pre-commitorpre-pushhook stops a newly requested hook review and exits130immediately rather than continuing to remaining refs or lettingmode = warnproceed.Cargo.toml):signalfeature.Verification
src/lib.rs): deterministicread_review_untiltests with injected interrupt futures covering:interrupt_with_stop_sends_one_stop_request_and_returns_interruptedinterrupt_with_detach_never_calls_stopinterrupt_with_stop_refusal_does_not_retry_and_returns_interruptedsecond_interrupt_aborts_hung_stop_immediatelytests/interrupt.rs): real UnixSIGINTsubprocess tests against anaxumloopback server covering:sigint_stops_newly_requested_local_review_and_exits_130sigint_detaches_reused_local_review_without_stopping_and_exits_130cargo fmt --check,cargo clippy --all-targets, andcargo test.