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.

#28

Let a change request gain its issue links after it is opened

merged · by keenan 13d ago · merged into main at bdf6a0de by keenan 13d ago

keenan opened this 13d ago

Follow-up to #01M5XG8WYZ1566KZFC73WQWGX3, noted as a gap when the link was added.

Why

The link is only useful if it can be set when it is known, and it is usually known after the request exists — the issue turns up while reviewing, or while writing the landing note. Before this, a request created without --closes could never gain one: the only options were a second change request or leaving the issue to drift, which is what the link exists to prevent.

What changed

vole change update <id> now takes the links as well as the head:

vole change update <id> --closes 01M5XG8WYZ1566KZFC73WQWGX3   # set (replace)
vole change update <id> --closes A,B                          # several, or repeat the flag
vole change update <id> --no-closes                            # clear
vole change update <id> --head <rev> --closes <issue>           # both, one commit

metadata.SetRequestCloses normalises, deduplicates, sorts and validates the list against the issues tree — the ids are checked at this point as well as at creation, because a link added later is exactly where a typo would otherwise hide until the issue quietly never closed. An unchanged set returns without moving the branch (ErrNoChange), so re-running is not a commit.

Only an open request may be relinked. A merged request’s list is a record of what the merge did; a closed one is not going to run. Both refuse, with the state named.

The CLI refuses a call that changes neither the head nor the links, and --closes with --no-closes is a contradiction rather than a precedence rule.

Verification

vole workflow run verify in the pinned image: gofmt, vet, build, govulncheck (0 reachable), packaging, links, go test -race ./... — all pass.

New tests in metadata: linking an open request sets the list, re-linking the same set is not an edit, an unknown or malformed id is refused, and a merged request’s links cannot be changed.

Dogfooding

This request itself is opened with --closes, so merging it closes #01M5XG8WYZ1566KZFC73WQWGX3 through the feature the previous request added — the first real use of the mechanism, and a check that the mark-and-close commit does what the tests say.

Discussion (0)

No discussion yet.