main bac21c6

app_visibility_diff_test.go RawHistoryFolder

1package domain_test
2
3import (
4	"testing"
5
6	"github.com/stretchr/testify/assert"
7
8	"github.com/bnema/gordon/internal/domain"
9)
10
11// TestDiffAppSpec_VisibilityChangeIsDetected proves flipping an interface
12// between public and internal is a meaningful change: it must force a
13// redeploy instead of being silently ignored.
14func TestDiffAppSpec_VisibilityChangeIsDetected(t *testing.T) {
15	desired := visibilitySpec(domain.AppHTTPInterface{Port: 8080, Visibility: domain.AppVisibilityInternal})
16	effective := visibilitySpec(domain.AppHTTPInterface{
17		Host: "blog.example.com", Port: 8080, TLS: "auto", Visibility: domain.AppVisibilityPublic,
18	})
19
20	diff := domain.DiffAppSpec(desired, effective)
21	assert.Contains(t, diff.Changed, "service/web/interfaces")
22}
23
24// TestDiffAppSpec_ZeroVisibilityEqualsPublic proves state written before
25// the visibility field existed (zero value) is not a phantom change
26// against an explicit public interface, so applying an unchanged manifest
27// stays a no-op after upgrade.
28func TestDiffAppSpec_ZeroVisibilityEqualsPublic(t *testing.T) {
29	// Legacy stored state: same interface, visibility never serialized.
30	legacy := visibilitySpec(domain.AppHTTPInterface{
31		Host: "blog.example.com", Port: 8080, TLS: "auto",
32	})
33	desired := visibilitySpec(domain.AppHTTPInterface{
34		Host: "blog.example.com", Port: 8080, TLS: "auto", Visibility: domain.AppVisibilityPublic,
35	})
36
37	diff := domain.DiffAppSpec(desired, legacy)
38	assert.NotContains(t, diff.Changed, "service/web/interfaces")
39}

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