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.

Close linked issues when a change request lands

183d48e55e14b0355db4268275893274433ce8ee · Keenan Nemetz · 14d ago · parent 097b2110

Close linked issues when a change request lands

A change request can now name the issues it closes. Landing writes closed
onto each of them in the same commit that marks the request merged, so the
merge and the closure cannot be separated: a request cannot be merged with
its issues still open, and an issue cannot be closed by a merge that did
not happen.

The link lives in request.md as a list of full issue ids, which is what
makes it reviewable: it is part of the file a reviewer reads, not a
reference buried in prose. Ids are validated when the request is written,
including that the issue exists, so a typo fails while the author is still
looking at the command instead of at the landing they have waited for.

`vole change new --closes <id>` (repeatable, comma lists accepted) sets it,
`vole change merge` reports what it closed, and the browser form takes the
same field. The request page links each issue, and the merge answer names
the ones it closed.

An issue that is already closed, or that is no longer there, is left alone:
the promise is about what a merge does, not permission to overrule somebody
who closed it deliberately. Re-marking an already-merged request closes
nothing, so a retried landing is harmless.

Closes #01M5XG8WYZ1566KZFC73WQWGX3.

server/web/templates/requests.html +5

@@ -84,6 +84,11 @@
84 84 {{else}}
85 85 <p class="muted">Merges into {{.Request.Base}} cleanly.</p>
86 86 {{end}}{{end}}
87 {{if .Request.Closes}}
88 <p class="muted">Closes
89 {{range $i, $id := .Request.Closes}}{{if $i}}, {{end}}<a href="/r/{{$.Name}}/issues/{{$id}}">#{{short $id}}</a>{{end}}
90 when merged.</p>
91 {{end}}
87 92 {{if .AlreadyMerged}}
88 93 <p class="muted">Already merged into {{.Request.Base}}.</p>
89 94 {{else if .FileCount}}