feat(master): show built-from-source services but never update them (#7)

This commit is contained in:
2026-10-12 19:30:38 +02:00
parent c3bd4ca1ed
commit 3d3dfb47e6
8 changed files with 33 additions and 6 deletions
@@ -193,3 +193,23 @@ func TestApplySnapshot_StoresConfigFiles(t *testing.T) {
require.Len(t, got, 1)
assert.Equal(t, withFiles.ConfigFiles, got[0].ConfigFiles)
}
func TestApplySnapshot_StoresBuilt(t *testing.T) {
s := openTestStore(t)
ctx := context.Background()
id := newAgent(t, s, "node-2")
built := slusk
built.Built = true
require.NoError(t, s.ApplySnapshot(ctx, id, worker, []protocol.Service{built}, t0))
got, err := s.ListServices(ctx)
require.NoError(t, err)
require.Len(t, got, 1)
assert.True(t, got[0].Built)
// A later report without the flag clears it.
require.NoError(t, s.UpsertService(ctx, id, "", slusk, t0.Add(time.Minute)))
got, err = s.ListServices(ctx)
require.NoError(t, err)
assert.False(t, got[0].Built)
}