Skip to content

feat(runway): land GitHub stacks through the REST API - #807

Merged
roychying merged 1 commit into
mainfrom
github-merger
Oct 8, 2026
Merged

roychying merged 1 commit into
mainfrom
github-merger

Conversation

@behinddwalls

@behinddwalls behinddwalls commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Why?

Runway can only merge through a local git checkout. On github.com we want GitHub to do the merge, so that branch rules, PR state and stack rebasing stay GitHub's, including for native stacked PRs.

What?

  • New runway/extension/merger/github: each step is one GitHub stack, landed atomically with PUT /pulls/{top}/merge-async and then polled.
  • Lists that are not a GitHub stack based on the target are rejected at the mergeability check. Merge re-checks them before submitting.
  • Outputs are each PR's merge commit, read from its merged issue event, since API 2026-03-10 nulls merge_commit_sha.
  • Redelivery is safe: merged PRs are skipped, an in-flight request (409) is adopted, and a pending merge is retryable via Classifier.
  • Auth comes from the injected *http.Client. Runway config gains type: github, and runway now classifies HTTP errors.
  • Atomicity is per step, not per batch (see README).

Test Plan

✅ bazel test //runway/... //service/runway/... against a fake GitHub, plus config and disposition tests
✅ API behaviour confirmed with probes against github.com
✅ make lint check-gazelle check-tidy

Stack

  1. @ feat(runway): land GitHub stacks through the REST API #807
  2. test(submitqueue): land real GitHub PRs in CI e2e and integration tests #808

🤖 Generated with Claude Code

@behinddwalls
behinddwalls marked this pull request as ready for review October 7, 2026 20:26
@behinddwalls
behinddwalls requested review from a team and sbalabanov as code owners October 7, 2026 20:26
@behinddwalls behinddwalls changed the title test(submitqueue): land real GitHub PRs in the regular CI e2e and integration runs feat(runway): land GitHub stacks through the REST API Oct 7, 2026
@behinddwalls
behinddwalls added this pull request to stack #809 October 7, 2026 20:31
Comment thread runway/extension/merger/github/github_merger.go Outdated
Comment thread runway/extension/merger/github/client.go
Comment thread runway/extension/merger/github/github_merger.go
@behinddwalls
behinddwalls force-pushed the github-merger branch 3 times, most recently from eb1684f to a595fca Compare October 8, 2026 00:33
@behinddwalls
behinddwalls requested a review from mnoah1 October 8, 2026 00:34
## Summary

### Why?

Runway can only merge through a local `git` checkout. On github.com we want GitHub to do the merge, so that branch rules, PR state and stack rebasing stay GitHub's, including for native stacked PRs.

### What?

- New `runway/extension/merger/github`: each step is one GitHub stack, landed atomically with `PUT /pulls/{top}/merge-async` and then polled.
- Lists that are not a GitHub stack based on the target are rejected at the mergeability check. `Merge` re-checks them before submitting.
- Outputs are each PR's merge commit, read from its `merged` issue event, since API 2026-03-10 nulls `merge_commit_sha`.
- Redelivery is safe: merged PRs are skipped, an in-flight request (409) is adopted, and a pending merge is retryable via `Classifier`.
- Auth comes from the injected `*http.Client`. Runway config gains `type: github`, and runway now classifies HTTP errors.
- Atomicity is per step, not per batch (see README).

## Test Plan

✅ `bazel test //runway/... //service/runway/...` against a fake GitHub, plus config and disposition tests
✅ API behaviour confirmed with probes against github.com
✅ `make lint check-gazelle check-tidy`
@roychying
roychying added this pull request to the merge queue Oct 8, 2026
Merged via the queue into main with commit 1c54959 Oct 8, 2026
18 checks passed
@roychying
roychying deleted the github-merger branch October 8, 2026 17:14
Tmwakalasya pushed a commit to Tmwakalasya/submitqueue that referenced this pull request Oct 8, 2026
…ts (uber#808)

## Summary

### Why?

The merger's unit tests use a fake, which only encodes our reading of
GitHub's docs. These suites check the merger, and SubmitQueue's whole
land path, against real github.com on every CI run.

### What?

- `TestGitHubLandE2E`: gateway → orchestrator (GitHub change provider) →
Runway (GitHub merger). It lands a single PR and a stack, and rejects
PRs that are not a stack.
- Merger integration test: a full stack with redelivery, a partial
stack, non-stack lists, and a moved head.
- Shared `test/testutil/githubtestrepo` fixtures, which skip unless
`SQ_GITHUB_TOKEN` and `SQ_GITHUB_TEST_REPO` are set.
- CI: the `e2e` job and a new `merger-integration-test` job take the
test repo from the `SQ_GITHUB_TEST_REPO` repository variable and its
token from the `SQ_TEST_REPO_TOKEN` repository secret. The secrets guard
allows it as the only exception.
- `e2e-github-queue` is added to `queues.yaml` and to `MQ_TENANTS`.
- Any contributor can use their own test repo, locally or in their
fork's CI; `TESTING.md` lists what it needs. CI requires the token only
where `SQ_GITHUB_TEST_REPO` is set.

## Test Plan

✅ `TestGitHubLandE2E` 3/3 and the merger integration test 4/4 against
`behinddwalls/sq-demo`; no fixtures left behind
✅ `make lint check-gazelle check-tidy`



## Stack
1. uber#807
1. @ uber#808

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants