Repository navigation
Description
Problem
A lane always runs the stack the way the stack file describes it for day-to-day development: dev servers with watch, no background workers unless --workers, the data the main tree's seed jobs produce. That is right for working on a branch. It is wrong for the other common reason to start a lane: run a given commit for an acceptance test (an end-to-end suite before a release tag, a reproduction of a bug on an older commit).
Seen in practice (devstack 0.10.1, see also #103): an end-to-end suite against a lane had to be assembled by hand:
- the SPA ran as a dev server and went away mid-run (follow-up comment in Agents cannot start or stop a lane over MCP, and status in the main tree does not mention lanes #103); an acceptance run wants a build served statically, no watch;
- the lane had no background workers, so every test that waits for a scheduled or triggered job, or for a webhook consumer, failed;
- test data needed a manual
devstack run <seed>; - the suite needed several environment variables pointing at the lane's shifted ports, set by hand;
- the same commit run through a separate, hand-written Compose setup (build images, fresh database) was green, the lane run had 9 failures that were all lane artefacts.
That separate script is exactly what devstack could replace.
Proposal: profiles
A named overlay in the stack file that changes how services run, selected when a lane (or the main tree) starts:
[profiles.acceptance]
workers = true # background workers on
data = "fresh" # new database volume per start, seed jobs run as part of start
env = { BASE_URL = "{service.web.url}", JOBS_URL = "{compose.app.scheduler.4000}" }
[profiles.acceptance.services.web]
variant = "static" # build once, serve the output; no dev server, no watch
build = "npm run build -- --configuration e2e"
serve = "dist/web/browser"
[profiles.acceptance.services.api]
variant = "image" # optional: run a prebuilt image instead of building
image = "registry.example/api:{ref}"devstack up --profile acceptance # in the worktree
devstack up --lane <name> --profile acceptance # from the main tree (see #103)
MCP: up with lane and profile.
Per service, a profile could pick one of:
| variant | meaning |
|---|---|
devserver |
as today |
native |
as today (build artifact, candidates) |
static |
build once, serve files statically |
build |
container built from a Dockerfile in the tree |
image |
container from a registry image, with placeholders such as {ref} / {sha} / a tag given at start |
Plus per profile: workers, data = "fresh" | "keep", extra env, which services autostart, and optionally a command that is the profile's purpose (devstack run test in the lane).
Why it is general
- Acceptance runs (the case above): one command instead of a separate script, same ports/isolation as any lane.
- Testing the artifact that ships: with
variant = "image"a lane can run the images a CI built for a tag, so the suite tests what gets deployed, not a local rebuild. - Reproducing an older release with
data = "fresh"without touching the main tree's database. - Lighter lanes for reviewing a branch: only the services the review needs.
Open questions
- Should
data = "fresh"remove the lane's volumes onlane stoptoo, or only on the next start? - How does a profile interact with
promote --lane(a static/image lane serving the main ports)? - Is a profile part of the lane's identity (shown in
lane list, persists across restarts) or chosen perup?
Activity
docs(adr): ADR-0041: a profile says how a lane runs for a purpose (#115…