Gitslice docs

CI Checks

Checks are build/test/lint commands defined in your source. They run automatically on every new patchset and can gate submit. No separate CI service to configure — checks run on a machine you control and report back.

How it works

  • Defined in source: checks live in .gitslice/checks.yaml files committed alongside your code — one per folder. They are versioned with the revision they apply to.
  • Folder-scoped & cascading: for each path a patchset changes, every checks.yaml from that folder up to the repository root applies. A check defined in backend/ only runs when something under backend/ changes; an optional paths filter narrows it further.
  • Runs on each patchset: when you capture a patchset (including each agent turn), the applicable checks run and their pass/fail is recorded against that patchset. A new patchset re-runs them.
  • Gates submit: a slice can mark checks as required. The changeset cannot submit until every required check passes for the current patchset.
  • Where they run: in the common case checks run on the same machine that authored the change (your agent or CLI), in a container when an image is set, otherwise directly. Checks that need files beyond the slice run on the slice's designated CI daemon.

The checks.yaml format

Place this at <folder>/.gitslice/checks.yaml. A check's id is its folder path plus its name, e.g. backend/test.

version: 1

# optional defaults applied to every check in this file
defaults:
  image: "golang:1.22"     # run in this container; omit to run on the host
  timeout: "10m"
  setup:                   # baked once into a cached image, reused across runs
    - "apt-get update && apt-get install -y protobuf-compiler"

checks:
  test:
    run: "go test ./..."   # required: the shell command
    paths: ["**/*.go"]     # optional: only run when these change
  lint:
    run: "golangci-lint run"
  smoke:
    run: "./scripts/smoke.sh"
    include: ["/go.mod", "/go.sum"]  # extra paths to make available
    network: true                    # allow network (default: denied)
  • run (required) — the command, run via sh -c from the check's folder. Exit 0 passes.
  • paths — globs (folder-relative, or /-absolute); the check is skipped if none match the change.
  • image, env, network, timeout, working_dir, include — all optional per check (or under defaults).
  • setup — commands run once to prepare the container image (install toolchains/system packages). The result is baked into a cached image and reused on later runs, so setup does not repeat. Keep it change-independent (no workspace files); use a dependency cache for per-change caches like go mod or npm.

Run the applicable checks for your current workspace at any time with gs ci — it runs the same set locally (with setup/run timing) and reports pass/fail without capturing or submitting.

Add checks

  1. 1

    Commit a checks.yaml

    Add .gitslice/checks.yaml at the folder you want to guard, with one or more checks. It is a normal source file in your slice.

  2. 2

    Mark the ones that must pass

    Make a check required so it gates submit. Reference it by its qualified id (folder path + name).

    gs slice update <account>:<slice> --required-check backend/test
  3. 3

    Capture and watch

    Capture a patchset (or let your agent do it). Applicable checks run and show on the changeset's Checks panel; required failures block submit until fixed.

    gs submit   # blocked until required checks pass
  4. 4

    Optional: a designated CI runner

    Checks that need files outside the slice (e.g. a repo-root check) run on a daemon you designate for the slice, in Settings or via the CLI.

    gs slice set-ci-daemon <account>:<slice> <daemon-id>

Understand the model

See how changesets, patchsets, and submit validation fit together.

Run an agent

Let an agent author changes — checks run on each of its turns.