Skip to content

docs(adr): 0033 — the run is the unit of evidence, not the node (#218… #559

docs(adr): 0033 — the run is the unit of evidence, not the node (#218…

docs(adr): 0033 — the run is the unit of evidence, not the node (#218… #559

Workflow file for this run

name: test
on:
push:
branches: [main]
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version: '1.25'
cache: true
- name: go vet
run: go vet ./...
- name: gofmt check
run: |
unformatted=$(gofmt -l .)
if [ -n "$unformatted" ]; then
echo "gofmt needed on:"
echo "$unformatted"
exit 1
fi
- name: go test
run: go test ./... -race -count=1
# A PR that changes anything but the changelog must say what changed.
#
# This replaces a Go test that asked the same question with the wrong trigger.
# It ran on `main` over `git log <lastTag>..HEAD`, so a PR's own merge commit
# did not exist while its CI was green and did exist the instant it landed:
# every merge turned `main` red until somebody wrote the entry afterwards. It
# caught five genuinely missing entries in v0.9.0 — two of them user-visible
# fixes — and then cost five round trips to its own timing.
#
# Asked here instead, it is answerable BEFORE the merge, by the person who
# knows what changed, while they are still looking at it.
#
# Skipping stays allowed and stays loud: put `no-changelog` in the PR body.
#
# What counts as an entry is decided by scripts/changelog-entry-check.sh, not
# here: this job used to ask only whether CHANGELOG.md appeared in the changed
# list, so a trailing space passed and so did an entry filed under an already
# released heading (#208). The script is a file rather than an inline block so
# that it can be run on a branch before pushing — a guard nobody can run
# outside CI is a guard nobody falsifies.
changelog:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
persist-credentials: false
- name: an entry, or a reason
run: |
set -o pipefail
base="origin/${{ github.base_ref }}"
merge_base=$(git merge-base "$base" HEAD)
changed=$(git diff --name-only "$merge_base"...HEAD)
echo "$changed" | sed 's/^/ /'
outside=$(echo "$changed" | grep -v '^CHANGELOG\.md$' || true)
if [ -z "$outside" ]; then
echo "nothing outside CHANGELOG.md changed"; exit 0
fi
if sh scripts/changelog-entry-check.sh "$merge_base"; then
exit 0
fi
if printf '%s' "$BODY" | grep -qi 'no-changelog'; then
echo "excused by the PR body"; exit 0
fi
echo "::error::this PR changes files but adds no CHANGELOG.md entry." >&2
echo "Write one under ## [Unreleased], or put 'no-changelog' in the PR body with a reason." >&2
exit 1
env:
BODY: ${{ github.event.pull_request.body }}
# Heavy -race repetition over the concurrency-sensitive packages (flake
# post-mortem, v0.3.0). Gated on a paths filter so it only runs when the
# diff touches those packages — unrelated PRs skip it entirely, reporting
# green having repeated nothing.
#
# Required on main since #183, and enforced against admins. The comment that
# stood here said the opposite ("do NOT add it to branch protection required
# checks yet") for as long as it had already been required (#209).
stress:
runs-on: ubuntu-latest
# paths-filter lists changed files via the API on pull_request events;
# pin the permission it needs so a future restricted-default token
# setting cannot silently break the filter.
permissions:
contents: read
pull-requests: read
steps:
- uses: actions/checkout@v7
- uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4
id: changes
with:
filters: |
concurrency:
- 'internal/schedule/**'
- 'internal/runner/**'
- 'internal/runfeed/**'
- 'internal/verify/**'
- uses: actions/setup-go@v7
if: steps.changes.outputs.concurrency == 'true'
with:
go-version: '1.25'
cache: true
- name: go test (stress)
if: steps.changes.outputs.concurrency == 'true'
run: go test ./internal/schedule ./internal/runner ./internal/runfeed ./internal/verify -race -count=200