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.

Let the CLI cancel a run, not only the browser

deb024d49d894a5a51b1a5bdc07e66c672f113ab · Keenan Nemetz · 6d ago · parent 0c14f078

Let the CLI cancel a run, not only the browser

#168 promised the same account the same actions through either transport, and
canceling a running run had just become a browser-only action. The queue is
instance-side, so the CLI asks over the key it already pushes with:
`vole run cancel <id>` retires a queued run or asks a running one to stop, checks
the same maintainer capability the page checks, and writes the same audit record.
The server verb takes one repository and one run id and answers one line; the id
is the 26-character one in the run page URL.

The audit action is now `run.cancel` for both transports, because it is the same
action: an operator looking for canceled runs should not have to know which
surface asked.

Part of #162.

server/ssh/server.go +9−1

@@ -454,6 +454,14 @@ func (s *Server) exec(ch xssh.Channel, req *xssh.Request, command, user, fp, rem
454 454 exit(ch, s.serveChangeStatus(ch, argv, user, remote))
455 455 return
456 456 }
457 // Canceling a run is a write to the repository's CI queue, not to a ref. The verb
458 // is the CLI counterpart of the browser's cancel button, and the handler asks the
459 // same maintainer capability before it touches the queue.
460 if len(argv) >= 1 && argv[0] == "vole-run-cancel" {
461 req.Reply(true, nil)
462 exit(ch, s.serveRunCancel(ch, argv, user))
463 return
464 }
457 465 // A manual workflow run is a write to the repository's CI queue, not to a ref.
458 466 // The verb is the CLI counterpart of the browser's Run workflow form; the
459 467 // dispatcher re-checks the maintainer capability before it queues anything.
@@ -511,7 +519,7 @@ func (s *Server) exec(ch xssh.Channel, req *xssh.Request, command, user, fp, rem
511 519 return
512 520 }
513 521 if len(argv) != 2 {
514 refuse("only git-upload-pack, git-receive-pack, vole-admin, vole-roster, vole-whoami, vole-runner, vole-change-merge, vole-change-status and vole-workflow-dispatch are available")
522 refuse("only git-upload-pack, git-receive-pack, vole-admin, vole-roster, vole-whoami, vole-runner, vole-change-merge, vole-change-status, vole-run-cancel and vole-workflow-dispatch are available")
515 523 return
516 524 }
517 525 verb := argv[0]