Skip to content

refactor(runway): compose the checkout git env from gitexec - #613

Merged
behinddwalls merged 1 commit into
mainfrom
preetam/runway-wiring-gitexec
Aug 19, 2026
Merged

refactor(runway): compose the checkout git env from gitexec#613
behinddwalls merged 1 commit into
mainfrom
preetam/runway-wiring-gitexec

Conversation

@behinddwalls

@behinddwalls behinddwalls commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

runGit in the Runway server's checkout provisioning kept its own copy of the scrubbed-plus-transport environment. Build it through gitexec.Env instead — the same source the merger uses — so provisioning and merging assemble an identical environment from one definition.

This also closes a gap the two hand-written copies had already opened: provisioning omitted GIT_ATTR_NOSYSTEM and the no-pager/no-editor settings the merge path sets, so a system gitattributes file could influence the initial checkout but not later merge operations. Both now run under the same scrub set.

Provisioning also passes the runtime's PassthroughEnv through gitexec, as the merger already does, so a deployment whose remote needs an extra variable reaches it during the provisioning fetch and not merges alone. The field is unset today, so this only aligns the two paths rather than changing behavior.

Test Plan

//service/runway/server green. Provisioning and merge paths now assemble an identical git environment from one source.

Stack

  1. refactor(git): relocate platform/gitexec under platform/git #609
  2. feat(git/exec): a shared environment composer for git commands #610
  3. refactor(changeprovider): make the git provider pure logic over a contract #611
  4. refactor(merger): build the git command env from the shared composer #612
  5. @ refactor(runway): compose the checkout git env from gitexec #613

Comment thread service/runway/server/checkout.go
@behinddwalls
behinddwalls force-pushed the preetam/runway-wiring-gitexec branch from 1db5645 to 301e75f Compare August 19, 2026 15:38
@behinddwalls
behinddwalls force-pushed the preetam/runway-wiring-gitexec branch from 301e75f to 535e71e Compare August 19, 2026 17:10
@behinddwalls
behinddwalls force-pushed the preetam/runway-wiring-gitexec branch 2 times, most recently from a103541 to c7b5589 Compare August 19, 2026 18:49
Base automatically changed from preetam/merger-shared-gitexec to main August 19, 2026 18:50
runGit in the Runway server's checkout provisioning kept its own copy of the scrubbed-plus-transport environment. Build it through gitexec.Env instead — the same source the merger uses — so provisioning and merging assemble an identical environment from one definition.

This also closes a gap the two hand-written copies had already opened: provisioning omitted GIT_ATTR_NOSYSTEM and the no-pager/no-editor settings the merge path sets, so a system gitattributes file could influence the initial checkout but not later merge operations. Both now run under the same scrub set.

Provisioning also passes the runtime's PassthroughEnv through gitexec, as the merger already does, so a deployment whose remote needs an extra variable reaches it during the provisioning fetch and not merges alone. The field is unset today, so this only aligns the two paths rather than changing behavior.
@behinddwalls
behinddwalls force-pushed the preetam/runway-wiring-gitexec branch from c7b5589 to 3df2641 Compare August 19, 2026 18:50
behinddwalls added a commit to behinddwalls/submitqueue that referenced this pull request Aug 19, 2026
## Summary

Move the shared git-exec package and its pinned-git test helper under a
single platform/git umbrella: platform/gitexec becomes
platform/git/exec, and platform/gitexec/gitexectest becomes
platform/git/exectest — a sibling rather than nested, so the path no
longer doubles "gitexec".

Package names are unchanged (gitexec, gitexectest), so this is an
import-path move only: no call sites and no behavior change. It is the
first step toward housing the change provider's bare-copy repo and auth
plumbing alongside the shared git-exec package.

## Test Plan

✅ `bazel build`/`test` of the moved packages and every importer; `make
check-gazelle` clean; grep confirms no `platform/gitexec` (old path)
imports remain.

## Stack
1. @ uber#609
1. uber#610
1. uber#611
1. uber#612
1. uber#613
behinddwalls added a commit to behinddwalls/submitqueue that referenced this pull request Aug 19, 2026
)

## Summary

Add Env(EnvOptions) as the single place that builds a git command's
environment: the always-applied scrub set, plus transport variables
inherited from the parent when set (SSH agent, PATH, TLS, proxy), plus
caller-supplied literals appended last so they override. Re-express
Command in terms of Env so there is one composer, not two.

This gives the change provider's repository and the Runway merger one
source of truth to build on instead of each keeping its own copy of the
scrub set and transport list. HOME is intentionally excluded from the
shared transport list, since callers that isolate HOME and callers that
inherit it disagree; each supplies it through Literal or Passthrough.

## Test Plan

✅ new `gitexec` unit tests: scrub set always present, transport vars
inherited only when set, literals override, and `HOME` is absent from
the shared transport list. Existing `Command` consumers build unchanged.

## Stack
1. uber#609
1. @ uber#610
1. uber#611
1. uber#612
1. uber#613
behinddwalls added a commit to behinddwalls/submitqueue that referenced this pull request Aug 19, 2026
…tract (uber#611)

## Summary

Move the git transport plumbing — the bare local copy, fetch, commit
resolution, merge base, the git command environment — and the Auth
contract out of the change provider extension into platform/git/repo,
built on platform/git/exec. The provider now depends on a small
Repository interface it defines and holds no os/exec and no credential
handling: it parses the change URI, picks the stack baseline, reads the
diff and author, and shapes the result, nothing more.

Auth moves with the copy it configures, resolving the review point that
authentication did not belong in the change provider. The wiring's
tokenAuth now implements gitrepo.Auth and SetConfig is
gitrepo.SetConfig. Repository-plumbing tests move to platform/git/repo;
the provider's behavior tests stay and drive a real gitrepo.Repo through
the interface.

## Test Plan

✅ `//platform/git/...`,
`//submitqueue/extension/changeprovider/git/...`,
`//service/submitqueue/orchestrator/server/...` green (incl. the
three-step stack-baseline test); `provider.go` verified free of
`os/exec`.

## Stack
1. uber#609
1. uber#610
1. @ uber#611
1. uber#612
1. uber#613
behinddwalls added a commit to behinddwalls/submitqueue that referenced this pull request Aug 19, 2026
…ber#612)

## Summary

Replace the merger's inline command environment with gitexec.Env: the
isolated HOME/XDG and the pinned runtime paths stay as literals, while
the scrub set and the transport variables now come from
platform/git/exec, the one source of truth every git caller shares.
Delete the merger's own authEnvNames and passthroughEnv.

No control-flow change — the merger still owns its working-tree flow and
GitRuntime; only how each command's environment is assembled moves to
the shared composer.

## Test Plan

✅ full `//runway/extension/merger/git` suite green. Env-plumbing only —
no control-flow change to the land path.

## Stack
1. uber#609
1. uber#610
1. uber#611
1. @ uber#612
1. uber#613
@behinddwalls
behinddwalls added this pull request to the merge queue Aug 19, 2026
Merged via the queue into main with commit 97dc5da Aug 19, 2026
15 checks passed
@behinddwalls
behinddwalls deployed to stack-rebase August 19, 2026 19:37 — with GitHub Actions Active
@behinddwalls
behinddwalls deleted the preetam/runway-wiring-gitexec branch August 19, 2026 19:37
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.

2 participants