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.

Phase 4 slice 1: workflow format, validated at the push that introduces it

8fe238d48181201272a44d9ba7b8d97342afa4ca · Keenan Nemetz · 17d ago · parent 1e955bfb

Phase 4 slice 1: workflow format, validated at the push that introduces it

.vole/workflows/*.yaml is parsed in pre-receive for any push that touches it, so a
broken workflow fails the push that added it, naming the file and every problem in
it. The alternative — accepting the file and discovering months later that it
never ran — is the failure this exists to prevent.

  version: 1
  on: {push: {branches: [main, "release/*"]}}   # globs, default: every branch
  jobs: {test: {steps: [{run: go test ./..., timeout: 20m}]}}

Strict by construction:

- Unknown keys are rejected rather than ignored, so `runs-on:` or a typo'd `setps:`
  cannot silently do nothing.
- Every problem is reported in one rejection, not the first one only: a person
  fixes the file once instead of once per push.
- Job names, step bodies, timeouts (default 10m, cap 1h) and the directory layout
  are all checked, including files that are not .yaml/.yml and nested directories.
- The validator is in internal/workflow and `vole workflow check` runs the same
  code, so client and server cannot disagree about what is valid.

Validation is scoped by a diff: a push that does not touch the workflow directory
costs one `git diff` and nothing else.

Adds gopkg.in/yaml.v3 (already in the module cache). Nothing executes yet — the
queue, runner and status reporting are the next slice, and the README says so
plainly rather than implying CI runs.

Verified on a live instance: pushing a workflow with a step that runs nothing and a
9h timeout is rejected with both problems named; the corrected file pushes and
`vole workflow list` reports `ci.yaml  on main,release/*  test(2 steps)`.

cmd/vole/main.go +4

@@ -75,6 +75,8 @@ Usage:
75 75 vole request update <id> --head <rev>
76 76 vole request approve <id> [--as <user>]
77 77 vole request close|reopen <id>
78 vole workflow check [--dir path]
79 vole workflow list [--dir path]
78 80
79 81 Options follow git convention: --long value, --long=value, -o value, -ovalue.
80 82 Options come before arguments; -- ends option parsing.
@@ -106,6 +108,8 @@ func run(args []string) error {
106 108 return cmdIssue(args[1:])
107 109 case "request", "requests", "cr":
108 110 return cmdRequest(args[1:])
111 case "workflow":
112 return cmdWorkflow(args[1:])
109 113 case "hook":
110 114 return cmdHook(args[1:])
111 115 case "version", "-v", "--version":