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.

Identify accounts by their registered name

62576fa8157d431dcf2d360f3ebe481de77bda03 · Keenan Nemetz · 14d ago · parent 642e5994

Identify accounts by their registered name

Drop the internal account id and display name. Users, keys, passkeys,
invites, sessions, ACL entries, approvals, locks and CI records now all
use the registered name as the single identity.

The roster migrates in place: old id-keyed tables are rebuilt around the
name, and access-rule/lock references are rewritten through the same
mapping. Display-name editing and whoami --id are removed.

server/hook/records.go +7−7

@@ -26,7 +26,7 @@ import (
26 26 "github.com/rodent-software/vole/forge/access"
27 27 )
28 28
29 func recordFindings(g *git.Repo, c change, a *access.ACL, actor, actorID, repoName, usersDB, runsDB string, who func(string) string) []string {
29 func recordFindings(g *git.Repo, c change, a *access.ACL, actor, repoName, usersDB, runsDB string) []string {
30 30 added, problems, err := runs.CheckPush(g, c.old, c.new)
31 31 if err != nil {
32 32 return []string{fmt.Sprintf("%s: cannot read the run records in this push: %v", c.ref, err)}
@@ -34,10 +34,10 @@ func recordFindings(g *git.Repo, c change, a *access.ACL, actor, actorID, repoNa
34 34 if len(added) == 0 {
35 35 return problems
36 36 }
37 if a == nil || !a.CanReport(actorID) {
37 if a == nil || !a.CanReport(actor) {
38 38 people := "none named, so only admins"
39 39 if a != nil {
40 people = runnerSummary(a, who)
40 people = runnerSummary(a)
41 41 }
42 42 return append(problems, fmt.Sprintf(
43 43 "%s: %s reported a run result but is not a runner for %s (runners: %s). "+
@@ -55,7 +55,7 @@ func recordFindings(g *git.Repo, c change, a *access.ACL, actor, actorID, repoNa
55 55 defer store.Close()
56 56
57 57 for _, rec := range added {
58 problems = append(problems, recordProblems(g, store, rec, actor, actorID, repoName)...)
58 problems = append(problems, recordProblems(g, store, rec, actor, repoName)...)
59 59 }
60 60 return problems
61 61 }
@@ -65,13 +65,13 @@ func recordFindings(g *git.Repo, c change, a *access.ACL, actor, actorID, repoNa
65 65 // account that pushed it, and that is the same rule an issue's author and an approval's
66 66 // owner follow. There is no signature to check, because there is no signature anywhere
67 67 // else either.
68 func recordProblems(g *git.Repo, store *runs.Store, rec runs.Record, actor, actorID, repoName string) []string {
68 func recordProblems(g *git.Repo, store *runs.Store, rec runs.Record, actor, repoName string) []string {
69 69 where := runs.RecordPath(rec.RunID, rec.Attempt)
70 70 var out []string
71 71
72 72 // The signer is not the pusher's to choose: the file names an account, and the
73 73 // commit has to be signed by that account, or the name is decoration.
74 if rec.Signer != actorID {
74 if rec.Signer != actor {
75 75 out = append(out, fmt.Sprintf(
76 76 "%s: the record names %s as the account that reported it, but %s pushed it; "+
77 77 "a runner reports its own results", where, rec.Signer, actor))
@@ -96,7 +96,7 @@ func recordProblems(g *git.Repo, store *runs.Store, rec runs.Record, actor, acto
96 96 switch {
97 97 case run.Repo != repoName:
98 98 out = append(out, fmt.Sprintf("%s: run %s belongs to %s", where, rec.RunID, run.Repo))
99 case run.Status != runs.StatusRunning || run.LeaseOwner != actorID:
99 case run.Status != runs.StatusRunning || run.LeaseOwner != actor:
100 100 out = append(out, fmt.Sprintf(
101 101 "%s: %s is not running under %s's lease right now (%s), so only the runner holding it can report it",
102 102 where, rec.RunID, actor, describe(run)))