Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Site
Clone

Read only, no credentials:

https://rodent.software/vole.git

Write over SSH with a registered key:

git clone ssh://git@rodent.software/vole.git

Self-hosted forge that lives in your Git repo.

Move release channels to an authoritative channels.db

262e516e838cfc4b16b5d00fd98d5e4ef135aa85 · Keenan Nemetz · 19d ago · parent 24019cb3

Move release channels to an authoritative channels.db

Channels are consumed from the public URL and are server-side publication state,
so they no longer live on the vole branch or in the derived index.

- forge/channel: authoritative SQLite store with schema, validation, and CRUD
- config: data/channels.db, opened and closed with the instance
- CLI: release channel set|list|clear over a new vole-channel SSH verb
- server: maintain for set/clear, read for list, annotated-tag validation,
  audit channel.set/channel.clear, JSON list
- web: channel page and tree read the store; release badges query it
- remove the metadata-branch channel parser/validator, the index-derived channel
  table, and the hook path rules
- backup, instance-data, and architecture docs include channels.db

Refs: 01M7BPHANWMSW5HK2GT0PY74QZ

forge/index/channels_test.go −75

@@ -1,75 +0,0 @@
1 package index
2
3 import (
4 "strings"
5 "testing"
6 "time"
7
8 "rodent.software/vole/metadata"
9 )
10
11 func TestEnsureIndexesChannels(t *testing.T) {
12 t.Parallel()
13 s, m, g := incrementalRepo(t)
14 at := time.Date(2026, 11, 14, 12, 0, 0, 0, time.UTC)
15 ch := &metadata.Channel{
16 Name: "stable",
17 Release: "v1.0.0",
18 ReleaseObject: strings.Repeat("a", 40),
19 UpdatedBy: "keenan",
20 UpdatedAt: at,
21 Description: "Recommended for production.",
22 }
23 if err := metadata.WriteChannel(g, metadata.Ref, ch, "channel: stable", "keenan"); err != nil {
24 t.Fatal(err)
25 }
26 if err := s.Ensure(m); err != nil {
27 t.Fatal(err)
28 }
29 list, err := s.Channels(m.ID)
30 if err != nil {
31 t.Fatal(err)
32 }
33 if len(list) != 1 || list[0].Name != "stable" || list[0].Release != "v1.0.0" ||
34 list[0].Description != ch.Description || !list[0].UpdatedAt.Equal(at) {
35 t.Fatalf("channels = %+v", list)
36 }
37 got, ok, err := s.Channel(m.ID, "stable")
38 if err != nil || !ok || got.ReleaseObject != ch.ReleaseObject {
39 t.Fatalf("Channel = %+v, %v, %v", got, ok, err)
40 }
41 if _, ok, err := s.Channel(m.ID, "missing"); err != nil || ok {
42 t.Fatalf("missing channel = %v, %v", ok, err)
43 }
44 names, err := s.ChannelsForTag(m.ID, "v1.0.0")
45 if err != nil || len(names) != 1 || names[0] != "stable" {
46 t.Fatalf("ChannelsForTag = %v, %v", names, err)
47 }
48
49 // Moving the pointer is an incremental refresh: the channel table is replaced
50 // from the new tree, not appended to.
51 ch.Release = "v2.0.0"
52 ch.ReleaseObject = strings.Repeat("b", 40)
53 if err := metadata.WriteChannel(g, metadata.Ref, ch, "channel: stable -> v2.0.0", "keenan"); err != nil {
54 t.Fatal(err)
55 }
56 if err := s.Ensure(m); err != nil {
57 t.Fatal(err)
58 }
59 if names, _ := s.ChannelsForTag(m.ID, "v1.0.0"); len(names) != 0 {
60 t.Fatalf("old tag still has channels: %v", names)
61 }
62 if names, _ := s.ChannelsForTag(m.ID, "v2.0.0"); len(names) != 1 || names[0] != "stable" {
63 t.Fatalf("new tag channels = %v", names)
64 }
65
66 if err := metadata.DeleteChannel(g, metadata.Ref, "stable", "channel: clear stable", "keenan"); err != nil {
67 t.Fatal(err)
68 }
69 if err := s.Ensure(m); err != nil {
70 t.Fatal(err)
71 }
72 if list, err := s.Channels(m.ID); err != nil || len(list) != 0 {
73 t.Fatalf("after clear = %+v, %v", list, err)
74 }
75 }