Repository navigation
Review pushed branches side by side, not one after another - #172
Open
ammartahamohamedy wants to merge 2 commits into
Open
ammartahamohamedy wants to merge 2 commits into
ammartahamohamedy wants to merge 2 commits 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.
Fixes #171
Problem
hook run pre-pushrequested a branch's review, polled it until it finished or the hook's deadline passed, and only then requested the next branch, looking the repository up again each time. A push therefore took the sum of its reviews plus each one's poll lag. With longer reviews, a later branch could be reported "still running" only because an earlier one had used the shared deadline. The progress line (Review is RUNNING; checking again in N seconds.) didn't say which branch it meant.Fix (
src/hooks.rs)runnow finishes every branch's local checks before the first upload; they used to alternate. It still connects once, and only if something needs a review.reviewruns one future per branch: upload the patch, then poll its review. Atokio::sync::Mutexis held only for the upload, so uploads still go one at a time and in Git's order, and each accepted review is read at once, while later branches upload.requestlooks the repository up once per push; the mutex holds its ID. A failed lookup is retried for the next branch, as before.waitreads one review the wayread_reviewdoes (the samepoll_untilandread_review_once, so the same schedule and deadline rules), and names the branch on each progress line:Review of feature is RUNNING; checking again in 20 seconds.read_reviewitself is unchanged.join_allis a small helper that polls the branches' futures together on the current task. The runtime is single-threaded,JoinSet::spawnneeds'staticfutures, and the crate has nofuturesdependency.Measurements (Windows 11, release builds of
fecf6c6and this branch)Live, against proofline.sh: the same three-branch push with fresh patches, one run of each build back to back. Each review finished about 3 s after it was requested. An earlier
fecf6c6run took 20.92 s.fecf6c6Review is PENDING; …Review of live-a is PENDING; …,… live-b …,… live-c …Stand-in console: each review completes after the given time; 300 s default timeout; median of 3 runs.
fecf6c6One-branch client time, against an instant stand-in (medians of 100 runs per build, alternating): pre-push 168.9 ms before, 166.3 ms after; pre-commit 292.2 ms before, 289.6 ms after. No measurable change.
Tests (written first)
a_push_requests_every_branch_before_any_review_finishes(new,tests/hooks.rs)progress_lines_name_the_branch_they_are_about(new)Review of featureorReview of main, and both appeara_slow_later_upload_does_not_hide_an_earlier_finding(new, from the fork review)mode=blockandonIncomplete=warnthe push is blocked, the first read starts before the second upload ends, and the uploads don't overlapThe first two fail on
fecf6c6. The third passes there and fails on this PR's first version, which let the push through.Mutation checks: looking the repository up for every branch, an unnamed progress line, holding the mutex through the wait, and overlapping uploads each fail a test.
Checks
cargo fmt --check: ✅cargo clippy --locked --all-targets -- -D warnings: clean on Linux. On Windows,--all-targetsstops at the 2 errorsmainalready has (src/agent/tests.rs); the lib, the bins andtests/hooks.rsare clean.cargo test --locked --no-fail-fast:setup_brief_commands_are_available_in_this_release, which fails onmaintoo.fecf6c6, checked side by side (tests/mcp.rs×7,agent_install×2,update,local_patch, thehookspush-URL test, and the samesetuptest), and none in this change.cargo deny check: no dependency changes.check(Linux) andwindowspass on ammar-taha-dev/proofline-cli#11 at15667f0.Overlaps:
requesttoo; whichever lands second, I'll rebase.read_review's progress message; this PR leavesread_reviewalone.read_reviewcall inrequestthat this PR replaces; a small rebase for whichever lands second.Proofline review log
Fork review PR: ammar-taha-dev/proofline-cli#11. Rounds capped at 2.
read_review's documented rule and whatmaindoes15667f0)maincould have given it one full read after the deadlinemainhas the same cutoff whenever an upload lands just before the deadlinepoll_until's documented rule that a read still pending at the deadline is dropped. Letting a first read outlive the deadline would be a separate policy changeThe prompts below are the ones that drove this implementation; the benchmark, the reproduction, the fix scope and the assessment of the fork review were done outside them and aren't included.