CI recipe
verify --run exits 0 only for a passing verdict (selected-and-full-suite-passed,
selected-passed (full suite not run), or nothing-selected for a change with no behavioural effect). Every other
verdict, including regression, failing (…) and any not verified: …, exits 1, and a cancelled run exits
130. That makes it usable as a CI step as-is.
Before you add it
Section titled “Before you add it”- Run
repo-ai init --agent nonelocally and commit.repo-ai/config.toml,.repo-ai/context/and the.gitignoreblock, so the CI checkout starts from the same configuration. The index itself (.repo-ai/state/) is never committed and is rebuilt in CI. - If
repo-ai verifycannot establish your test command, setverify_test_commandin.repo-ai/config.toml. - Make the release wheel reachable from CI (see Install) and put its URL or path in the
REPO_AI_WHEELvariable below.
Workflow
Section titled “Workflow”# .github/workflows/verify.yml — EXAMPLE, untested by the repo-ai maintainersname: repo-ai verifyon: pull_request:
permissions: contents: read
jobs: verify: runs-on: ubuntu-latest env: REPO_AI_WHEEL: ${{ vars.REPO_AI_WHEEL }} # the wheel URL or path from the Install page steps: - uses: actions/checkout@v7 with: fetch-depth: 0 # verify needs the base revision's history
- uses: actions/setup-python@v7 with: python-version: "3.12"
- name: Install the project's test dependencies run: python -m pip install -r requirements.txt pytest # adapt to your project
- name: Install repo-ai run: python -m pip install "$REPO_AI_WHEEL"
- name: Install bubblewrap and allow unprivileged user namespaces run: | sudo apt-get update -q && sudo apt-get install -y -q bubblewrap sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 || true
- name: Index the repository run: | repo-ai init --agent none git status --porcelain # should be empty if the init output is committed repo-ai sandbox status
- name: Verify the pull request against its base run: repo-ai verify --run --base "origin/${{ github.base_ref }}"- User namespaces. bubblewrap needs unprivileged user namespaces. Recent Ubuntu images restrict them through
AppArmor; the
sysctlline relaxes that on the runner, as repo-ai’s own sandbox CI job does. On a runner where you cannot change it, use a container instead: install Docker or podman and pass--sandbox docker(with--imagefor an image that has your dependencies; it must exist locally and is never pulled). - Full suite before merge. The selection is not the full suite. Add
--fullto run the whole suite in the same sandbox, or keep your existing test job alongside this one. - Time bound.
--deadline SECONDScaps the total wall-clock of all test processes; anything it cuts makes the run “not verified”, never a pass. - Machine-readable output. Add
--jsonfor asummaryobject (verdict,new_failures,pre_existing, …) you can post as a comment with your own tooling. repo-ai itself does not post anything. - Windows runners have no host sandbox; use
--sandbox dockeror--sandbox podman. - What a green check means: the tests that ran observed a pass in the sandbox. It is not a statement that the change is correct.