Repository navigation
Share pull-request readiness with Review runs - #2150
Merged
Merged
Conversation
Review's mergeability gate now delegates to the pull-request owner's ensure_review_ready, which shares snapshot validation and mergeability polling with ordinary Delivery and Fix. Review keeps its exact head and URL, the eligibility reads around each numbered observation, its unbounded interruptible wait and its conflict diagnostic.
Keep Review's single-line readiness diagnostic, compare the captured URL without rebuilding the pull request URL, assert each refusal during Unknown polling and cover a head commit moved on a later poll.
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
Review's mergeability gate now goes through the pull-request owner. Ordinary Delivery, Fix and Review share one implementation of snapshot validation and mergeability polling. Review's stronger rules live in a private
Readinesscontext, so callers pass no flags.What stays the same:
pull request changed during Review run readiness,captured pull request disappeared during Review runand the conflict text. A merged target is still a failed check, neverAlreadyMerged.GitHubnow derivesClone, so Review can hand the owner an adapter that keeps its interruption policy.docs/code-navigation.mdnow names the shared readiness owner and its tests.Evidence
Execution evidence
e4471a29, the Spec review's diagnostic finding):cargo test --bin thirdshift pull_request::tests::review_readiness_refusal_keeps_its_single_line_diagnostic1b4db089):cargo test --bin thirdshift pull_request::testsensure_review_readyandensure_ready_and_mergeable. They cover:AlreadyMerged;cargo test --test review_run:test result: ok. 37 passed; 0 failed; 2 ignored.cargo clippy --all-targetsreports no warnings.node:22(Debian) container with the host's rustup toolchain.scripts/affected-tests origin/mainselects the full Rust suite. I passedorigin/mainbecause the localmainref is stale; withmainthe selector also picked up unrelated site changes.cargo test --no-fail-fast: 4414 passed, 103 failed.origin/mainin the same container gave 100 of those 103 failures. They come from the container itself: a session-sweepPermission deniedwarning, andcould not identify the Unix user, because the uid has no passwd entry there.activity_log,launch_pull) passed when rerun on this branch. Their earlier failures came from the same intermittent sweep warning.Merge Danger
Door: two-way
A behaviour-preserving refactor with no data, config or migration changes. Reverting the two commits restores the old Review loop.
Blast Radius: readiness
Every Self-merge (Ticket and Fix Delivery) and every Review run's push and final readiness pass through the changed loop. For Review, the observation now selects the PR by number instead of URL, as ordinary Delivery already does.
Unaddressed findings
Review reports: Standards 8 findings, Spec 5. Addressed:
docs/code-navigation.mdis fixed.PullRequestUrl.Standards
compatible/unchanged_head. Declined. The spec keeps those owners: "Review's checks before push and after posting its result, CI watch, Repair accounting … continue unchanged", and decision 10 says "push, CI watch, Repairs, result posting, recommend-only checks and final head guards stay with their existing owners". Only the readiness gate moves (src/processes/review/delivery.rs,require_mergeable).Readiness, and a no-op eligibility call for Delivery. Declined. Decision 5: "Generalize the private settled-readiness implementation, not the public interface with flags … The internal context carries the genuine differences". Decision 7 requires the shared module to own the read order (settled_ready_snapshotinsrc/pull_request.rs). A separate Review loop would bring back the second polling implementation that the issue deletes.Mergeable::Unknownarm inensure_review_ready. Declined. It nowbail!s with the ordinary "has not worked out" message rather than panicking. A new settled-mergeability type would widen the shared snapshot format, which decision 6 rules out: "No additional transport abstraction or expanded mergeability snapshot format is required."#[derive(Clone)]onGitHub. No change needed; the reviewer accepted it. A clone keeps the caller's interruption policy (src/github.rs,struct GitHub).src/pull_request.rs. Declined. Decision 1 is "Concentrate readiness in the existing pull-request module", and the module doc and navigation entry say so.Spec
#[derive(Clone)]onGitHubis scope creep. Declined. It is the smallest way to givePullRequest::on_pull_requestan owned adapter with the Review run's interruption policy (decision 4: "Review can construct the numbered owner from its captured pull request"). It changes no behaviour, and the Standards reviewer accepted it.Security
None unaddressed. The Security review compared Review readiness before and after the change. It found the same exact-head, exact-URL, number, branch-name, open, draft, fork and Trusted-account refusals, with the eligibility read on every poll, and no new trust boundary.
No finding needed a Spec or Day shift decision, so I filed no issue.
Review coverage: both reviewers read all four changed files. There are no generated-output exclusions and no unread changed files.
Closes #2149
Built with claude 2.1.322 · claude-opus-5-5 · high
Security review outcome
No unaddressed introduced findings.