Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Site
Clone

Read only, no credentials:

https://rodent.software/vole.git

Write over SSH with a registered key:

git clone ssh://git@rodent.software/vole.git

Self-hosted forge that lives in your Git repo.

Resolve change references on the server, not only in the clone

1eac85526b68e855bbef356cfd8deffb44643481 · Keenan Nemetz · 3d ago · parent d74e7e23

Resolve change references on the server, not only in the clone

 is the one change verb that lands on the server, so it
was also the one that passed the typed argument straight to landing.Prepare.
Prepare reads a ULID, and the shared #number alias was refused with
"requests: no request 2".

Resolve the reference where the landing happens: the server reads the
metadata branch it owns, finds the request, and passes the canonical ULID to
the plan, the merge-when-ready arm and the record. The status verb takes the
same path, so both server-side change verbs accept what the help promises:
a ULID, a prefix, or a number with or without #.

Fixes 01M7B8J64AM5BC75Y9335107ZV.

server/ssh/merge.go +14−2

@@ -8,8 +8,9 @@ package ssh
8 8 // and the server runs forge/landing.Land — the same operation the browser's merge
9 9 // button runs and the same gate the pre-receive hook applies to a push.
10 10 //
11 // This is not a shell. The verb takes a repository name and a request id, nothing
12 // else, and answers one line.
11 // This is not a shell. The verb takes a repository name and a request reference —
12 // the ULID, a prefix of it, or the shared `#42` number — nothing else, and answers
13 // one line.
13 14
14 15 import (
15 16 "fmt"
@@ -19,6 +20,7 @@ import (
19 20 "rodent.software/vole/ci/runs"
20 21 "rodent.software/vole/forge/landing"
21 22 "rodent.software/vole/internal/format"
23 "rodent.software/vole/metadata"
22 24 )
23 25
24 26 // serveChangeMerge runs one landing for the caller. Every refusal is written to the
@@ -51,6 +53,16 @@ func (s *Server) serveChangeMerge(ch Session, argv []string, user, remote string
51 53 fmt.Fprintf(ch, "vole: %s may not merge change requests in %s\n", user, name)
52 54 return 1
53 55 }
56 // The only verb that resolves its argument here rather than in the clone: the
57 // landing happens on the server, so the number alias has to be read from the
58 // instance's metadata branch. A prefix is accepted the same way `change show`
59 // accepts one, and the ULID is what the plan, the arm and the record all take.
60 req, err := metadata.FindRequest(m.Git(), id)
61 if err != nil {
62 fmt.Fprintf(ch, "vole: %v\n", err)
63 return 1
64 }
65 id = req.ID
54 66 gate := landing.Gate{
55 67 Repo: m.Git(), Name: m.Name, ACL: a, Actor: user,
56 68 Role: a.EffectiveRole(user, s.cfg.Identity.IsAdmin(user)),