Add environment aliases #8

Merged
benvin merged 6 commits from benvin/aliases into main 2026-11-08 22:13:00 +11:00
Member

The g10k wrapper recreates production with rm -f; ln -s develop, leaving a window with no production and a link to a link that OpenVox does not pin to a sha.

  • add w10k.aliases mapping alias env -> target env, validated as a hard config error
  • point each alias at its target's current absolute worktree after every target deploy, failed or not, including named deploys of either name
  • leave an alias untouched, logging an error, while its target has no w10k worktree
  • purge an alias only when it leaves config or its target disappears; keep it while its target name is lost to a branch collision
  • show aliases with their target in w10k list
The g10k wrapper recreates `production` with `rm -f; ln -s develop`, leaving a window with no `production` and a link to a link that OpenVox does not pin to a sha. - add `w10k.aliases` mapping alias env -> target env, validated as a hard config error - point each alias at its target's current absolute worktree after every target deploy, failed or not, including named deploys of either name - leave an alias untouched, logging an error, while its target has no w10k worktree - purge an alias only when it leaves config or its target disappears; keep it while its target name is lost to a branch collision - show aliases with their target in `w10k list`
Author
Member
  • internal/deploy/deploy.go:905 — purge keeps an alias only if its target is in envs; a pushed branch that collides with a corrected target (production: feature_x, push feature.x beside feature-x) drops the target from envs and purges production → also keep aliases (and skip purging) whose target is claimed by a branch in p.skipped; repro: deploy alias→feature_x, git branch feature.x, deploy, assert production exists
  • internal/deploy/deploy.go:470 — aliases are re-pointed only when the target's deploy succeeds; if it fails, an alias that is not yet on the target's worktree stays wrong (cutover production -> develop stays link-to-link; a failed alias swap from an earlier run stays behind) → run swapAliases whenever the target link is owned, whatever deployEnv returned; repro: existing develop worktree, relative production -> develop, add alias, break develop's Puppetfile, deploy, readlink production == develop
  • nit: internal/deploy/deploy_test.go:1601 — no tests for a fetch failure or a target deploy failure keeping the alias, an absolute-symlink cutover (:1642), or w10k list alias rows → add them
- internal/deploy/deploy.go:905 — purge keeps an alias only if its target is in `envs`; a pushed branch that collides with a corrected target (`production: feature_x`, push `feature.x` beside `feature-x`) drops the target from `envs` and purges `production` → also keep aliases (and skip purging) whose target is claimed by a branch in `p.skipped`; repro: deploy alias→feature_x, `git branch feature.x`, deploy, assert `production` exists - internal/deploy/deploy.go:470 — aliases are re-pointed only when the target's deploy succeeds; if it fails, an alias that is not yet on the target's worktree stays wrong (cutover `production -> develop` stays link-to-link; a failed alias swap from an earlier run stays behind) → run `swapAliases` whenever the target link is owned, whatever `deployEnv` returned; repro: existing develop worktree, relative `production -> develop`, add alias, break develop's Puppetfile, deploy, `readlink production` == `develop` - nit: internal/deploy/deploy_test.go:1601 — no tests for a fetch failure or a target deploy failure keeping the alias, an absolute-symlink cutover (:1642), or `w10k list` alias rows → add them
benvin changed target branch from benvin/named-deploy to main 2026-11-08 21:46:18 +11:00
benvin added 19 commits 2026-11-08 21:46:18 +11:00
Test named deploys and timing phase keys
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
e7c72ed2d7
Report wait on leaf phases only and include it in module.download
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
55224fd9f7
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
# Conflicts:
#	internal/deploy/deploy.go
#	internal/deploy/deploy_test.go
#	internal/deploy/git.go
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
Merge remote-tracking branch 'origin/benvin/generate-types' into benvin/timings
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
ba06c3bae7
# Conflicts:
#	internal/deploy/deploy.go
#	internal/gentypes/generate.go
#	internal/gentypes/generate_test.go
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
Label waiters on in-flight work cache=shared and count panics as failed
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
4edc42329c
- report cache=shared for callers that waited on another's once work
- drop the git module.resolve cache label
- recover deployEnv panics before its outcome is recorded
- count source fetch and branch errors as failed
# 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
Add environment aliases pointing at their target's worktree
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
0e60781f47
Keep aliases of collided envs and align aliases even when the target fails
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
5b696fc572
Merge remote-tracking branch 'origin/benvin/scaffold' into benvin/aliases
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
1ff7d9e547
# Conflicts:
#	internal/deploy/deploy.go
#	internal/deploy/deploy_test.go
unkin-agent added 2 commits 2026-11-08 22:00:56 +11:00
Merge origin/main; aliases share the skipped-set purge
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
3b143d6550
benvin merged commit cf1aca3cf8 into main 2026-11-08 22:13:00 +11:00
benvin deleted branch benvin/aliases 2026-11-08 22:13:01 +11:00
This repo is archived. You cannot comment on pull requests.