Scope named deploys to their environments #4

Merged
benvin merged 10 commits from benvin/named-deploy into benvin/timings 2026-11-08 21:46:16 +11:00
Member

w10k deploy rebuilds every environment, which is slow when only one branch has changed. A named deploy has to pick the same branch for an env that a full deploy would, and it must stay in the env's own source.

  • accept env or raw branch names as deploy args; complete live env names
  • resolve env names and collisions over all branches in every source, then select
  • match env names first; fall back to raw branch names only when no source has that env
  • error when a named branch loses its collision or is invalid; ignore unrelated branches
  • skip purge and GC on named deploys
`w10k deploy` rebuilds every environment, which is slow when only one branch has changed. A named deploy has to pick the same branch for an env that a full deploy would, and it must stay in the env's own source. - accept env or raw branch names as `deploy` args; complete live env names - resolve env names and collisions over all branches in every source, then select - match env names first; fall back to raw branch names only when no source has that env - error when a named branch loses its collision or is invalid; ignore unrelated branches - skip purge and GC on named deploys
unkin-agent added 2 commits 2026-11-08 20:32:26 +11:00
Clear GC marks for worktrees and modules a named deploy swaps in
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
7d457a89cf
unkin-agent added 1 commit 2026-11-08 20:34:50 +11:00
Merge remote-tracking branch 'origin/benvin/timings' into benvin/named-deploy
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
09f84fd752
unkin-agent added 1 commit 2026-11-08 20:49:21 +11:00
Merge remote-tracking branch 'origin/benvin/timings' into benvin/named-deploy
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
94bcdc19f4
# Conflicts:
#	internal/deploy/deploy.go
Author
Member
  • internal/deploy/deploy.go:288 — filtering by want before the collision check lets a named deploy pick a different winner than a full deploy: branches a-b,a.b; deploy a.b silently swaps a.b into env a_b (full deploy keeps a-b), err=nil → resolve collisions over all branches first, then filter by want
  • internal/deploy/deploy.go:288 — raw-branch match crosses sources: with a second source prefix: p, deploy main also builds p_main → match env names first; fall back to branch names only for args that match no env
  • nit: internal/deploy/deploy_test.go:846 — no test covers module-dir unmark (dropping the m.dir appends passes the suite) or the prefix/collision cases above → add them
- internal/deploy/deploy.go:288 — filtering by `want` before the collision check lets a named deploy pick a different winner than a full deploy: branches `a-b`,`a.b`; `deploy a.b` silently swaps `a.b` into env `a_b` (full deploy keeps `a-b`), err=nil → resolve collisions over all branches first, then filter by `want` - internal/deploy/deploy.go:288 — raw-branch match crosses sources: with a second source `prefix: p`, `deploy main` also builds `p_main` → match env names first; fall back to branch names only for args that match no env - nit: internal/deploy/deploy_test.go:846 — no test covers module-dir unmark (dropping the `m.dir` appends passes the suite) or the prefix/collision cases above → add them
unkin-agent added 6 commits 2026-11-08 21:07:02 +11:00
Keep GC off targeted deploys, always drop live marks, let exact branches win env names
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
66580c9b37
# Conflicts:
#	internal/deploy/deploy.go
#	internal/deploy/forge.go
# Conflicts:
#	internal/deploy/deploy_test.go
- pick env winners over every branch, then select, so a named deploy matches a full deploy
- match env names across sources first, raw branch names only when no env matches
- report collision and invalid-name errors only for the named args
- add tests for collision losers, all-corrected collisions, prefixed sources and unrelated invalid branches
Warn about corrected branch names only for envs being deployed
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
260dd4fc78
Author
Member
  • internal/deploy/forge.go:19,97 — forge download/extract size caps (+ forge_test.go, commit e73f3c8) are unrelated to named deploys → split into their own PR.
  • internal/deploy/deploy.go:957,992,1010 — w10k gc/full-deploy behaviour changes (sweep continues past a failed Live, module sweep skipped on partial sources, corrupt gc state treated as empty) are separate from scoping named deploys → split into a "GC failure tolerance" PR; keep only gc(ctx, false) here.
  • PR body — "skip purge and GC on named deploys" is inaccurate (named deploys still drop marks of what they make live) and the body omits the forge caps, GC tolerance, and full-deploy collision change (all-corrected collisions now skip every claimant) → fix the bullets after the split.
  • nit: internal/deploy/deploy_test.go — no test that a worktree replaced by a named deploy is marked by the next sweep and removed only after the full grace → add one.
  • nit: main.go:103 — ValidArgsFunction has no test (live envs only, dedup, no lock) → add one.
- internal/deploy/forge.go:19,97 — forge download/extract size caps (+ forge_test.go, commit e73f3c8) are unrelated to named deploys → split into their own PR. - internal/deploy/deploy.go:957,992,1010 — `w10k gc`/full-deploy behaviour changes (sweep continues past a failed `Live`, module sweep skipped on partial sources, corrupt gc state treated as empty) are separate from scoping named deploys → split into a "GC failure tolerance" PR; keep only `gc(ctx, false)` here. - PR body — "skip purge and GC on named deploys" is inaccurate (named deploys still drop marks of what they make live) and the body omits the forge caps, GC tolerance, and full-deploy collision change (all-corrected collisions now skip every claimant) → fix the bullets after the split. - nit: internal/deploy/deploy_test.go — no test that a worktree replaced by a named deploy is marked by the next sweep and removed only after the full grace → add one. - nit: main.go:103 — `ValidArgsFunction` has no test (live envs only, dedup, no lock) → add one.
benvin merged commit 00199db589 into benvin/timings 2026-11-08 21:46:16 +11:00
benvin deleted branch benvin/named-deploy 2026-11-08 21:46:16 +11:00
This repo is archived. You cannot comment on pull requests.