detached 2e6e03f

fix(cli): explain the missing CI features in the version warning

commit
2e6e03f6fe58f00a63c7422ff3c0a217f617e3cf
author
brice · · 2026-10-12 20:38 UTC
parent
075280b
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
2 files · +11 -0
M internal/app/cli_version.go +2 -0
@@ -116,5 +116,7 @@ var featureUse = map[string]string{
116116 client.FeatureSigningKey: "`ermite signing-key show` needs: the command will fail on this server",
117117 client.FeatureSession: "`ermite web login` needs: the command will fail on this server",
118118 client.FeatureTokenBranchPrefixes: "`ermite token create --branch-prefix` needs: the command is refused, and `token list` does not show the limits",
119+ client.FeatureCIRuns: "`ermite run` needs: the commands will fail on this server",
120+ client.FeatureCIRunners: "`ermite runner` needs: the commands will fail on this server",
119121 client.FeaturePasskeys: "`ermite web passkey` needs: the commands will fail on this server (passkeys need an https public URL with a DNS host name)",
120122 }
@@ -116,5 +116,7 @@ var featureUse = map[string]string{
116 client.FeatureSigningKey: "`ermite signing-key show` needs: the command will fail on this server",116 client.FeatureSigningKey: "`ermite signing-key show` needs: the command will fail on this server",
117 client.FeatureSession: "`ermite web login` needs: the command will fail on this server",117 client.FeatureSession: "`ermite web login` needs: the command will fail on this server",
118 client.FeatureTokenBranchPrefixes: "`ermite token create --branch-prefix` needs: the command is refused, and `token list` does not show the limits",118 client.FeatureTokenBranchPrefixes: "`ermite token create --branch-prefix` needs: the command is refused, and `token list` does not show the limits",
119+ client.FeatureCIRuns: "`ermite run` needs: the commands will fail on this server",
120+ client.FeatureCIRunners: "`ermite runner` needs: the commands will fail on this server",
119 client.FeaturePasskeys: "`ermite web passkey` needs: the commands will fail on this server (passkeys need an https public URL with a DNS host name)",121 client.FeaturePasskeys: "`ermite web passkey` needs: the commands will fail on this server (passkeys need an https public URL with a DNS host name)",
120 }122 }
M internal/app/cli_version_test.go +9 -0
@@ -12,11 +12,20 @@ import (
1212 "github.com/stretchr/testify/require"
1313
1414 "bnema.dev/ermite-api/gen/ermite"
15+
16+ "bnema.dev/ermite/internal/adapters/client"
1517 )
1618
1719 // allFeatures are the features this client uses.
1820 var allFeatures = []string{"repo.update", "events.resume", "merge_requests", "merge_requests.delete_branch", "signing_key", "session", "token.branch_prefixes", "ci.runs", "ci.runners", "passkeys"}
1921
22+// Every feature the client uses needs a sentence for the version warning.
23+func TestEveryUsedFeatureExplainsWhatBreaks(t *testing.T) {
24+ for _, f := range client.UsedFeatures() {
25+ assert.NotEmpty(t, featureUse[f], f)
26+ }
27+}
28+
2029 func versionFake(features ...string) *fakeAPI {
2130 return &fakeAPI{getVersion: func(*ermite.GetVersionRequest) (*ermite.GetVersionResponse, error) {
2231 return &ermite.GetVersionResponse{Version: "v0.4.0", Features: features}, nil
@@ -12,11 +12,20 @@ import (
12 "github.com/stretchr/testify/require"12 "github.com/stretchr/testify/require"
13 13
14 "bnema.dev/ermite-api/gen/ermite"14 "bnema.dev/ermite-api/gen/ermite"
15+
16+ "bnema.dev/ermite/internal/adapters/client"
15 )17 )
16 18
17 // allFeatures are the features this client uses.19 // allFeatures are the features this client uses.
18 var allFeatures = []string{"repo.update", "events.resume", "merge_requests", "merge_requests.delete_branch", "signing_key", "session", "token.branch_prefixes", "ci.runs", "ci.runners", "passkeys"}20 var allFeatures = []string{"repo.update", "events.resume", "merge_requests", "merge_requests.delete_branch", "signing_key", "session", "token.branch_prefixes", "ci.runs", "ci.runners", "passkeys"}
19 21
22+// Every feature the client uses needs a sentence for the version warning.
23+func TestEveryUsedFeatureExplainsWhatBreaks(t *testing.T) {
24+ for _, f := range client.UsedFeatures() {
25+ assert.NotEmpty(t, featureUse[f], f)
26+ }
27+}
28+
20 func versionFake(features ...string) *fakeAPI {29 func versionFake(features ...string) *fakeAPI {
21 return &fakeAPI{getVersion: func(*ermite.GetVersionRequest) (*ermite.GetVersionResponse, error) {30 return &fakeAPI{getVersion: func(*ermite.GetVersionRequest) (*ermite.GetVersionResponse, error) {
22 return &ermite.GetVersionResponse{Version: "v0.4.0", Features: features}, nil31 return &ermite.GetVersionResponse{Version: "v0.4.0", Features: features}, nil

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 2

Tags 44

↑↓ moveenter openesc close