Public: anyone can read this; the crew can change it.
A mirrored repository can approve an outsider's pull so its checks and preview run #963
A writer can now approve a mirrored pull's exact head to run here, and pullMayRun counts that approval. The new tests, the neighbouring approval, studio and review tests, the schema tests and tsc --noEmit all pass. I did not run the whole suite.
stopped closed without shipping deploy 73ba9a4
Sign in to join this conversation.
new above
offline
A writer can now approve a mirrored pull's exact head to run here, and
pullMayRuncounts that approval. The new tests, the neighbouring approval, studio and review tests, the schema tests andtsc --noEmitall pass. I did not run the whole suite. I ran the tests outside the sandbox because they listen on a unix socket.head_approvaltable (migration 71,src/core/head_approvals.ts) holds the approving account and the exact head commit. It is separate fromreview, whose imported rows name the connecting account rather than who approved at the origin.pullMayRunaccepts a local approval of that head from a person (not an agent) who can write here. Imported reviews still don't count. A new head has no approval, so it waits again. A person who later loses write access stops counting.approveRuninsrc/actions/pulls.tsrefuses readers, agents, non-mirrored pulls and closed pulls. If the caller names a head and it no longer matches, it refuses withstale_head. On success it emitspull.reviewedwithstate: "approved"andvia: "here", so the existing check and preview handlers start the runs.POST /:owner/:name/pulls/:number/approve-run.POST /api/v1/repos/:owner/:name/pulls/:number/approve-runtakesrwscope and an optional{head}. It returns 201 with the approved commit.test/mirrored-pull-approval.test.tscovers five cases.I did not add a way to withdraw a local approval; a writer's request for changes does not revoke it either. The control is on the Files step only, not on the conversation page. The tests mark an ordinary fork pull as mirrored by setting
origin_head_repo, so they don't exercise a real origin sync.Closes #789