Sign in

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

vole
Clone

Read only, no credentials:

https://rodent.software/vole.git

Write over SSH with a registered key:

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

A free and open-source forge that lives in your Git repo.

#114

Index the rest of the metadata branch

merged · by keenan 10d ago · merged into perf/fewer-git-processes at b739915c by keenan 10d ago

keenan opened this 10d ago

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.
  • Ensure is 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.
  • IndexRepo is the full rebuild (vole admin index rebuild and 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 (the libsqlite3-tagged build still cannot run here: no sqlite3.h).
  • New tests: requests/comments/approvals/closes indexing and updates, deletion keeping the number, release artifacts, and IndexRepo versus 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.

Discussion (0)

No discussion yet.