chore: finalizer pass — update rollback references in README and docs, simplify validateTagExists
- commit
- e4bd401290783b75ca4c5e6e02d93dd8747e3440
- author
- brice · · 2026-04-28 03:09 UTC
- parent
- 9dd6453
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
4 files · +7 -11
M README.md +2 -2
| @@ -46,7 +46,7 @@ gordon status | |||
| 46 | 46 | Roll back, restart, or manage secrets — all from the command line: | |
| 47 | 47 | ||
| 48 | 48 | ```bash | |
| 49 | - | gordon rollback app.example.com # Revert to a previous image tag | |
| 49 | + | gordon pin app.example.com # Pin to a specific image tag | |
| 50 | 50 | gordon restart app.example.com # Restart the container | |
| 51 | 51 | gordon secrets set app.example.com DB_HOST=db.internal API_KEY=secret123 | |
| 52 | 52 | ``` | |
| @@ -95,7 +95,7 @@ See the [Deploy Action README](.github/actions/deploy/README.md) for multi-platf | |||
| 95 | 95 | | `gordon routes add <domain> <image>` | Create or update a route | | |
| 96 | 96 | | `gordon routes remove <domain>` | Remove a route | | |
| 97 | 97 | | `gordon routes deploy <domain>` | Redeploy a route | | |
| 98 | - | | `gordon rollback <domain>` | Roll back to a previous image | | |
| 98 | + | | `gordon pin <domain>` | Pin a route to a specific image tag | | |
| 99 | 99 | | `gordon restart <domain>` | Restart a route container | | |
| 100 | 100 | ||
| 101 | 101 | ### Images & Registry | |
| @@ -46,7 +46,7 @@ gordon status | |||||
| 46 | Roll back, restart, or manage secrets — all from the command line: | 46 | Roll back, restart, or manage secrets — all from the command line: | ||
| 47 | 47 | ||||
| 48 | ```bash | 48 | ```bash | ||
| 49 | - | gordon rollback app.example.com # Revert to a previous image tag | 49 | + | gordon pin app.example.com # Pin to a specific image tag |
| 50 | gordon restart app.example.com # Restart the container | 50 | gordon restart app.example.com # Restart the container | ||
| 51 | gordon secrets set app.example.com DB_HOST=db.internal API_KEY=secret123 | 51 | gordon secrets set app.example.com DB_HOST=db.internal API_KEY=secret123 | ||
| 52 | ``` | 52 | ``` | ||
| @@ -95,7 +95,7 @@ See the [Deploy Action README](.github/actions/deploy/README.md) for multi-platf | |||||
| 95 | | `gordon routes add <domain> <image>` | Create or update a route | | 95 | | `gordon routes add <domain> <image>` | Create or update a route | | ||
| 96 | | `gordon routes remove <domain>` | Remove a route | | 96 | | `gordon routes remove <domain>` | Remove a route | | ||
| 97 | | `gordon routes deploy <domain>` | Redeploy a route | | 97 | | `gordon routes deploy <domain>` | Redeploy a route | | ||
| 98 | - | | `gordon rollback <domain>` | Roll back to a previous image | | 98 | + | | `gordon pin <domain>` | Pin a route to a specific image tag | |
| 99 | | `gordon restart <domain>` | Restart a route container | | 99 | | `gordon restart <domain>` | Restart a route container | | ||
| 100 | 100 | ||||
| 101 | ### Images & Registry | 101 | ### Images & Registry | ||
M docs/cli/index.md +2 -2
| @@ -38,7 +38,7 @@ Management commands run locally through in-process services by default. Add `--r | |||
| 38 | 38 | | `gordon attachments push` | Build/push attachment images to registry | [attachments](./attachments.md) | | |
| 39 | 39 | | `gordon reload` | Reload configuration and sync containers | [serve](./serve.md#gordon-reload) | | |
| 40 | 40 | | `gordon restart` | Restart a running container | [restart](./restart.md) | | |
| 41 | - | | `gordon rollback` | Roll back to a previous image version | [rollback](./rollback.md) | | |
| 41 | + | | `gordon pin` | Pin a route to a specific image tag | [pin](./pin.md) | | |
| 42 | 42 | | `gordon routes` | Manage routes | [routes](./routes.md) | | |
| 43 | 43 | | `gordon secrets` | Manage secrets | [secrets](./secrets.md) | | |
| 44 | 44 | | `gordon status` | Show Gordon server status | [status](./status.md) | | |
| @@ -81,7 +81,7 @@ gordon push myapp --build | |||
| 81 | 81 | gordon push myapp --no-confirm | |
| 82 | 82 | ||
| 83 | 83 | # Roll back to a previous tag | |
| 84 | - | gordon rollback myapp.example.com | |
| 84 | + | gordon pin myapp.example.com | |
| 85 | 85 | ||
| 86 | 86 | # View logs | |
| 87 | 87 | gordon logs # Gordon process logs | |
| @@ -38,7 +38,7 @@ Management commands run locally through in-process services by default. Add `--r | |||||
| 38 | | `gordon attachments push` | Build/push attachment images to registry | [attachments](./attachments.md) | | 38 | | `gordon attachments push` | Build/push attachment images to registry | [attachments](./attachments.md) | | ||
| 39 | | `gordon reload` | Reload configuration and sync containers | [serve](./serve.md#gordon-reload) | | 39 | | `gordon reload` | Reload configuration and sync containers | [serve](./serve.md#gordon-reload) | | ||
| 40 | | `gordon restart` | Restart a running container | [restart](./restart.md) | | 40 | | `gordon restart` | Restart a running container | [restart](./restart.md) | | ||
| 41 | - | | `gordon rollback` | Roll back to a previous image version | [rollback](./rollback.md) | | 41 | + | | `gordon pin` | Pin a route to a specific image tag | [pin](./pin.md) | |
| 42 | | `gordon routes` | Manage routes | [routes](./routes.md) | | 42 | | `gordon routes` | Manage routes | [routes](./routes.md) | | ||
| 43 | | `gordon secrets` | Manage secrets | [secrets](./secrets.md) | | 43 | | `gordon secrets` | Manage secrets | [secrets](./secrets.md) | | ||
| 44 | | `gordon status` | Show Gordon server status | [status](./status.md) | | 44 | | `gordon status` | Show Gordon server status | [status](./status.md) | | ||
| @@ -81,7 +81,7 @@ gordon push myapp --build | |||||
| 81 | gordon push myapp --no-confirm | 81 | gordon push myapp --no-confirm | ||
| 82 | 82 | ||||
| 83 | # Roll back to a previous tag | 83 | # Roll back to a previous tag | ||
| 84 | - | gordon rollback myapp.example.com | 84 | + | gordon pin myapp.example.com |
| 85 | 85 | ||||
| 86 | # View logs | 86 | # View logs | ||
| 87 | gordon logs # Gordon process logs | 87 | gordon logs # Gordon process logs | ||
M internal/adapters/in/cli/parity_matrix_test.go +1 -1
| @@ -40,6 +40,7 @@ func TestLocalParityMatrix(t *testing.T) { | |||
| 40 | 40 | command string | |
| 41 | 41 | }{ | |
| 42 | 42 | {file: "push.go", legacyText: "push requires remote mode", command: "gordon push"}, | |
| 43 | + | // Guards against reintroducing the old rollback-only remote-mode error text during the command rename. | |
| 43 | 44 | {file: "pin.go", legacyText: "rollback requires remote mode", command: "gordon pin"}, | |
| 44 | 45 | {file: "backup.go", legacyText: "backup commands require a configured remote target", command: "gordon backups"}, | |
| 45 | 46 | {file: "routes.go", legacyText: "status command requires --remote flag or GORDON_REMOTE env var", command: "gordon status"}, | |
| @@ -59,7 +60,6 @@ func TestLocalParityMatrix(t *testing.T) { | |||
| 59 | 60 | ||
| 60 | 61 | func TestUIAdoptionMatrixCoverage(t *testing.T) { | |
| 61 | 62 | for _, expect := range uiAdoptionExpectations { | |
| 62 | - | expect := expect | |
| 63 | 63 | t.Run(expect.family, func(t *testing.T) { | |
| 64 | 64 | if len(expect.functions) == 0 { | |
| 65 | 65 | t.Fatalf("ui adoption matrix for %s is empty", expect.family) | |
| @@ -40,6 +40,7 @@ func TestLocalParityMatrix(t *testing.T) { | |||||
| 40 | command string | 40 | command string | ||
| 41 | }{ | 41 | }{ | ||
| 42 | {file: "push.go", legacyText: "push requires remote mode", command: "gordon push"}, | 42 | {file: "push.go", legacyText: "push requires remote mode", command: "gordon push"}, | ||
| 43 | + | // Guards against reintroducing the old rollback-only remote-mode error text during the command rename. | |||
| 43 | {file: "pin.go", legacyText: "rollback requires remote mode", command: "gordon pin"}, | 44 | {file: "pin.go", legacyText: "rollback requires remote mode", command: "gordon pin"}, | ||
| 44 | {file: "backup.go", legacyText: "backup commands require a configured remote target", command: "gordon backups"}, | 45 | {file: "backup.go", legacyText: "backup commands require a configured remote target", command: "gordon backups"}, | ||
| 45 | {file: "routes.go", legacyText: "status command requires --remote flag or GORDON_REMOTE env var", command: "gordon status"}, | 46 | {file: "routes.go", legacyText: "status command requires --remote flag or GORDON_REMOTE env var", command: "gordon status"}, | ||
| @@ -59,7 +60,6 @@ func TestLocalParityMatrix(t *testing.T) { | |||||
| 59 | 60 | ||||
| 60 | func TestUIAdoptionMatrixCoverage(t *testing.T) { | 61 | func TestUIAdoptionMatrixCoverage(t *testing.T) { | ||
| 61 | for _, expect := range uiAdoptionExpectations { | 62 | for _, expect := range uiAdoptionExpectations { | ||
| 62 | - | expect := expect | |||
| 63 | t.Run(expect.family, func(t *testing.T) { | 63 | t.Run(expect.family, func(t *testing.T) { | ||
| 64 | if len(expect.functions) == 0 { | 64 | if len(expect.functions) == 0 { | ||
| 65 | t.Fatalf("ui adoption matrix for %s is empty", expect.family) | 65 | t.Fatalf("ui adoption matrix for %s is empty", expect.family) | ||
M internal/adapters/in/cli/pin.go +2 -6
| @@ -5,6 +5,7 @@ import ( | |||
| 5 | 5 | "fmt" | |
| 6 | 6 | "io" | |
| 7 | 7 | "os" | |
| 8 | + | "slices" | |
| 8 | 9 | "sort" | |
| 9 | 10 | "strings" | |
| 10 | 11 | ||
| @@ -215,12 +216,7 @@ func selectTag(targetTag string, tags []string, currentTag, pinDomain string) (s | |||
| 215 | 216 | } | |
| 216 | 217 | ||
| 217 | 218 | func validateTagExists(targetTag string, tags []string) bool { | |
| 218 | - | for _, t := range tags { | |
| 219 | - | if t == targetTag { | |
| 220 | - | return true | |
| 221 | - | } | |
| 222 | - | } | |
| 223 | - | return false | |
| 219 | + | return slices.Contains(tags, targetTag) | |
| 224 | 220 | } | |
| 225 | 221 | ||
| 226 | 222 | func deploySelectedTag(ctx context.Context, cp ControlPlane, route *domain.Route, pinDomain, imageName, selectedTag string) error { | |
| @@ -5,6 +5,7 @@ import ( | |||||
| 5 | "fmt" | 5 | "fmt" | ||
| 6 | "io" | 6 | "io" | ||
| 7 | "os" | 7 | "os" | ||
| 8 | + | "slices" | |||
| 8 | "sort" | 9 | "sort" | ||
| 9 | "strings" | 10 | "strings" | ||
| 10 | 11 | ||||
| @@ -215,12 +216,7 @@ func selectTag(targetTag string, tags []string, currentTag, pinDomain string) (s | |||||
| 215 | } | 216 | } | ||
| 216 | 217 | ||||
| 217 | func validateTagExists(targetTag string, tags []string) bool { | 218 | func validateTagExists(targetTag string, tags []string) bool { | ||
| 218 | - | for _, t := range tags { | 219 | + | return slices.Contains(tags, targetTag) |
| 219 | - | if t == targetTag { | |||
| 220 | - | return true | |||
| 221 | - | } | |||
| 222 | - | } | |||
| 223 | - | return false | |||
| 224 | } | 220 | } | ||
| 225 | 221 | ||||
| 226 | func deploySelectedTag(ctx context.Context, cp ControlPlane, route *domain.Route, pinDomain, imageName, selectedTag string) error { | 222 | func deploySelectedTag(ctx context.Context, cp ControlPlane, route *domain.Route, pinDomain, imageName, selectedTag string) error { | ||