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/refresh.go +1−23

@@ -85,10 +85,6 @@ func (s *Store) IndexRepo(m *repo.Meta) error {
85 85 if err != nil {
86 86 return err
87 87 }
88 channels, err := metadata.LoadChannelsAt(g, commit)
89 if err != nil {
90 return err
91 }
92 88 // State changes are the metadata commits' subjects, so a rebuild reads the
93 89 // whole branch and takes every one of them. A repository that never pushed
94 90 // metadata has no branch to read, which is not an error.
@@ -160,9 +156,6 @@ func (s *Store) IndexRepo(m *repo.Meta) error {
160 156 if err := replaceArtifacts(tx, m.ID, artifacts); err != nil {
161 157 return err
162 158 }
163 if err := replaceChannels(tx, m.ID, channels); err != nil {
164 return err
165 }
166 159 if _, _, err := replaceReleaseEvents(tx, m.ID, tags); err != nil {
167 160 return err
168 161 }
@@ -190,7 +183,7 @@ func (s *Store) IndexRepo(m *repo.Meta) error {
190 183 func (s *Store) indexFrom(m *repo.Meta, from, to string) error {
191 184 g := m.Git()
192 185 changes, err := g.DiffStatusPaths(from, to,
193 metadata.IssuesDir, metadata.ChangesDir, metadata.ReleasesDir, metadata.ChannelsDir)
186 metadata.IssuesDir, metadata.ChangesDir, metadata.ReleasesDir)
194 187 if err != nil {
195 188 return err
196 189 }
@@ -217,7 +210,6 @@ func (s *Store) indexFrom(m *repo.Meta, from, to string) error {
217 210 }
218 211 }
219 212 releasesChanged := false
220 channelsChanged := false
221 213 for path := range changes {
222 214 switch {
223 215 case strings.HasPrefix(path, metadata.IssuesDir+"/"):
@@ -230,8 +222,6 @@ func (s *Store) indexFrom(m *repo.Meta, from, to string) error {
230 222 }
231 223 case strings.HasPrefix(path, metadata.ReleasesDir+"/"):
232 224 releasesChanged = true
233 case strings.HasPrefix(path, metadata.ChannelsDir+"/"):
234 channelsChanged = true
235 225 }
236 226 }
237 227
@@ -282,12 +272,6 @@ func (s *Store) indexFrom(m *repo.Meta, from, to string) error {
282 272 return err
283 273 }
284 274 }
285 var channels []metadata.Channel
286 if channelsChanged {
287 if channels, err = metadata.LoadChannelsAt(g, to); err != nil {
288 return err
289 }
290 }
291 275
292 276 // Numbers are historical: a deleted entity keeps its number, and a creation
293 277 // that was deleted again inside the range still consumed one. The additions
@@ -370,11 +354,6 @@ func (s *Store) indexFrom(m *repo.Meta, from, to string) error {
370 354 return err
371 355 }
372 356 }
373 if channelsChanged {
374 if err := replaceChannels(tx, m.ID, channels); err != nil {
375 return err
376 }
377 }
378 357 if err := bumpEventCount(tx, m.ID, eventDelta); err != nil {
379 358 return err
380 359 }
@@ -400,7 +379,6 @@ func deleteRepoRows(tx execer, repoID string) error {
400 379 `DELETE FROM request_approvals WHERE repo_id=?`,
401 380 `DELETE FROM comments WHERE repo_id=?`,
402 381 `DELETE FROM artifacts WHERE repo_id=?`,
403 `DELETE FROM release_channels WHERE repo_id=?`,
404 382 `DELETE FROM state_changes WHERE repo_id=?`,
405 383 `DELETE FROM events WHERE repo_id=?`,
406 384 `DELETE FROM entity_numbers WHERE repo_id=?`,