How-to · Steward
Vouching for your work
Run a repository's tests yourself and vouch for the commit, so you know it passes before you merge, and the Steward's build releases it without testing it again. When a vouch counts, why vouch refuses, and the steps to give your AI coding assistant.
- Article
- 1304
- Applies to
- Steward 0.36.139
- Last reviewed
- For
- For developers
Why vouch#
At each build, the Steward tests the newest commit on a repository's branch before it releases it. Vouching runs that test before you merge: vouch runs the repository's tests on this PC, and when they pass, marks the commit as tested on GitHub. You know the pull request passes before you merge it, and the build doesn't test it again. See You merge, it builds.
Vouch for a pull request#
In the clone you pushed from, with the pull request's head checked out and nothing uncommitted:
node $HOME\.steward\app\src\cli.ts vouchOr vouch 134, to name the pull request rather than the one for this branch. It:
- Runs the repository's tests in your clone, at its HEAD, with the commands Castellan's Settings > Developer > Repositories give it. Where
npm testis Node's own test runner, it runs only the test files the change reaches, while Tests only what a change reaches is on in the Steward's settings. - When they pass, sets a commit status on that commit on GitHub:
steward/tested, success. A failure sets none, and says "Nothing was recorded". - Says what's next: "merge it yourself now, once GitHub says it merges cleanly (gh pr merge 17 --repo octocat/example-app --merge): the Steward merges no one's PRs, and the next build releases main. Push to it again, and vouch again."
Then merge it yourself. The Steward never merges it for you.
Code that already passed isn't run again. When the Assayer's check, or an earlier run of the whole tests here, passed on exactly this code, vouch sets the status at once and says where the pass came from.
Tests that run long are stopped. Once a repository has a few passing vouches, one that runs five minutes past its usual time is stopped, and nothing is set.
A branch with no pull request yet#
You can vouch for a pushed branch before you open its pull request, once a version is claimed for that branch. The status goes on the pushed commit. Then open the pull request from that commit, and merge it. The Steward doesn't open it for you.
In a repository that keeps its changelog entries in a changes/ folder, no version is claimed, so open the pull request first, then vouch.
When a vouch counts#
A build takes a vouch only when all of these hold:
- One of your team's accounts set it. GitHub records who did. Your team is the account
ghis signed in as, unless you name others under Team in the Steward's settings. - It's on the branch's newest commit, or on the head of a pull request merged while it was up to date with its branch, so the merge brought it in unchanged.
Push to a pull request after vouching, and vouch again. Merge one that's behind its branch, and the build tests the merge first. The status isn't a check GitHub runs, so it never makes a pull request's checks "passing" on its own.
When vouch refuses#
It says why, in a sentence:
- It has uncommitted changes: commit and push them first. It vouches only for a commit as pushed.
- The pull request's head isn't this clone's HEAD: push, or check out its head, and vouch again.
- This clone is on no branch: name the pull request,
vouch <number>. - No open pull request for this branch, or the one you named is closed or merged: push, and open one.
- The branch has no pull request, and no version is claimed for it: claim one, push, open its pull request, and vouch again.
- It's from a fork: only pull requests from the repository itself are vouched for.
- The repository isn't one the Steward looks after: it has no tests to run. See Choosing what the Steward looks after.
Tell your assistant#
Give your AI coding assistant the steps in its instructions file, so it claims and vouches on its own. For example:
Before work that raises a repository's version, claim the version from the Steward once you know your branch:
node %USERPROFILE%\.steward\app\src\cli.ts claim-version <repo> --branch <branch> --for "<what the work is>"
Set exactly the version it hands out, in the files it names and in CHANGELOG.md. If it says the repository
rides the build pipeline, write the changelog entry in the changes/ file it names instead, and leave the
version files and CHANGELOG.md as they are.
Once the branch is pushed and its pull request open, vouch for it from its clone, with nothing uncommitted:
node %USERPROFILE%\.steward\app\src\cli.ts vouch
Vouch again after every push. If it fails, fix what failed. When it passes, tell me the pull request is
ready to merge.If you'd rather your assistant merged too, tell it so, with gh pr merge <number> --repo <owner/name> --merge once GitHub says the pull request merges cleanly.
Related articles
Is this page right?
If something on it is wrong or out of date, tell us and we'll fix the page.
Still stuck? Write to support@castellan-software.com and mention article 1304. Every version of Steward, and what changed in it, is in its release notes.