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.

Number issues and change requests for human references

e05f1c48d4ee55635cd7b77889f0545137198106 · Keenan Nemetz · 13d ago · parent 41d1fee9

Number issues and change requests for human references

A ULID is an unreadable handle, and the 8-character prefix the list showed
is mostly timestamp: this repository's 27 issues shared seven distinct
six-character prefixes and two pairs already collided at eight. The part
people actually type carried almost no information.

Issues and change requests now share one gap-free sequence (#1, #42, ...)
derived from the creation order in the metadata branch's history, the way
one forge counts both in a single run.

The number is not stored. It is the rank of the entity's creation commit,
so nothing is written when an entity is created, a repository needs no
backfill, the same history gives the same numbers on every clone, and
`vole admin index rebuild` reproduces them from git. A ULID stays the
identity: paths, front matter, `closes:` and audit entries are unchanged,
and data/index.db only caches the mapping so a page render does not walk
history.

Every id-taking command accepts a number, `#42` links in a body through a
kind-agnostic /r/<repo>/n/42 route, and --closes resolves an alias to the
ULID before writing.

Closes #45

server/integration_test.go +15−4

@@ -846,15 +846,26 @@ func TestIssueCLIEndToEnd(t *testing.T) {
846 846 if code, _ := f.get("/r/" + f.repo + "/issues/" + id); code != 200 {
847 847 t.Fatalf("issue page: %d", code)
848 848 }
849 // The page names the `#42` alias, and `/n/1` — the kind-agnostic route a `#1`
850 // in a body links to — lands on the same issue.
851 if _, body := f.get("/r/" + f.repo + "/issues/" + id); !strings.Contains(body, "#1") {
852 t.Fatal("the issue page does not show its number")
853 }
854 if _, body := f.get("/r/" + f.repo + "/n/1"); !strings.Contains(body, "Filed from the CLI") {
855 t.Fatal("#1 does not resolve to the issue")
856 }
849 857
850 // Use the short id that `issue list` prints: a prefix has to resolve, or the
851 // CLI's own output is unusable.
858 // `issue list` prints the `#42` alias, so the alias has to resolve. The 8-character
859 // prefix still works too: it is what an older script would have parsed.
852 860 short := id
853 861 if len(short) > 8 {
854 862 short = short[:8]
855 863 }
856 if out, errs, err := run("issue", "list"); err != nil || !strings.Contains(out, short) {
857 t.Fatalf("issue list did not show a usable id: %v %q %s", err, out, errs)
864 if out, errs, err := run("issue", "list"); err != nil || !strings.Contains(out, "#1") {
865 t.Fatalf("issue list did not show the number: %v %q %s", err, out, errs)
866 }
867 if _, errs, err := run("issue", "comment", "-m", "A reply from the CLI.", "#1"); err != nil {
868 t.Fatalf("comment by number: %v\n%s", err, errs)
858 869 }
859 870 if _, errs, err := run("issue", "comment", "-m", "A reply from the CLI.", short); err != nil {
860 871 t.Fatalf("comment: %v\n%s", err, errs)