detached 07567de

test(cli): rename rollback tests to pin

commit
07567de026d67395f9e3ef3e0db790ac0a1392db
author
brice · · 2026-04-28 02:58 UTC
parent
b1fd1ce
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
5 files · +11 -11
M internal/adapters/in/cli/json_parity_test.go +1 -1
@@ -20,7 +20,7 @@ func TestAllListCommands_AcceptJSONFlag(t *testing.T) {
2020 {"backup list", newBackupListCmd},
2121 {"auth token list", newTokenListCmd},
2222 {"remotes list", newRemotesListCmd},
23- {"rollback list", newRollbackListCmd},
23+ {"pin list", newPinListCmd},
2424 {"config show", newConfigShowCmd},
2525 {"routes show", newRoutesShowCmd},
2626 {"networks list", newNetworksListCmd},
@@ -20,7 +20,7 @@ func TestAllListCommands_AcceptJSONFlag(t *testing.T) {
20 {"backup list", newBackupListCmd},20 {"backup list", newBackupListCmd},
21 {"auth token list", newTokenListCmd},21 {"auth token list", newTokenListCmd},
22 {"remotes list", newRemotesListCmd},22 {"remotes list", newRemotesListCmd},
23- {"rollback list", newRollbackListCmd},23+ {"pin list", newPinListCmd},
24 {"config show", newConfigShowCmd},24 {"config show", newConfigShowCmd},
25 {"routes show", newRoutesShowCmd},25 {"routes show", newRoutesShowCmd},
26 {"networks list", newNetworksListCmd},26 {"networks list", newNetworksListCmd},
M internal/adapters/in/cli/json_test.go +3 -3
@@ -77,8 +77,8 @@ func TestRemotesList_JSONFlag_Accepted(t *testing.T) {
7777 }
7878 }
7979
80-func TestRollbackList_JSONFlag_Accepted(t *testing.T) {
81- cmd := newRollbackListCmd()
80+func TestPinList_JSONFlag_Accepted(t *testing.T) {
81+ cmd := newPinListCmd()
8282 f := cmd.Flags().Lookup("json")
8383 assert.NotNil(t, f)
8484 if f != nil {
@@ -101,7 +101,7 @@ func TestImagesList_JSONShape_RoundTripsDTO(t *testing.T) {
101101 assert.Equal(t, images[0].ID, got[0].ID)
102102 }
103103
104-func TestRollbackList_JSONShape_RoundTripsTags(t *testing.T) {
104+func TestPinList_JSONShape_RoundTripsTags(t *testing.T) {
105105 tags := []string{"v1.2.0", "v1.1.0"}
106106 payload, err := json.Marshal(tags)
107107 require.NoError(t, err)
@@ -77,8 +77,8 @@ func TestRemotesList_JSONFlag_Accepted(t *testing.T) {
77 }77 }
78 }78 }
79 79
80-func TestRollbackList_JSONFlag_Accepted(t *testing.T) {80+func TestPinList_JSONFlag_Accepted(t *testing.T) {
81- cmd := newRollbackListCmd()81+ cmd := newPinListCmd()
82 f := cmd.Flags().Lookup("json")82 f := cmd.Flags().Lookup("json")
83 assert.NotNil(t, f)83 assert.NotNil(t, f)
84 if f != nil {84 if f != nil {
@@ -101,7 +101,7 @@ func TestImagesList_JSONShape_RoundTripsDTO(t *testing.T) {
101 assert.Equal(t, images[0].ID, got[0].ID)101 assert.Equal(t, images[0].ID, got[0].ID)
102 }102 }
103 103
104-func TestRollbackList_JSONShape_RoundTripsTags(t *testing.T) {104+func TestPinList_JSONShape_RoundTripsTags(t *testing.T) {
105 tags := []string{"v1.2.0", "v1.1.0"}105 tags := []string{"v1.2.0", "v1.1.0"}
106 payload, err := json.Marshal(tags)106 payload, err := json.Marshal(tags)
107 require.NoError(t, err)107 require.NoError(t, err)
M internal/adapters/in/cli/parity_matrix_test.go +1 -1
@@ -40,7 +40,7 @@ func TestLocalParityMatrix(t *testing.T) {
4040 command string
4141 }{
4242 {file: "push.go", legacyText: "push requires remote mode", command: "gordon push"},
43- {file: "rollback.go", legacyText: "rollback requires remote mode", command: "gordon rollback"},
43+ {file: "pin.go", legacyText: "rollback requires remote mode", command: "gordon pin"},
4444 {file: "backup.go", legacyText: "backup commands require a configured remote target", command: "gordon backups"},
4545 {file: "routes.go", legacyText: "status command requires --remote flag or GORDON_REMOTE env var", command: "gordon status"},
4646 {file: "restart.go", legacyText: "local restart does not support --with-attachments; use --remote", command: "gordon restart --with-attachments"},
@@ -40,7 +40,7 @@ func TestLocalParityMatrix(t *testing.T) {
40 command string40 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- {file: "rollback.go", legacyText: "rollback requires remote mode", command: "gordon rollback"},43+ {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"},44 {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"},45 {file: "routes.go", legacyText: "status command requires --remote flag or GORDON_REMOTE env var", command: "gordon status"},
46 {file: "restart.go", legacyText: "local restart does not support --with-attachments; use --remote", command: "gordon restart --with-attachments"},46 {file: "restart.go", legacyText: "local restart does not support --with-attachments; use --remote", command: "gordon restart --with-attachments"},
M internal/adapters/in/cli/pin.go +2 -2
@@ -192,7 +192,7 @@ func sortSemverTags(tags []string) []string {
192192 return append(semverTags, otherTags...)
193193 }
194194
195-func selectTag(targetTag string, tags []string, currentTag, rollbackDomain string) (string, error) {
195+func selectTag(targetTag string, tags []string, currentTag, pinDomain string) (string, error) {
196196 if targetTag != "" {
197197 if !validateTagExists(targetTag, tags) {
198198 return "", fmt.Errorf("tag %s not found. Available: %s", targetTag, strings.Join(tags, ", "))
@@ -201,7 +201,7 @@ func selectTag(targetTag string, tags []string, currentTag, rollbackDomain strin
201201 }
202202
203203 selectedTag, err := components.RunSelector(
204- fmt.Sprintf("Select version for %s:", rollbackDomain),
204+ fmt.Sprintf("Select version for %s:", pinDomain),
205205 tags,
206206 currentTag,
207207 )
@@ -192,7 +192,7 @@ func sortSemverTags(tags []string) []string {
192 return append(semverTags, otherTags...)192 return append(semverTags, otherTags...)
193 }193 }
194 194
195-func selectTag(targetTag string, tags []string, currentTag, rollbackDomain string) (string, error) {195+func selectTag(targetTag string, tags []string, currentTag, pinDomain string) (string, error) {
196 if targetTag != "" {196 if targetTag != "" {
197 if !validateTagExists(targetTag, tags) {197 if !validateTagExists(targetTag, tags) {
198 return "", fmt.Errorf("tag %s not found. Available: %s", targetTag, strings.Join(tags, ", "))198 return "", fmt.Errorf("tag %s not found. Available: %s", targetTag, strings.Join(tags, ", "))
@@ -201,7 +201,7 @@ func selectTag(targetTag string, tags []string, currentTag, rollbackDomain strin
201 }201 }
202 202
203 selectedTag, err := components.RunSelector(203 selectedTag, err := components.RunSelector(
204- fmt.Sprintf("Select version for %s:", rollbackDomain),204+ fmt.Sprintf("Select version for %s:", pinDomain),
205 tags,205 tags,
206 currentTag,206 currentTag,
207 )207 )
R internal/adapters/in/cli/rollback_test.go → internal/adapters/in/cli/pin_test.go +4 -4 renamed, 85% similar
@@ -60,10 +60,10 @@ func TestValidateTagExists(t *testing.T) {
6060 assert.False(t, validateTagExists("v3.0.0", []string{"v1.0.0", "v2.0.0"}))
6161 }
6262
63-func TestPrintRollbackTags_WritesToProvidedWriter(t *testing.T) {
63+func TestPrintPinTags_WritesToProvidedWriter(t *testing.T) {
6464 var buf bytes.Buffer
6565
66- err := printRollbackTags(&buf, "myapp.example.com", "v1.2.0", []string{"v1.2.0", "v1.1.0"}, false)
66+ err := printPinTags(&buf, "myapp.example.com", "v1.2.0", []string{"v1.2.0", "v1.1.0"}, false)
6767 assert.NoError(t, err)
6868
6969 output := buf.String()
@@ -73,8 +73,8 @@ func TestPrintRollbackTags_WritesToProvidedWriter(t *testing.T) {
7373 assert.Contains(t, output, "- v1.1.0")
7474 }
7575
76-func TestPrintRollbackTags_ReturnsWriteError(t *testing.T) {
77- err := printRollbackTags(failingWriter{}, "myapp.example.com", "v1.2.0", []string{"v1.2.0"}, false)
76+func TestPrintPinTags_ReturnsWriteError(t *testing.T) {
77+ err := printPinTags(failingWriter{}, "myapp.example.com", "v1.2.0", []string{"v1.2.0"}, false)
7878 assert.Error(t, err)
7979 assert.Contains(t, err.Error(), "write failed")
8080 }
@@ -60,10 +60,10 @@ func TestValidateTagExists(t *testing.T) {
60 assert.False(t, validateTagExists("v3.0.0", []string{"v1.0.0", "v2.0.0"}))60 assert.False(t, validateTagExists("v3.0.0", []string{"v1.0.0", "v2.0.0"}))
61 }61 }
62 62
63-func TestPrintRollbackTags_WritesToProvidedWriter(t *testing.T) {63+func TestPrintPinTags_WritesToProvidedWriter(t *testing.T) {
64 var buf bytes.Buffer64 var buf bytes.Buffer
65 65
66- err := printRollbackTags(&buf, "myapp.example.com", "v1.2.0", []string{"v1.2.0", "v1.1.0"}, false)66+ err := printPinTags(&buf, "myapp.example.com", "v1.2.0", []string{"v1.2.0", "v1.1.0"}, false)
67 assert.NoError(t, err)67 assert.NoError(t, err)
68 68
69 output := buf.String()69 output := buf.String()
@@ -73,8 +73,8 @@ func TestPrintRollbackTags_WritesToProvidedWriter(t *testing.T) {
73 assert.Contains(t, output, "- v1.1.0")73 assert.Contains(t, output, "- v1.1.0")
74 }74 }
75 75
76-func TestPrintRollbackTags_ReturnsWriteError(t *testing.T) {76+func TestPrintPinTags_ReturnsWriteError(t *testing.T) {
77- err := printRollbackTags(failingWriter{}, "myapp.example.com", "v1.2.0", []string{"v1.2.0"}, false)77+ err := printPinTags(failingWriter{}, "myapp.example.com", "v1.2.0", []string{"v1.2.0"}, false)
78 assert.Error(t, err)78 assert.Error(t, err)
79 assert.Contains(t, err.Error(), "write failed")79 assert.Contains(t, err.Error(), "write failed")
80 }80 }

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 7

Tags 106

↑↓ moveenter openesc close