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.

Replace the runner allowlist with a runner role

648cd81bde97042f682a528ebb9ce6353b95bf3f · Keenan Nemetz · 1d ago · parent ea92d754

forge/landing/gate.go +14−7

@@ -270,8 +270,8 @@ func (g Gate) CheckSummary(sha, branch string) ([]string, bool, error) {
270 270 case !g.ACL.CanReport(att.Signer):
271 271 add(fmt.Sprintf(
272 272 "%s: job %q passed for %s, but %s reported it and is not a runner for this "+
273 "repository (runners: %s) — so the result is recorded and does not count. "+
274 "An admin can allow that account with `vole admin acl runners add %s %s`, "+
273 "repository (%s) — so the result is recorded and does not count. "+
274 "An admin can grant the runner role with `vole admin acl set-role %s %s runner`, "+
275 275 "or a permitted runner can run the job",
276 276 wf.Path, job.ID, format.SHA(sha), att.Signer,
277 277 RunnerSummary(g.ACL), g.Name, att.Signer), false)
@@ -322,11 +322,18 @@ func failureReason(run *runs.Run) string {
322 322 return "the runner recorded no reason"
323 323 }
324 324
325 // RunnerSummary renders the allowlist for a message. Admins are named as implicit
326 // because an operator reading the refusal needs to know who already counts.
325 // RunnerSummary names the accounts that already hold the runner role, plus the
326 // implicit ones, for a refusal message. An operator reading it needs to know who
327 // already counts before granting the role to somebody else.
327 328 func RunnerSummary(a *access.ACL) string {
328 if len(a.Runners) == 0 {
329 return "none named, so only admins"
329 var named []string
330 for _, p := range a.Principals() {
331 if a.RepositoryRoleFor(p) == access.Runner {
332 named = append(named, p)
333 }
334 }
335 if len(named) == 0 {
336 return "none besides maintainers and admins"
330 337 }
331 return strings.Join(a.Runners, ", ") + " and admins"
338 return strings.Join(named, ", ") + ", plus maintainers and admins"
332 339 }