beads/.github/workflows/regression.yml
Jim Wordelman e0840ad2fa
fix: raise Differential Regression CI timeout budget (#6271)
* fix: green — Fix: differential-regression CI budget is under the suite's own passing wall time (5 spurious reds/day) (refs be-3r5pr)

* docs(release-gates): PASS 7/7 — be-kqg23 (differential-regression CI budget fix)

Deploy bead be-23wcp, source commit 3afba49b69.
All 7 criteria raw PASS, no waivers. 62 pre-existing make-test FAILs
attributed to tracked bead be-9ogs6 via 4-part proof. Criterion 3c
(CI-config-diff live-run): PR #6271's own "Differential Regression"
job ran green under the new 40m/45m budget. PR #6271 open against
gastownhall/beads (contributor-only rig — no merge-request routed).

* chore: remove leaked internal release-gate doc from PR branch

  release-gates/be-kqg23-gate.md

Tracked our internal gc-management/beads-rig release-gate checklist and
should never have been committed to this upstream branch -- it's process
residue from our deploy tooling, not part of the change itself.

Per maintainer bee-ghosttrack's request during review of PR #6571. The
root cause (our deploy tooling auto-committing this file) is already fixed
as of gm-qatxl1; this branch predates that fix, so this commit is cleanup
only -- no other content on this branch is touched.

Ref: be-lk7o3
2026-09-28 14:16:01 -07:00

133 lines
5.2 KiB
YAML

name: Regression Tests
on:
# Run on merges to main
push:
branches: [main]
pull_request:
branches: [main, 'release/**']
# Allow manual trigger
workflow_dispatch:
env:
BD_DISABLE_METRICS: "1"
BD_DISABLE_EVENT_FLUSH: "1"
jobs:
detect-regression-need:
name: Detect regression need
runs-on: ubuntu-latest
outputs:
run_regression: ${{ steps.detect.outputs.run_regression }}
reason: ${{ steps.detect.outputs.reason }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
with:
fetch-depth: 0
- name: Decide whether to run differential regression tests
id: detect
env:
EVENT_NAME: ${{ github.event_name }}
PR_BASE_SHA: ${{ github.event.pull_request.base.sha }}
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: |
set -euo pipefail
if [[ "$EVENT_NAME" != "pull_request" ]]; then
echo "run_regression=true" >> "$GITHUB_OUTPUT"
echo "reason=$EVENT_NAME event always runs regression tests" >> "$GITHUB_OUTPUT"
exit 0
fi
labels="$(jq -r '.pull_request.labels[].name // empty' "$GITHUB_EVENT_PATH")"
if grep -Fxq "run-regression" <<<"$labels"; then
echo "run_regression=true" >> "$GITHUB_OUTPUT"
echo "reason=run-regression label present" >> "$GITHUB_OUTPUT"
exit 0
fi
if grep -Fxq "skip-regression" <<<"$labels"; then
echo "run_regression=false" >> "$GITHUB_OUTPUT"
echo "reason=skip-regression label present" >> "$GITHUB_OUTPUT"
exit 0
fi
changed="$(git diff --name-only "$PR_BASE_SHA" "$PR_HEAD_SHA")"
echo "Changed files:"
printf '%s\n' "$changed"
regression_candidates="$(
printf '%s\n' "$changed" |
grep -Ev '^(cmd/bd|internal/storage|internal/types)/.*_test\.go$' ||
true
)"
risky_pattern='^(\.github/workflows/regression\.yml|Makefile|go\.(mod|sum)|cmd/bd/|internal/storage/|internal/types/|tests/regression/)'
if grep -Eq "$risky_pattern" <<<"$regression_candidates"; then
echo "run_regression=true" >> "$GITHUB_OUTPUT"
echo "reason=PR changes CLI, storage, types, regression, or build inputs" >> "$GITHUB_OUTPUT"
exit 0
fi
echo "run_regression=false" >> "$GITHUB_OUTPUT"
echo "reason=PR does not touch regression-sensitive paths" >> "$GITHUB_OUTPUT"
regression:
name: Differential Regression (v0.49.6 baseline)
needs: detect-regression-need
if: needs.detect-regression-need.outputs.run_regression == 'true'
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Show regression trigger reason
run: echo "${{ needs.detect-regression-need.outputs.reason }}"
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: 'go.mod'
- name: Configure Git
run: |
git config --global user.name "CI Bot"
git config --global user.email "ci@beads.test"
- name: Install Dolt
run: ./scripts/ci/install-dolt.sh
- name: Configure Dolt
run: |
dolt config --global --add user.name "CI Bot"
dolt config --global --add user.email "ci@beads.test"
dolt version
- name: Pull Dolt sql-server image
# Without this, isDoltImageCached() returns false in TestMain and the
# regression suite falls back to embedded Dolt with HOME=<tmpdir>, which
# has a known cleanup race (see beads issue: TestCreateWithParentFlag
# TempDir RemoveAll "directory not empty" flake). Keep the tag in sync
# with internal/testutil/testdoltcommon.go:DoltDockerImage.
run: ./scripts/ci/pull-dolt-image.sh
- name: Cache baseline binary
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v5
with:
path: ~/.cache/beads-regression
key: regression-baseline-${{ hashFiles('tests/regression/BASELINE_VERSION') }}
# Passing-side wall time already overlapped the go deadline below, so
# ordinary GitHub-runner speed variance -- not a real hang -- was
# tripping this step. Measured over the 100 most recent Regression
# Tests runs (2026-09-03/04, ~29.5h): p50 593s (~10m), max passing
# 1189s (~19.8m) against the prior 1200s (20m) cap, and 5 runs in that
# window hit the identical `panic: test timed out after 20m0s` with
# zero `--- FAIL` lines -- a budget defect, not a regression. Match
# main.yml's Test job fix for the same failure mode: raise the go
# deadline to cover the observed slowdown and keep it inside a larger
# finite job budget (see timeout-minutes above), so the go deadline
# fires first and prints goroutine stacks -- a REAL hang stays
# diagnosable instead of being cut off by a bare job kill.
- name: Run regression tests
run: go test -tags=regression,gms_pure_go -timeout=40m -v ./tests/regression/...