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/vole.git

Write over SSH with a registered key:

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

A free and open-source forge that lives in your Git repo.

#261

Read a run and its log from the CLI

merged · by keenan 1h ago · merged into main at 2e6aa96e by keenan 52m ago

keenan opened this 1h ago

The runs page and a run’s log were browser-only. vole change show could say a check failed, but the only run commands were cancel and rerun, and both need the 26-character id that only the page showed. There was no way to ask what a job did or read the output from a terminal.

This adds the read half of the run page over the same key-authenticated SSH channel the CLI already uses for history and secrets:

  • vole run list [--state] [--branch] [--commit <sha>] [--limit] [--format] lists the repository’s runs, newest first. The commit filter is an exact id or a prefix; --format supports the same %(field) spelling as issue list.
  • vole run show <id> prints the status, commit, trigger, pinned workflow and job, steps with exit codes and durations, each attempt’s log size, artifacts, the runner that reported it, and whether the result counts as a check by the same rule the landing gate uses.
  • vole run logs <id> [--attempt N] [--step N] streams the attempt’s log to stdout with nothing added. The default is the attempt the run is on, or the newest logged attempt once it has finished. Refusals go to stderr, so a redirect gets a log or an empty file, never an error at the top.

Reading is the repository’s read capability, the same rule the runs page uses; a run id from another repository is a miss, not a cross-repository read.

vole change show now also prints the runs for the head, and for the combined result when the landing needs one. That is the missing step in the diagnosis workflow: a red combined: line now carries the id to pass to run show and run logs without opening the browser.

The queue gets one Search method for status, branch and SHA-prefix filtering; it is the runs page’s query without the pager. Tests cover the filter, a reader listing and opening a finished run, the exact log bytes, a step range, a cross-repository id, and a missing log writing nothing to stdout.

Checked with vole workflow check, go vet ./..., and vole workflow run verify (all steps, including the race suite). Closes #244.

Discussion (1)

keenan 54m ago

The first verify run failed in TestWorkflowRunSharesAJobBudget: it expects “timed out after 300ms” but the local runner prints the remaining job budget, which was 295ms on the loaded CI machine. That test is timing-sensitive and unrelated to this change. Rerunning the job passed on 2e6aa96.

While retrying, I found a real bug in the existing run verbs: an omitted –remote was passed as the empty remote name, so cancel/rerun refused with “no remote named ""”. The run commands now default to origin like the other metadata commands, and 2e6aa96 carries that fix.