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

ci/agent/agent.go +5−5

@@ -218,7 +218,7 @@ type runnerRequest struct {
218 218 // readable before it finishes.
219 219 Step *runs.StepEvent `json:"step,omitempty"`
220 220 // Repos is the --repos filter, sent with every lease. The server intersects it
221 // with what the account's allowlists grant, so it can only narrow.
221 // with what the account's role grants, so it can only narrow.
222 222 Repos []string `json:"repos,omitempty"`
223 223 // Labels are what this machine is, sent with every lease so the server can match
224 224 // them against the runs-on a job asked for.
@@ -261,7 +261,7 @@ type Options struct {
261 261 // Dir is where checkouts are cached. Empty means the user cache directory.
262 262 Dir string
263 263 // Repos narrows this runner to the named repositories. The server intersects
264 // it with the account's runner allowlist, so it can only subtract.
264 // it with the account's runner role, so it can only subtract.
265 265 Repos []string
266 266 // Labels describe the machine. A job is only leased to a runner carrying every
267 267 // label the job asked for with runs-on.
@@ -744,7 +744,7 @@ type runnerSession struct {
744 744 name string
745 745 // repos is the --repos filter, sent with every lease. It is what the operator
746 746 // asked for, not the effective list: the server intersects it with the grant on
747 // each request, so an allowlist edit takes effect without a restart.
747 // each request, so a role edit takes effect without a restart.
748 748 repos []string
749 749 // cacheRoot is where this runner keeps the caches it mounts into jobs. cacheReuse
750 750 // says whether a job keeps what the last one wrote; with --no-cache the directory
@@ -796,10 +796,10 @@ func (s *runnerSession) describe(name string, jobs int) string {
796 796 func checkRepoFilter(asked []string, who runnerReply) error {
797 797 if len(asked) == 0 {
798 798 if len(who.Repos) == 0 {
799 // Not an error: an allowlist nobody has written yet is a normal state, and it
799 // Not an error: a role nobody has granted yet is a normal state, and it
800 800 // takes effect without a restart. Say so instead of idling silently.
801 801 fmt.Fprintf(os.Stderr, "vole runner: %s may not run jobs for any repository yet; "+
802 "waiting (an admin allows it with `vole admin acl runners add <repo> %s`)\n",
802 "waiting (an admin grants it with `vole admin acl set-role <repo> %s runner`)\n",
803 803 who.Name, who.Name)
804 804 }
805 805 return nil