Why
Part of #113 (stage 1). The index held issues and the [#42](/vole/n/42) numbers; change
requests, comments, approvals, closes and release artifacts were read from the
vole branch on every page, and the repository header read the whole requests
subtree just to print a count. #112 cut the page cost from 38–114 git calls to
5–19; what is left is mostly that metadata read, and it grows with use.
This change puts the rest of the branch in data/index.db, so lists, counts and
lookups are SQLite reads. The conversation pages still read their record from
git, and the index stays derived and rebuildable.
Stacked on #112 (--base perf/fewer-git-processes). Retarget to main once
that lands.
What changed
- New tables:
requests,request_closes,request_approvals,comments(both kinds, with the review anchor),artifacts(release pointers). Schema version 4 drops the old rows on first open, which is the existing recovery path. Ensureis driven by the path delta between two commits: a changed issue or request replaces its own rows, its comments and its sets; a deleted one removes them and keeps its number.IndexRepois the full rebuild (vole admin index rebuildand the first read). A rebuild now clears the derived tables first, so a deleted repository leaves nothing behind.- The header badge, the change list with its state chips and approval counts, and the release artifact list read the index. A change page reads its one request instead of every request.
- An approval still only counts when it names the request’s current head and base, and eligibility is still the ACL’s call, so stale approvals behave as before.
Git calls per page (fixture: 40 files, 30 issues, 30 changes)
| page | before | after |
|---|---|---|
| issues list | 5 | 2 |
| change list | 6 | 3 |
| releases | 6 | 3 |
| commits | 7 | 4 |
| overview | 19 | 6 (repeat) |
| code | 12 | 9 |
| change view | 14 | 12 |
The remaining calls are the one rev-parse the refresh needs, the branch/tree
reads the page itself shows, and the detail pages’ own git read.
Checks
./vole workflow check,gofmt,go vet ./...,CGO_ENABLED=1 go test -race ./forge/index ./server/... ./metadata(thelibsqlite3-tagged build still cannot run here: nosqlite3.h).- New tests: requests/comments/approvals/closes indexing and updates, deletion
keeping the number, release artifacts, and
IndexRepoversus the incremental path producing identical rows.
Not in this change
- Stage 2 (universal search) needs the FTS5 build tag; it will add the documents table and the search surfaces on top of these rows.
- Stage 3: the issue/change detail pages and the activity feed still read git. They can move once stage 1 has run for a while, and #99’s harness should say whether the remaining calls matter.