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.

Phase 2: issue CLI, cross-references, backlinks, filter and search

c1e3e3ca696c2bae8692775977fdae21ed50bc4a · Keenan Nemetz · 18d ago · parent 37c01e5a

Phase 2: issue CLI, cross-references, backlinks, filter and search

The issue format needed no client, and still does not: every one of these is
sugar over files anyone can write. The CLI exists so the common case is not
ceremony.

- `vole issue new|comment|close|reopen|list|show` works on the clone in the
  current directory. It fetches the issues branch first so its commit is a
  fast-forward the server will accept, validates locally so a malformed issue
  never costs a round trip, then pushes. Writing goes through gitx.CommitFiles,
  the shared CAS path, so a concurrent author's commit cannot be clobbered.
- Ids may be abbreviated. `list` prints eight characters, so every id-taking
  command resolves prefixes and refuses an ambiguous one with the candidates
  listed. This was a real bug: list printed short ids while comment and close
  demanded the full ULID, so copying the id from the CLI's own output failed.
  The integration test now drives the CLI with a prefix.
- `#<ulid>` in an issue body or comment renders as a link. Rewriting happens on
  the markdown source, skipping fenced blocks so a reference inside a code
  sample stays literal; a test asserts both halves.
- Backlinks: commits whose message mentions an id are listed on the issue, found
  with `git log --grep`. git does the search, so there is no second index.
- Filtering and search on the list page: state, label, and a LIKE over title and
  body, backed by an `issue_labels` table and an indexed `body` column.

Notifications are deliberately not built. The web is read-only and has no user
identity, so "in-app" has nobody to notify and email would need subscriptions,
which need a store. The honest fit is a per-repo Atom feed when someone wants
one; the roadmap says so rather than leaving a phantom item.

Verified by hand with a clone and a key: filed an issue, listed it, commented
using the short id, closed it, confirmed the web showed the closed state, the
rendered comment and the label filter, and that an ambiguous prefix is refused.

internal/web/templates.go +32−1

@@ -190,7 +190,23 @@ select{background:var(--card);color:var(--fg);border:1px solid var(--line);borde
190 190 {{define "issues"}}
191 191 {{template "header" .}}
192 192 <h1><a href="/r/{{.Name}}">{{.Name}}</a> · issues</h1>
193 <p class="muted">{{.OpenCount}} open · {{.Total}} total</p>
193 <form method="get" action="/r/{{.Name}}/issues" class="filters">
194 <input name="q" type="text" placeholder="search title and body" value="{{.Filter.Query}}">
195 <select name="state">
196 <option value="">all states</option>
197 <option value="open"{{if eq .Filter.State "open"}} selected{{end}}>open</option>
198 <option value="closed"{{if eq .Filter.State "closed"}} selected{{end}}>closed</option>
199 </select>
200 <input type="hidden" name="label" value="{{.Filter.Label}}">
201 <button type="submit">Filter</button>
202 {{if .Filtered}}<a href="/r/{{.Name}}/issues">clear</a>{{end}}
203 </form>
204 <p class="muted">{{.Open}} open · {{.Total}} total</p>
205 {{if .Labels}}
206 <p class="muted">Labels:
207 {{range .Labels}}<a class="label" href="/r/{{$.Name}}/issues?label={{.}}">{{.}}</a>{{end}}
208 </p>
209 {{end}}
194 210 {{if .Issues}}
195 211 <table>
196 212 <tr><th>ID</th><th>Title</th><th>State</th><th>Author</th><th>Replies</th><th>Age</th></tr>
@@ -205,6 +221,8 @@ select{background:var(--card);color:var(--fg);border:1px solid var(--line);borde
205 221 </tr>
206 222 {{end}}
207 223 </table>
224 {{else if .Filtered}}
225 <p class="muted">No issues match that filter.</p>
208 226 {{else}}
209 227 <p class="muted">No issues yet. An issue is a directory on the <code>issues</code> branch:
210 228 <code>issues/&lt;ulid&gt;/meta.json</code> plus <code>description.md</code>.</p>
@@ -229,6 +247,19 @@ select{background:var(--card);color:var(--fg);border:1px solid var(--line);borde
229 247 {{else}}
230 248 <p class="muted">No comments yet.</p>
231 249 {{end}}
250 {{if .Backlinks}}
251 <h2>Referenced in commits</h2>
252 <table>
253 {{range .Backlinks}}
254 <tr>
255 <td><span class="sha">{{short .SHA}}</span></td>
256 <td>{{.Subject}}</td>
257 <td class="muted">{{.Author}}</td>
258 <td class="muted">{{since .When}}</td>
259 </tr>
260 {{end}}
261 </table>
262 {{end}}
232 263 {{template "footer" .}}
233 264 {{end}}
234 265