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.

Assemble an issue or change from the indexed rows

9d8dd1bc7f52d0fcdfcf286734a2c7735c1d051d · Keenan Nemetz · 10d ago · parent 6b8f84c4

Assemble an issue or change from the indexed rows

The detail pages can read the same rows the lists do, as long as the
refresh runs first (it does) and the assembled record is exactly what the
branch says. Add Store.Issue and Store.Request, which put one entity back
together from its row, its comments, and — for a change — its closes and
approvals.

Two orderings had to be stored rather than inferred:

- request_closes keeps the file's position, because the branch lists the
  issues a change closes in the order the author wrote them, not in id
  order.
- comments and approvals are read in the same id/principal order git's
  path listing gives, so a rebuilt thread matches the one read from git.

The tests compare both readers field by field (reflect.DeepEqual) on an
issue with labels, assignees, a reply and a comment, and on a change with
two closes, an anchored comment and an approval. The schema version is
bumped so existing rows are rebuilt with the new column.

forge/index/index.go +4−1

@@ -132,6 +132,9 @@ CREATE TABLE IF NOT EXISTS request_closes (
132 132 repo_id TEXT NOT NULL,
133 133 request_id TEXT NOT NULL,
134 134 issue_id TEXT NOT NULL,
135 -- position keeps the order the request's file lists them in, so a rebuilt
136 -- row answers with the same list the branch does.
137 position INTEGER NOT NULL DEFAULT 0,
135 138 PRIMARY KEY (repo_id, request_id, issue_id)
136 139 );
137 140 CREATE INDEX IF NOT EXISTS request_closes_issue ON request_closes(repo_id, issue_id);
@@ -212,7 +215,7 @@ CREATE VIRTUAL TABLE IF NOT EXISTS search USING fts5(
212 215 // and leaves every repo with an empty issues_sha, which makes the next read
213 216 // rebuild that repo from git. A stale row is worse than a rebuild, and a rebuild is the
214 217 // operation the index already has to survive.
215 const schemaVersion = 5
218 const schemaVersion = 6
216 219
217 220 func (s *Store) migrate() error {
218 221 var v int