feat(runway): resolve merge targets per queue and provision their checkouts - #544
Open
behinddwalls wants to merge 1 commit into
Open
feat(runway): resolve merge targets per queue and provision their checkouts#544behinddwalls wants to merge 1 commit into
behinddwalls wants to merge 1 commit into
Conversation
This was referenced Aug 7, 2026
behinddwalls
marked this pull request as ready for review
August 7, 2026 18:23
behinddwalls
force-pushed
the
sq/runway-merge-targets
branch
from
August 7, 2026 18:36
46d6ad4 to
b976f26
Compare
behinddwalls
force-pushed
the
sq/runway-merge-targets
branch
from
August 7, 2026 21:21
b976f26 to
d7ebb8b
Compare
behinddwalls
force-pushed
the
sq/runway-merge-targets
branch
from
August 7, 2026 22:05
d7ebb8b to
33afcf6
Compare
behinddwalls
force-pushed
the
sq/runway-merge-targets
branch
from
August 7, 2026 22:20
33afcf6 to
ed99818
Compare
…ckouts ## Summary ### Why? Three things stopped Runway from performing a real merge. It resolved one merger for the whole process, so a deployment could serve only one repository. Nothing created the checkout the git merger requires, which it declares must already exist. And the container had no `git` binary, while the merger demanded three absolute runtime paths — so enabling it failed at startup with `git runtime executable is required` rather than working. ### What? Merge targets come from `MERGE_CONFIG_PATH`, a YAML file with a `defaults` block and per-queue overrides. Each git target is provisioned at startup — repository initialised, remote configured, credential written, target branch checked out — idempotently, so a restart against a persisted volume costs nothing and a rotated token takes effect. The existing `MERGE_*` environment variables still configure a single target when no file is given. Two queues naming one checkout resolve to the *same* merger instance, which is what serializes them: a git merger locks the working tree it owns, and two instances over one tree would reset it out from under each other mid-merge. Naming one checkout for two different targets is rejected at startup. The credential never enters the remote URL. The merger folds git's stderr into the errors it returns, so a URL-embedded token would be reprinted into logs and dead-letter payloads by any failed fetch. It is written as an HTTP `Authorization` header into a `0600` config fragment the repository includes — which keeps it off the command line too. SSH needs no code at all: the merger already passes `SSH_AUTH_SOCK` and `GIT_SSH_COMMAND` through its scrubbed environment. The git runtime is derived from the installed git when unset — executable from `PATH`, exec path from `git --exec-path`, templates from the matching install prefix — so the pinning safeguard stops being a boot-time trap. `git` is installed in the image. ## Test Plan ✅ `bazel test //service/runway/server:go_default_test` — provisioning runs against real git (pinned, as the merger does): clone into an empty directory, idempotent re-run, drifted remote URL corrected, non-default target branch, credential written `0600` and absent from the remote URL, stale fragment removed, unset token rejected, and git-runtime derivation with and without the environment overrides. # Conflicts: # service/runway/server/main.go
behinddwalls
force-pushed
the
sq/runway-merge-targets
branch
from
August 7, 2026 23:24
ed99818 to
d1274fe
Compare
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
Why?
Three things stopped Runway from performing a real merge. It resolved one merger for the whole process, so a deployment could serve only one repository. Nothing created the checkout the git merger requires, which it declares must already exist. And the container had no
gitbinary, while the merger demanded three absolute runtime paths — so enabling it failed at startup withgit runtime executable is requiredrather than working.What?
Merge targets come from
MERGE_CONFIG_PATH, a YAML file with adefaultsblock and per-queue overrides. Each git target is provisioned at startup — repository initialised, remote configured, credential written, target branch checked out — idempotently, so a restart against a persisted volume costs nothing and a rotated token takes effect. The existingMERGE_*environment variables still configure a single target when no file is given.Two queues naming one checkout resolve to the same merger instance, which is what serializes them: a git merger locks the working tree it owns, and two instances over one tree would reset it out from under each other mid-merge. Naming one checkout for two different targets is rejected at startup.
The credential never enters the remote URL. The merger folds git's stderr into the errors it returns, so a URL-embedded token would be reprinted into logs and dead-letter payloads by any failed fetch. It is written as an HTTP
Authorizationheader into a0600config fragment the repository includes — which keeps it off the command line too. SSH needs no code at all: the merger already passesSSH_AUTH_SOCKandGIT_SSH_COMMANDthrough its scrubbed environment.The git runtime is derived from the installed git when unset — executable from
PATH, exec path fromgit --exec-path, templates from the matching install prefix — so the pinning safeguard stops being a boot-time trap.gitis installed in the image.Test Plan
✅
bazel test //service/runway/server:go_default_test— provisioning runs against real git (pinned, as the merger does): clone into an empty directory, idempotent re-run, drifted remote URL corrected, non-default target branch, credential written0600and absent from the remote URL, stale fragment removed, unset token rejected, and git-runtime derivation with and without the environment overrides.Stack