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/git/vole.git

Write over SSH with a registered key:

git clone ssh://git@0.0.0.0:2222/vole.git

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

Issues and requests are frontmatter, not JSON

307cbc2aa624ca9b76b79849e8ce8926414be435 · Keenan Nemetz · 17d ago · parent 427c4761

Issues and requests are frontmatter, not JSON

issues/<ulid>/issue.md and requests/<ulid>/request.md replace meta.json plus
description.md, and approvals/<account>.md replaces approvals/<account>.json.
Every file on refs/heads/vole is now frontmatter markdown read by one package, so
there is one reader and one writer for issues, requests, comments and approvals
instead of a JSON path and a hand-rolled key/value path.

The diff is the interface. A JSON array rewrites its neighbour to add a comma, so
one label cost two changed lines and removing one cost three; a block sequence
costs one. docs/spikes/issue-frontmatter measured the same six edits at 25 changed
lines as meta.json and 10 as frontmatter, and one file per entity means one path
to diff, blame and log.

Three rules make YAML safe to hand-edit rather than something to police:

- the writer always double-quotes free text, so no indicator, reserved word or
  " # " can change what a title means
- a label is quoted only when the parser would not read it back bare ("null"),
  which leaves ordinary labels as they were
- a reader refuses an unquoted title that the parser read differently: "title:
  fix #12 crash" would otherwise be stored as "fix" and nobody would find out

Control characters are refused on both sides, so a tree the server accepts is a
tree it can always rewrite.

`updated` is gone from issues, requests and the index's issues table. It cost a
changed line on every edit — 11 of the 21 frontmatter lines in the spike's
sequence — and the commit that changed the file already carries the time.

Verified: TestRenderParseRoundTrip puts 13 titles that break naive YAML (hash,
colon, leading dash, null, quotes, backslash, unicode, 190 bytes) through the
writer and the reader; the server tests push a rendered issue over SSH and render
it, and the approval-ownership tests withdraw approvals/<account>.md. Then
scripts/ci.sh green (gofmt, vet, build, markdown links, go test -race ./...).

go.mod +3−3

@@ -4,7 +4,10 @@ go 1.27
4 4
5 5 require (
6 6 github.com/BurntSushi/toml v1.6.0
7 github.com/microcosm-cc/bluemonday v1.0.27
8 github.com/yuin/goldmark v1.8.6
7 9 golang.org/x/crypto v0.58.0
10 gopkg.in/yaml.v3 v3.0.1
8 11 modernc.org/sqlite v1.61.0
9 12 )
10 13
@@ -14,13 +17,10 @@ require (
14 17 github.com/google/uuid v1.6.0 // indirect
15 18 github.com/gorilla/css v1.0.1 // indirect
16 19 github.com/mattn/go-isatty v0.0.24 // indirect
17 github.com/microcosm-cc/bluemonday v1.0.27 // indirect
18 20 github.com/ncruces/go-strftime v1.1.0 // indirect
19 21 github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
20 github.com/yuin/goldmark v1.8.6 // indirect
21 22 golang.org/x/net v0.60.0 // indirect
22 23 golang.org/x/sys v0.49.0 // indirect
23 gopkg.in/yaml.v3 v3.0.1 // indirect
24 24 modernc.org/libc v1.79.0 // indirect
25 25 modernc.org/mathutil v1.7.1 // indirect
26 26 modernc.org/memory v1.12.1 // indirect