Repository navigation
pr:review over REST only, with --once for cloud sessions - #224
Merged
Merged
Conversation
…h pnpm ci:test-files to dispatch and read it over REST
…ems 1 and 4) scripts/cloud-setup.sh, run by the project SessionStart hook only when CLAUDE_CODE_REMOTE=true, installs the Node every workflow pins and the pnpm of packageManager, then pnpm install --frozen-lockfile and pnpm setup:git, which now also turns rerere off. DRAGON_REQUIRE_NATIVE=1 turns a native run with a missing toolchain from blocked (owner tooling) into a failure naming the tool, in runTarget and runHostLane, as CI's "No native run was blocked" step does.
…group; ci:test-files reads reports strictly and removes them
…then the merge drivers) floor-merge.test.ts pins pnpm setup:git to exactly what the landing driver sets; rerere.enabled false joins both, so the exact-equality check stays and covers the new line.
…_NATIVE=1, prove the Linux path in CI Review of 892a687: the hook now has no matcher, so it reruns after compact, clear and fork (compaction drops CLAUDE_ENV_FILE exports); in a cloud session the script writes export DRAGON_REQUIRE_NATIVE=1 to CLAUDE_ENV_FILE first (PM ruling) and fails without that file; only the summary line reaches stdout; npm --prefix; curl --retry-connrefused. ci.yml's checks job runs on ubuntu-24.04 and runs cloud-setup.sh twice before setup-node, checking Node, pnpm, the export, typecheck and no reinstall.
…oid ABI rebaseline - LAND_DEVICES, LAND_TEST and LAND_REGEN accept ci-only; LAND_CI=only sets all three. Under ci-only GitHub Actions not running a step is a CiOutage: the driver stops, fails no PR, and every PR not landed stays queued (status: STOPPED BY A CI OUTAGE). All three ci-only skips the priority and quiet files; the leases are only on local paths, which ci-only never reaches. - awaitOnCi tells a run queued for runners (jobs queued, or the run pending) from one that never started: queued runs are waited for up to LAND_CI_QUEUE_WAIT (default 3 h); the run's own wait counts from its first job's start. - LAND_CI_MAX_INFLIGHT (default 2) caps the prepared CI regens a batch dispatches at once. - R3: a CI device run whose only model changes are Android image ABI changes is an architecture rebaseline, logged loudly and recorded in the landing; each changed lane must keep the previous state and exactly its failures. Under LAND_DEVICES=ci a local fallback onto records of another ABI stops the driver instead of blaming the PR.
# Conflicts: # scripts/land.ts
…after the CI rebaseline lands
…re; a nonce finds the dispatched run; every test vitest collects must run; the setup test covers env, vitest command and blocked scan
…review) A macOS job waiting for a runner while the Ubuntu jobs ran is queued, under LAND_CI_QUEUE_WAIT from when it was first seen waiting; a running job has the step's wait from its own start; a run with jobs done but not completed is waited for up to the queue wait. Under LAND_CI=only, the PR's own CI never running or never finishing is a CiOutage. Unreadable previous device records in the ci-mode fallback refusal stop the driver (Fatal) instead of blaming the PR.
Commands: pnpm regen; pnpm run parity:devices; pnpm regen
…racking, no rebase of pushed prep
…s on the clean head; audit before the PR; direct-push rebase
Cloud session bootstrap and DRAGON_REQUIRE_NATIVE (cloud migration items 1 and 4)
Commands: pnpm regen
Commands: pnpm regen
Commands: pnpm regen
…missing mergeable, GH_REPO host, open PR only)
test-files.yml: run chosen test files on their full-test runners, dispatched and read over REST by pnpm ci:test-files
Land: ci-only mode (LAND_CI=only), queued CI runs waited for, CI Android ABI rebaseline
Lane contract and AGENTS.md steps 2-4 for cloud lanes (cloud migration item 5)
Commands: pnpm regen
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.
Cloud sessions reach GitHub through a proxy that allows REST only.
pnpm pr:reviewused GraphQL (gh repo view --json,gh pr view --jsonthree times), so it failed there. This PR ports it to REST and adds a single-poll mode. land.ts, land-lib.ts and merge-train*.ts are untouched; their call sites get ported in a later PR (#220 and #222 are changing land.ts).What changed
scripts/gh-rest.ts(new): typed helpers overgh api, REST only. The repo comes fromGH_REPO([HOST/]OWNER/REPO) or from the origin remote URL (https, ssh, scp-style, or a proxy URL ending in/owner/repo). Helpers:repo,prView(state OPEN/CLOSED/MERGED, head sha and ref, base, mergeable, labels, body, draft, fork),prFiles,prCommits,prList(base?),prForBranch,prCreate,addLabels,removeLabel,issueComment,prSetBase,prMerge(pr, sha)(PUT pulls/<n>/mergewith theshaguard, so GitHub refuses a moved head),checkRuns(sha),prComments, andreviewComments. All list endpoints use--paginate --slurp.mergeable_state: "dirty"ormergeable: falsemaps to CONFLICTING,mergeable: nullto UNKNOWN, and anything else to MERGEABLE. On 12 live PRs it matchedgh pr view --json mergeable: 216, 214, 210, 208, 206, 203 and 200 are CONFLICTING; 218, 212, 198, 196 (unstable) and 194 are MERGEABLE.gh-rest: unexpected pull.head.sha).gh()wrapper. Writes never retry, since a retried POST could post twice. A malformed answer is never retried.scripts/pr-review.ts: every gh call now goes through gh-rest. The no-argument form finds the current branch's PR withpulls?head=owner:branch, taking the open one or else the newest. The verdict logic is unchanged and still comes entirely frompr-review-vouch.ts: CI wait, Macroscope review of the latest commit, vouched skips, UNREVIEWED, unanswered findings,--conflicts-ok, and exit codes.--onceflag: polls a single time and exits 0 if clean, 1 if not clean, or 2 if pending. Pending means notsettled(), the point where--waitwould poll again. A cloud session can loop on it within its 30-minute command limit.--onceand--waittogether is an error.now, so--oncecan never print a clean verdict and also exit 2.scripts/pr-review-vouch.ts: addsonceExit, plus the UNKNOWN andIGNOREDhandling described in round 2.parsePrHead,parsePrCommitsandparseCrossRepositorystay because land.ts and merge-train.ts use them.Round 2: an UNKNOWN mergeability is pending (Claude review, Medium)
This bug predates this PR. While GitHub is still computing mergeability (REST
mergeable: null, GraphQLUNKNOWN),settled()andoutcome()treated it as clean, sopr:reviewcould exit 0 on a conflicting PR.--conflicts-okis now pending.settled()is false, so--waitpolls again and--onceexits 2.outcome()listsmergeability of <sha> (GitHub has not computed it yet)under "Still running", so a single poll exits 1. A failed check still ends the wait.--conflicts-okstays separate:judgedHeadnow marks the headIGNOREDrather than reusing UNKNOWN. That covers CONFLICTING or UNKNOWN under--conflicts-ok, and any PR that is no longer open, because GitHub reports null for every merged PR.IGNOREDis judged on the checks alone. Merged PRs keep their exit 0, and land.ts's--wait --conflicts-okadmission behaves as before.mergeable: false, mergeable_state: dirty. Once GitHub had recomputed, old and new matched (table below).parsePullthrowspull.mergeable (missing)when the field is absent. List endpoints and write answers useparsePullSummary, which has no mergeable field.GH_REPOwith a host other than github.com is refused, since every call goes to github.com.Equivalence on real PRs (read-only, head 8a353d9)
The old script is origin/master's
scripts/pr-review.ts, run from the main checkout with its ownpr-review-vouch.ts(unchanged on origin/master). Both ran back to back without--wait, then the new one ran again with--once. "Output" compares stdout and stderr byte for byte.--once--conflicts-ok--conflicts-okPRs 30, 31 and 1 report pending under
--oncebecausesettled()is false there: CI or the correctness check is still missing.--waitkeeps polling in exactly those states.With no PR number, both versions resolved #224 from the branch. The new script also ran over every PR from 1 to 212 (round 1) with no errors.
Tests
packages/parity/test/gh-rest.test.ts:GH_REPOprecedencepackages/parity/test/pr-review.test.ts: thejudgedHeadtest now expectsIGNOREDinstead of UNKNOWN; that was the requested change. New tests cover UNKNOWN as pending (settled false, exit 1,--once2, a failure still ends the wait) and IGNORED from--conflicts-okor a closed PR passing on the checks alone. It also adds "pr-review over REST", using the existingrun()andHEADfakes and a fakeghthat serves REST JSON with no network. It covers clean, an unanswered finding, an answered finding, pending (exit 1,--once2), dirty with and without--conflicts-ok, UNREVIEWED, and malformed REST answers. It also adds a grep test that fails ifpr-review.tsorgh-rest.tsnames a GraphQL-using gh subcommand ('pr', 'view'-style argument pairs,gh pr …text) or "graphql". This test fails on origin/master's pr-review.ts.No existing test, tolerance or check was changed or removed.
What passed
pnpm typecheckpnpm exec vitest runon these test files, plus land and merge-train, 232 tests:This PR was itself opened with
ghRest().prCreate(POST repos/…/pulls).🤖 Generated with Claude Code