Commit 5349602
committed
feat(demo): one quickstart, three provider modes
## Summary
### Why?
The repository had two divergent local paths, and the quickstart documented the wrong one.
`make local-submitqueue-start` brings up an all-fake stack — fake change provider, fake CI, **noop merger** — and `doc/howto/QUICKSTART.md` (#591) described that. It reaches `landed` in seconds with no credentials, but nothing is ever pushed, so it proves the pipeline's choreography and nothing about merging. `make local-provider-start` runs the real thing, but was GitHub-only: it hardcoded the token-requiring overlay, so the credential-free provider configuration that already existed could not be reached by hand at all. `PROVIDER=local` failed at `docker compose up` on a missing `GITHUB_TOKEN`, and would have merged nothing even past that, since the overlay it needs bind-mounts a repository the other one has never heard of.
The two are not variants of one thing. Faking every edge and merging into a real repository answer different questions, and calling both "local" is what made them hard to keep apart.
### What?
`PROVIDER` now names three modes, and is the only thing that changes between them:
| `PROVIDER` | A change is | Landing it | Needs |
|---|---|---|---|
| `fake` (default) | a URI, and nothing else | reports success without touching a repository | nothing |
| `git` | a branch in a bare repository on disk | a real fetch, cherry-pick and push | nothing |
| `github` | a real pull request | a real push to a real repository | a repository and a token |
They are the tiers `PROVIDER-E2E.md` already named, so the documentation collapses into one ladder where every rung takes the same commands.
**Provider directories.** `demo/provider/local/` becomes `demo/provider/git/` — both old names were "local" — and gains a `demo-queue` entry so the default `QUEUE` works there. It needs its own `checkoutPath`: Runway refuses two queues that share a checkout with differing merger configuration, and `demo-queue` squash-rebases where `e2e-git-queue` rebases. A new `demo/provider/fake/` spells out the all-fake mode rather than leaving it implied by absent configuration. `e2e-git-queue` is untouched, and `make e2e-git-test` is the gate that proves it.
**Overlay per mode.** `PROVIDER_COMPOSE_FILE` becomes a map, since which overlay a mode needs is not something its two config files can express — `github` requires a credential, `git` requires the sandbox mounted, `fake` requires neither. A new `docker-compose.fake.yml` covers the third.
**`make demo-pr` works without GitHub.** `createOne` was the only function that touched the provider; it now describes a change and hands it to a `changeSource`. Three implement it: `fakeSource` (no I/O at all — mints a reproducible `git://` URI), `gitSource` (pushes real branches with the pinned `@git//:git`, serializing its commands because one working tree cannot take concurrent checkouts), and `githubSource` (today's REST client, extracted unchanged). `GITHUB_TOKEN` is now read only when it is actually needed.
**`tool/gitsandbox`** provisions the bare repository `PROVIDER=git` merges into, idempotently, so a restart keeps whatever landed. `platform/gitexec` locates git and strips the ambient environment, so a developer's hooks or signing key cannot fail a demo.
Two fixes fell out of getting `PROVIDER=git` to work at all:
- Runway's checkout directory moves to a named volume unless a path is given. It is where git clones, cherry-picks and commits, and on macOS a freshly written loose object read back over a bind mount can report `loose object … is corrupt` — which failed the first land against every new stack. The E2E still passes a path and still gets a bind mount.
- The Runway image now creates `/var/runway/checkouts`, so a named volume mounted there starts with a mode the service can write. Without it the service fails at boot with `mkdir: permission denied` whenever it runs as a non-root user.
## Test Plan
Every command in the rewritten quickstart was run by hand against a live stack, and the output quoted in it is what it printed.
- ✅ `make local-provider-start` (defaults to `fake`) then `make demo-pr` — three changes, no repository, no token, all `landed`
- ✅ `PROVIDER=git make local-provider-start` from a clean slate, then `PROVIDER=git make demo-pr` — real branches and multi-file commits, verified with `git -C /tmp/sq-sandbox/sandbox.git log --oneline main`
- ✅ `PROVIDER=git make demo-pr STACKED=true` — three changes, exactly one more entry in the target's reflog, so the stack landed atomically
- ✅ first land against a brand-new stack, repeatedly, which is the case the named volume fixes
- ✅ `make land` by hand on both `fake` and `git`, confirming the fake run lands nothing and the git run puts a commit on the branch
- ✅ `make e2e-git-test` after the rename and again after the compose change
- ✅ `make test` (104 targets), `make gazelle`, `make fmt`
`PROVIDER=github` is unchanged in behaviour but needs a token, so it has not been re-run here; the GitHub source is the previous code path moved behind the interface.
## Note for reviewers
`make local-provider-start` with no arguments meant GitHub before this change and means `fake` after it.1 parent c34c87f commit 5349602
31 files changed
Lines changed: 1701 additions & 234 deletions
File tree
- doc/howto
- platform/gitexec
- service
- runway/server
- submitqueue
- demo
- provider
- fake
- git
- local
- pr
- gateway/server
- test/e2e/submitqueue
- tool/gitsandbox
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
| |||
46 | 45 | | |
47 | 46 | | |
48 | 47 | | |
49 | | - | |
50 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
53 | 57 | | |
54 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
55 | 75 | | |
56 | 76 | | |
57 | 77 | | |
| |||
77 | 97 | | |
78 | 98 | | |
79 | 99 | | |
80 | | - | |
| 100 | + | |
81 | 101 | | |
82 | 102 | | |
83 | 103 | | |
| |||
172 | 192 | | |
173 | 193 | | |
174 | 194 | | |
175 | | - | |
| 195 | + | |
176 | 196 | | |
| 197 | + | |
177 | 198 | | |
| 199 | + | |
178 | 200 | | |
179 | 201 | | |
180 | 202 | | |
| |||
301 | 323 | | |
302 | 324 | | |
303 | 325 | | |
304 | | - | |
| 326 | + | |
305 | 327 | | |
306 | 328 | | |
307 | 329 | | |
308 | | - | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
309 | 346 | | |
310 | 347 | | |
311 | 348 | | |
312 | 349 | | |
313 | 350 | | |
314 | 351 | | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
315 | 355 | | |
316 | | - | |
317 | | - | |
| 356 | + | |
| 357 | + | |
318 | 358 | | |
319 | | - | |
| 359 | + | |
320 | 360 | | |
321 | 361 | | |
322 | 362 | | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
323 | 370 | | |
324 | 371 | | |
325 | 372 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
| 28 | + | |
| 29 | + | |
32 | 30 | | |
33 | 31 | | |
34 | 32 | | |
35 | 33 | | |
36 | 34 | | |
37 | | - | |
| 35 | + | |
38 | 36 | | |
39 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
40 | 46 | | |
41 | 47 | | |
42 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
| 67 | + | |
| 68 | + | |
71 | 69 | | |
72 | 70 | | |
73 | 71 | | |
74 | 72 | | |
75 | 73 | | |
76 | | - | |
| 74 | + | |
77 | 75 | | |
78 | 76 | | |
79 | 77 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
54 | | - | |
| 56 | + | |
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
| |||
94 | 96 | | |
95 | 97 | | |
96 | 98 | | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
103 | 105 | | |
104 | 106 | | |
| 107 | + | |
| 108 | + | |
105 | 109 | | |
106 | 110 | | |
107 | 111 | | |
| |||
0 commit comments