Review F1. PR Risk's coverage decision read the mutable RBE_WEST_WORKERS variable in a different run from pr.yml's rbe job, so unsetting it and re-running one workflow could leave both required checks green with neither the legacy tier nor the Bazel lane having run the tier. - Both workflows now commit BAZEL_RETIRES_LEGACY_EMBEDDED (policy-tested equal) and run the identical bazel-embedded-coverage job: covered = flag && pull_request && !fork && executor secret present. RBE_WEST_WORKERS is no longer read by PR Risk at all. - pr.yml's ci-gate requires the job's result (BAZEL_EMBEDDED_COVERAGE) and BAZEL_EMBEDDED_RETIRED, which is red when covered but the Bazel embedded lane did not run remotely and pass (mode skip included). - Revert is a commit of the flag to "false" in both workflows; in-flight PRs pick it up on their next push. The kill-switch runbook now flips the flag first. Tests run both decision steps, bazel.yml's rbe step and pr.yml's real gate step over every event/var/secret/fork/flag combination, with the variable differing between the two runs, and require no double-green without the tier. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1971 lines
87 KiB
YAML
1971 lines
87 KiB
YAML
name: PR
|
|
|
|
on:
|
|
pull_request:
|
|
# release/** is here because release-prep and release-fix PRs are based on
|
|
# the release branch, not on main. Without it they run almost no CI and the
|
|
# first full signal is the tag build, where a failure burns the tag.
|
|
branches: [ main, 'release/**' ]
|
|
merge_group:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
BD_DISABLE_METRICS: "1"
|
|
BD_DISABLE_EVENT_FLUSH: "1"
|
|
# D2 step 1: "true" retires PR Risk's legacy embedded-Dolt test jobs on
|
|
# same-repo pull_requests that have the RBE executor secret; pr.yml's
|
|
# gated Bazel lane is then the tier's only pre-merge run, and pr.yml's
|
|
# gate goes red unless that lane ran remotely and passed. Committed, not a
|
|
# repo variable, so a re-run can never change it; must equal pr.yml's /
|
|
# pr-risk.yml's copy (scripts/pr_risk_bazel_coverage_test.go). Revert:
|
|
# commit "false" in both workflows (in-flight PRs pick it up on their next
|
|
# push or merge of main).
|
|
BAZEL_RETIRES_LEGACY_EMBEDDED: "true"
|
|
|
|
jobs:
|
|
|
|
build-artifacts:
|
|
name: Build Artifacts
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set up Go
|
|
id: setup-go
|
|
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
cache: false
|
|
|
|
- name: Restore Go module cache
|
|
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
|
with:
|
|
path: ~/go/pkg/mod
|
|
key: beads-go-mod-v2-${{ runner.os }}-${{ runner.arch }}-go-${{ steps.setup-go.outputs.go-version }}-${{ hashFiles('go.mod', 'go.sum') }}
|
|
restore-keys: beads-go-mod-v2-${{ runner.os }}-${{ runner.arch }}-go-${{ steps.setup-go.outputs.go-version }}-
|
|
|
|
- name: Restore non-race Go build cache
|
|
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
|
with:
|
|
path: ${{ runner.temp }}/go-cache/non-race
|
|
key: beads-go-build-v2-${{ runner.os }}-${{ runner.arch }}-go-${{ steps.setup-go.outputs.go-version }}-base-gms_pure_go-non-race-${{ github.sha }}
|
|
restore-keys: beads-go-build-v2-${{ runner.os }}-${{ runner.arch }}-go-${{ steps.setup-go.outputs.go-version }}-base-gms_pure_go-non-race-
|
|
|
|
- name: Build reusable Linux artifacts
|
|
env:
|
|
GOCACHE: ${{ runner.temp }}/go-cache/non-race
|
|
run: |
|
|
set -euo pipefail
|
|
mkdir -p artifacts
|
|
source ./.buildflags
|
|
go_version="$(go version)"
|
|
commit="$(git rev-parse HEAD)"
|
|
go build -tags "$BEADS_BUILD_TAGS" -o artifacts/bd-linux-gms-pure ./cmd/bd
|
|
chmod +x artifacts/bd-linux-gms-pure
|
|
(
|
|
cd artifacts
|
|
sha256sum bd-linux-gms-pure > SHA256SUMS
|
|
)
|
|
{
|
|
echo "commit=${commit}"
|
|
echo "go_version=${go_version}"
|
|
echo "build_tags=${BEADS_BUILD_TAGS}"
|
|
echo "artifact=bd-linux-gms-pure"
|
|
} > artifacts/build-manifest.txt
|
|
|
|
- name: Upload build artifacts
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
|
|
with:
|
|
name: ci-build-artifacts
|
|
path: artifacts/
|
|
retention-days: 1
|
|
if-no-files-found: error
|
|
|
|
# examples/ holds separate Go modules that reach the parent through a
|
|
# `replace` directive, so their go.mod/go.sum record the parent's whole
|
|
# dependency graph and go stale whenever the root module's does. Nothing in
|
|
# CI compiled them, so that drift was invisible: on 2026-08-01 BOTH example
|
|
# modules failed a plain `go build` on main with "updates to go.mod needed".
|
|
# Examples are the first code a new user copies; this keeps them buildable.
|
|
#
|
|
# Advisory on purpose, and NOT in ci-gate's required list.
|
|
#
|
|
# Because of the `replace` directive, any root go.mod change that is not
|
|
# mirrored into the examples fails this job. Whether that should block a merge
|
|
# is a maintainer call about contributor friction, so this PR does not make it
|
|
# one. Advisory has to be implemented at the STEP level: a job-level
|
|
# continue-on-error job still reports its check run as FAILURE in the PR
|
|
# rollup (only the workflow-run conclusion turns success), and pr-preflight
|
|
# and the pr-babysit merge patrol gate on per-check-run conclusions — so a
|
|
# job-level red here would stall the merge lane repo-wide while claiming to
|
|
# be optional. Step-level continue-on-error (the cygwin-leg precedent below)
|
|
# keeps the check run green and surfaces failures as warning annotations.
|
|
#
|
|
# To promote it to a real gate: drop the step's continue-on-error and the
|
|
# warning step, then add `build-examples` to ci-gate's `needs`,
|
|
# `CI_GATE_REQUIRED`, and its env map.
|
|
build-examples:
|
|
name: Build example modules
|
|
runs-on: ubuntu-latest
|
|
# No job-level timeout on purpose: a job-level timeout CANCELS the job,
|
|
# and a cancelled advisory job is a red check run — blocking again by a
|
|
# different door. Instead every step below carries its own
|
|
# timeout-minutes AND continue-on-error, so a hang or failure anywhere
|
|
# (setup download stall, cache stall, build hang) degrades to a warning
|
|
# annotation while the job itself always concludes green.
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
|
|
id: checkout
|
|
continue-on-error: true
|
|
timeout-minutes: 5
|
|
|
|
- name: Set up Go
|
|
id: setup-go
|
|
continue-on-error: true
|
|
timeout-minutes: 5
|
|
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
cache: false
|
|
|
|
# The examples' dependency graph is the parent module's (via the
|
|
# `replace` directive), so the repo-wide module cache key is a
|
|
# near-perfect hit; without it this job cold-downloads the whole
|
|
# dolt-sized graph on every PR.
|
|
- name: Restore Go module cache
|
|
continue-on-error: true
|
|
timeout-minutes: 5
|
|
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
|
with:
|
|
path: ~/go/pkg/mod
|
|
key: beads-go-mod-v2-${{ runner.os }}-${{ runner.arch }}-go-${{ steps.setup-go.outputs.go-version }}-${{ hashFiles('go.mod', 'go.sum') }}
|
|
restore-keys: beads-go-mod-v2-${{ runner.os }}-${{ runner.arch }}-go-${{ steps.setup-go.outputs.go-version }}-
|
|
|
|
- name: Type-check every module under examples/
|
|
id: build-examples
|
|
if: steps.checkout.outcome == 'success' && steps.setup-go.outcome == 'success'
|
|
continue-on-error: true
|
|
timeout-minutes: 10
|
|
run: ./scripts/build-examples.sh
|
|
|
|
- name: Warn when example modules are stale or fail to build
|
|
if: steps.build-examples.outcome == 'failure'
|
|
run: |
|
|
echo "::warning title=Example modules out of date::examples/ failed to type-check against this tree. Run 'go mod tidy' in each module under examples/ (see scripts/build-examples.sh output above). Advisory only; this does not block the merge."
|
|
|
|
- name: Warn when the advisory job could not run at all
|
|
if: steps.checkout.outcome != 'success' || steps.setup-go.outcome != 'success'
|
|
run: |
|
|
echo "::warning title=Example build check skipped::checkout or Go setup failed, so examples/ could not be checked this run (checkout: ${{ steps.checkout.outcome }}, setup-go: ${{ steps.setup-go.outcome }}). Advisory only; this does not block the merge."
|
|
|
|
# Fast check: every `go build|test|run|generate|install` invocation in
|
|
# tracked scripts/hooks/CI carries -tags=gms_pure_go. Prevents ICU-linkage
|
|
# regressions from re-entering the build (see engdocs/ICU-POLICY.md).
|
|
check-build-tags:
|
|
name: Check build-tag policy
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
|
|
- run: ./scripts/check-build-tags.sh
|
|
- run: ./scripts/check-go-install-guidance.sh
|
|
- run: ./scripts/check-winget-portable-alias.sh
|
|
|
|
# Lock in two CGO-disabled portability boundaries. cmd/bd carries a mix of
|
|
# cgo-only test helpers (embedded Dolt, sql.DB) and pure-Go tests; compiling
|
|
# and running its pure-Go subset prevents test contamination (mybd-ycx /
|
|
# GH#3683 follow-up). internal/hooks also declares a js/wasm boundary where
|
|
# process execution must fail explicitly, so this required leaf job compiles
|
|
# the complete package test binary and executes that exact contract under
|
|
# Node rather than allowing a missing platform implementation to recur.
|
|
check-cmd-bd-puregeo-tests:
|
|
name: Check pure-Go and js/wasm boundaries (CGO_ENABLED=0)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
cache: false
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v6
|
|
with:
|
|
node-version: '24'
|
|
|
|
- name: Run js/wasm hook boundary
|
|
env:
|
|
CGO_ENABLED: "0"
|
|
GOARCH: wasm
|
|
GOOS: js
|
|
run: |
|
|
set -euo pipefail
|
|
|
|
# This required lane owns the exact js/wasm refusal contract. If the
|
|
# wasm test surface grows, widen this selector and its count guard
|
|
# together rather than assuming compilation executes new tests.
|
|
test_status=0
|
|
test_output="$(go test -tags gms_pure_go -count=1 -timeout=2m \
|
|
-exec="$(go env GOROOT)/lib/wasm/go_js_wasm_exec" \
|
|
-run '^TestRunHookReportsUnsupportedExecution$' \
|
|
-v ./internal/hooks 2>&1)" || test_status=$?
|
|
printf '%s\n' "$test_output"
|
|
(( test_status == 0 )) || exit "$test_status"
|
|
|
|
run_count=0
|
|
pass_count=0
|
|
nonpass_count=0
|
|
pass_pattern='^--- PASS: TestRunHookReportsUnsupportedExecution \([0-9.]+s\)$'
|
|
nonpass_pattern='^[[:space:]]*--- (FAIL|SKIP): '
|
|
while IFS= read -r line; do
|
|
if [[ "$line" == "=== RUN TestRunHookReportsUnsupportedExecution" ]]; then
|
|
((run_count += 1))
|
|
fi
|
|
if [[ "$line" =~ $pass_pattern ]]; then
|
|
((pass_count += 1))
|
|
fi
|
|
if [[ "$line" =~ $nonpass_pattern ]]; then
|
|
((nonpass_count += 1))
|
|
fi
|
|
done <<< "$test_output"
|
|
if (( run_count != 1 || pass_count != 1 || nonpass_count != 0 )); then
|
|
printf 'expected one exact js/wasm hook test run and pass with no failures or skips; got runs=%s passes=%s nonpasses=%s\n' \
|
|
"$run_count" "$pass_count" "$nonpass_count" >&2
|
|
exit 1
|
|
fi
|
|
|
|
- name: Build cmd/bd (CGO_ENABLED=0, gms_pure_go)
|
|
env:
|
|
CGO_ENABLED: "0"
|
|
run: go build -tags gms_pure_go -o /tmp/bd-puregeo ./cmd/bd
|
|
|
|
- name: Compile pure-Go test binaries (CGO_ENABLED=0, gms_pure_go)
|
|
env:
|
|
CGO_ENABLED: "0"
|
|
run: |
|
|
go test -tags gms_pure_go -c -o /tmp/bd-cmd-puregeo-test ./cmd/bd
|
|
go test -tags gms_pure_go -c -o /tmp/bd-embeddeddolt-puregeo-test ./internal/storage/embeddeddolt
|
|
go test -tags gms_pure_go -c -o /tmp/bd-tracker-puregeo-test ./internal/tracker
|
|
|
|
- name: Run pure-Go cmd/bd test subset (CGO_ENABLED=0)
|
|
env:
|
|
CGO_ENABLED: "0"
|
|
# Restrict to tests that exercise pure-Go code paths. Tests that
|
|
# need a Dolt store skip themselves at runtime when no test server
|
|
# is available; the goal here is to catch compile-time contamination,
|
|
# not run the full suite.
|
|
run: |
|
|
go test -tags gms_pure_go -count=1 -short -run '^Test(Help|CheckRemoteSafety|FormatDestroyToken|ShouldWireInitRemote|ExtractPrefix|IsNumericID|GetWorktreeGitDir|DriftItemStatuses|RunDriftChecks|IsServerProbablyRunning|CheckHooksDriftNotGitRepo|CheckServerDriftNoBeadsDir|CheckRemoteDriftNoBeadsDir|NocgoFactoriesHonorSharedServer|NocgoNewDoltStoreFromConfig_ErrorSuggestsCorrectFlag|NocgoNewReadOnlyStoreFromConfig_ErrorSuggestsCorrectFlag)' ./cmd/bd
|
|
|
|
# Compile every shipped release target on every PR, so a platform-gating
|
|
# mistake is caught here instead of at tag time (#5662).
|
|
#
|
|
# Coverage boundary, recorded so the green is not over-read: every leg below
|
|
# builds CGO_ENABLED=0, but .goreleaser.yml builds bd-linux-amd64,
|
|
# bd-linux-arm64 and bd-windows-amd64 with CGO_ENABLED=1, and the darwin pair
|
|
# is built natively at CGO_ENABLED=1 by release.yml's goreleaser-macos job.
|
|
# Five of these eight legs are therefore a weaker proxy than the binary they
|
|
# stand for: the cgo half of the tree (beads_cgo.go ->
|
|
# internal/storage/embeddeddolt) is never compiled here, so a break confined
|
|
# to it still passes this check. Only android/arm64, windows/arm64 and
|
|
# freebsd/amd64 replicate their release configuration exactly.
|
|
#
|
|
# The build scope is deliberately ./... and not the ./cmd/bd that every
|
|
# .goreleaser.yml build id declares as main:. Compiling the whole tree per
|
|
# platform is intentional extra coverage, not an oversight.
|
|
check-release-target-cross-compilation:
|
|
name: Check release target cross-compilation (${{ matrix.goos }}/${{ matrix.goarch }})
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- goos: linux
|
|
goarch: amd64
|
|
- goos: linux
|
|
goarch: arm64
|
|
- goos: android
|
|
goarch: arm64
|
|
- goos: darwin
|
|
goarch: amd64
|
|
- goos: darwin
|
|
goarch: arm64
|
|
- goos: windows
|
|
goarch: amd64
|
|
- goos: windows
|
|
goarch: arm64
|
|
- goos: freebsd
|
|
goarch: amd64
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
|
|
|
|
- name: Set up Go
|
|
id: setup-go
|
|
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
cache: false
|
|
|
|
- name: Restore Go module cache
|
|
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
|
with:
|
|
path: ~/go/pkg/mod
|
|
key: beads-go-mod-v2-${{ runner.os }}-${{ runner.arch }}-go-${{ steps.setup-go.outputs.go-version }}-${{ hashFiles('go.mod', 'go.sum') }}
|
|
restore-keys: beads-go-mod-v2-${{ runner.os }}-${{ runner.arch }}-go-${{ steps.setup-go.outputs.go-version }}-
|
|
|
|
- name: Build complete release target tree
|
|
env:
|
|
CGO_ENABLED: "0"
|
|
GOARCH: ${{ matrix.goarch }}
|
|
GOOS: ${{ matrix.goos }}
|
|
run: go build -tags gms_pure_go ./...
|
|
|
|
# The lingering-handle liveness regression test is //go:build windows: the
|
|
# Ubuntu job above selects it by name but compiles it out, and main.yml's
|
|
# Windows job runs only on pushes to main (build/smoke, no go test). Run
|
|
# the liveness pair and native config fixture on Windows so their platform
|
|
# regressions actually execute at PR time. The init credential shell
|
|
# fixtures are a separate concern and run natively in
|
|
# pr-preflight-platforms, not here.
|
|
test-windows-liveness:
|
|
name: Test (Windows) cmd/bd liveness regression
|
|
runs-on: windows-latest
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
|
|
|
|
- name: Set up Go
|
|
id: setup-go
|
|
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
cache: false
|
|
|
|
- name: Run native Windows global Prime override
|
|
shell: bash
|
|
env:
|
|
CGO_ENABLED: "1"
|
|
run: |
|
|
go_path=$(command -v go)
|
|
[[ "$("$go_path" env GOHOSTOS GOOS)" == $'windows\nwindows' ]]
|
|
test_status=0
|
|
test_output=$(./scripts/test.sh -v -timeout 5m -run '^TestPrimeBinaryPortfolio$/^TestPrime_HookJSON_GlobalPrimeOverride$' -count=1 ./cmd/bd) || test_status=$?
|
|
printf '%s\n' "$test_output"
|
|
((test_status == 0))
|
|
pass_pattern='^[[:space:]]*--- PASS: TestPrimeBinaryPortfolio/TestPrime_HookJSON_GlobalPrimeOverride \('
|
|
nonpass_pattern='^[[:space:]]*--- (FAIL|SKIP): '
|
|
pass_count=0
|
|
while IFS= read -r line; do
|
|
if [[ "$line" =~ $pass_pattern ]]; then
|
|
((pass_count += 1))
|
|
fi
|
|
if [[ "$line" =~ $nonpass_pattern ]]; then
|
|
exit 1
|
|
fi
|
|
done <<<"$test_output"
|
|
((pass_count == 1))
|
|
|
|
- name: Run Windows liveness regression test
|
|
run: go test -tags gms_pure_go -count=1 -run '^TestIsServerProbablyRunning' ./cmd/bd
|
|
|
|
# internal/doltversion carries Windows-specific branches (PATHEXT
|
|
# extension completion in Resolve, ERROR_BAD_EXE_FORMAT detection, the
|
|
# executable-bit carve-out) and its behavioral tests run there via .cmd
|
|
# stubs — but the Ubuntu test jobs compile those branches without ever
|
|
# executing them. Same pattern as the liveness job above: run exactly
|
|
# this package on windows-latest so the platform it targets actually
|
|
# exercises it at PR time. Small on purpose (~1 min).
|
|
test-windows-doltversion:
|
|
name: Test (Windows) doltversion package
|
|
runs-on: windows-latest
|
|
timeout-minutes: 15
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
|
|
|
|
- name: Set up Go
|
|
id: setup-go
|
|
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
cache: false
|
|
|
|
- name: Run doltversion package tests on Windows
|
|
run: go test -tags gms_pure_go -count=1 ./internal/doltversion/
|
|
|
|
# Destructive worktree removal depends on native Windows path identity.
|
|
# This focused process suite requires NTFS per-directory case sensitivity
|
|
# and fails (rather than skips) when the runner cannot provide it.
|
|
worktree-remove-windows:
|
|
name: Worktree remove boundary (Windows)
|
|
runs-on: windows-latest
|
|
timeout-minutes: 15
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
|
|
|
|
- name: Set up Go
|
|
id: setup-go
|
|
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
cache: false
|
|
|
|
- name: Restore Go module cache
|
|
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
|
with:
|
|
path: ~/go/pkg/mod
|
|
key: beads-go-mod-v2-${{ runner.os }}-${{ runner.arch }}-go-${{ steps.setup-go.outputs.go-version }}-${{ hashFiles('go.mod', 'go.sum') }}
|
|
restore-keys: beads-go-mod-v2-${{ runner.os }}-${{ runner.arch }}-go-${{ steps.setup-go.outputs.go-version }}-
|
|
|
|
- name: Restore non-race Go build cache
|
|
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
|
with:
|
|
path: ${{ runner.temp }}/go-cache/non-race
|
|
key: beads-go-build-v2-${{ runner.os }}-${{ runner.arch }}-go-${{ steps.setup-go.outputs.go-version }}-base-gms_pure_go-non-race-${{ github.sha }}
|
|
restore-keys: beads-go-build-v2-${{ runner.os }}-${{ runner.arch }}-go-${{ steps.setup-go.outputs.go-version }}-base-gms_pure_go-non-race-
|
|
|
|
- name: Run native Windows worktree removal boundary tests
|
|
env:
|
|
CGO_ENABLED: "0"
|
|
GOCACHE: ${{ runner.temp }}/go-cache/non-race
|
|
run: go test -tags gms_pure_go -count=1 -run '^TestWorktreeRemove' ./cmd/bd
|
|
|
|
# internal/storage/dbproxy/server carries the platform-portable path
|
|
# handling that #5820 introduced (testPlatformPath, external dolt config
|
|
# validation, DSN shaping), and until now no PR-triggered job executed the
|
|
# package on Windows - the platform those paths target - so a path-shaped
|
|
# regression stayed invisible until someone ran it by hand (the #5820
|
|
# review merged on a contributor's windows/amd64 attestation for exactly
|
|
# that reason). Same pattern as the focused jobs above: run exactly this
|
|
# package on windows-latest. Tests that need a dolt binary Skipf loudly
|
|
# (dolt is not installed on the Windows runners), and the unix-socket
|
|
# cases skip on Windows by design - the portability class this job guards
|
|
# runs without either.
|
|
#
|
|
# Deliberately NOT added to ci-gate's `needs`/`CI_GATE_REQUIRED`/env map,
|
|
# following the `test-macos` precedent above: promoting a new job to
|
|
# required-for-merge is a maintainer call once it has run clean for a while.
|
|
# Until then it runs on every PR and surfaces red on the PR page without
|
|
# blocking the merge lane. Say the word and I will wire it into the gate in
|
|
# the same PR - the three edits are `ci-gate.needs`, `CI_GATE_REQUIRED`, and
|
|
# `TEST_WINDOWS_DBPROXY_SERVER: ${{ needs.test-windows-dbproxy-server.result }}`.
|
|
test-windows-dbproxy-server:
|
|
name: Test (Windows) dbproxy server package
|
|
runs-on: windows-latest
|
|
timeout-minutes: 15
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
|
|
|
|
- name: Set up Go
|
|
id: setup-go
|
|
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
cache: false
|
|
|
|
- name: Run dbproxy server package tests on Windows
|
|
env:
|
|
CGO_ENABLED: "0"
|
|
run: go test -tags gms_pure_go -count=1 -v ./internal/storage/dbproxy/server/
|
|
|
|
# Fast check to ensure all version files are in sync
|
|
check-version-consistency:
|
|
name: Check version consistency
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
|
|
|
|
- name: Check all versions match
|
|
run: ./scripts/check-versions.sh
|
|
|
|
# Migration hygiene: duplicate version numbers, nondeterministic SQL
|
|
# (UUID()/NOW()/RAND(), the #4259 root-cause class), and edits to migration
|
|
# files that already exist on the base branch (shipped migrations are
|
|
# frozen; fix forward with a new version). Fails at PR time, before any
|
|
# test even compiles. Details: scripts/check-migration-hygiene.sh.
|
|
check-migration-hygiene:
|
|
name: Check migration hygiene
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Run migration hygiene checks
|
|
env:
|
|
BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha }}
|
|
run: ./scripts/check-migration-hygiene.sh
|
|
|
|
# Check documentation references match actual CLI flags
|
|
check-doc-flags:
|
|
name: Check doc flags freshness
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
|
|
with:
|
|
# Full history so check-cli-docs-drift.sh can regenerate docs at the
|
|
# merge-base and only fail PRs for drift they actually introduced.
|
|
fetch-depth: 0
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
cache: false
|
|
|
|
- name: Build bd
|
|
run: CGO_ENABLED=0 go build -tags gms_pure_go -o bd ./cmd/bd/
|
|
|
|
- name: Validate docs against CLI
|
|
env:
|
|
DOC_DRIFT_PATCH_OUT: ${{ runner.temp }}/cli-docs-freshness.patch
|
|
run: |
|
|
./scripts/check-doc-flags.sh ./bd
|
|
./scripts/check-doc-freshness.sh
|
|
|
|
# When the drift check fails, it writes the exact regenerated-docs fix
|
|
# (produced with CI's canonical build) so contributors can apply it with
|
|
# `git apply` instead of reproducing CI's environment locally. The
|
|
# docs-autofix.yml workflow_run job consumes this same artifact to push
|
|
# the fix to same-repo PR branches automatically.
|
|
- name: Upload docs fix patch
|
|
if: failure()
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
|
|
with:
|
|
name: cli-docs-freshness-patch
|
|
path: ${{ runner.temp }}/cli-docs-freshness.patch
|
|
if-no-files-found: ignore
|
|
|
|
check-doc-freshness-platforms:
|
|
name: Check doc freshness (${{ matrix.os }})
|
|
runs-on: ${{ matrix.os }}
|
|
timeout-minutes: 10
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- os: ubuntu-latest
|
|
expected_goos: linux
|
|
- os: macos-latest
|
|
expected_goos: darwin
|
|
- os: windows-latest
|
|
expected_goos: windows
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
|
|
|
|
- name: Set up Go
|
|
id: setup-go
|
|
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
cache: false
|
|
|
|
- name: Restore Go module cache
|
|
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
|
with:
|
|
path: ~/go/pkg/mod
|
|
key: beads-go-mod-v2-${{ runner.os }}-${{ runner.arch }}-go-${{ steps.setup-go.outputs.go-version }}-${{ hashFiles('go.mod', 'go.sum') }}
|
|
restore-keys: beads-go-mod-v2-${{ runner.os }}-${{ runner.arch }}-go-${{ steps.setup-go.outputs.go-version }}-
|
|
|
|
- name: Exercise native date and Bash process boundary
|
|
run: go test '-tags=integration,gms_pure_go' -count=1 -run '^TestDocFreshness' ./scripts
|
|
|
|
- name: Exercise repository text EOL policy boundary
|
|
run: go test '-tags=integration,gms_pure_go' -count=1 ./scripts/gitattributespolicy -args -required-host -expected-goos '${{ matrix.expected_goos }}'
|
|
|
|
pr-preflight-platforms:
|
|
name: PR preflight process (${{ matrix.os }})
|
|
runs-on: ${{ matrix.os }}
|
|
timeout-minutes: 20
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
include:
|
|
- os: ubuntu-latest
|
|
expected_goos: linux
|
|
- os: macos-latest
|
|
expected_goos: darwin
|
|
- os: windows-latest
|
|
expected_goos: windows
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
|
|
|
|
- name: Set up Go
|
|
id: setup-go
|
|
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
cache: false
|
|
|
|
- name: Restore Go module cache
|
|
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
|
with:
|
|
path: ~/go/pkg/mod
|
|
key: beads-go-mod-v2-${{ runner.os }}-${{ runner.arch }}-go-${{ steps.setup-go.outputs.go-version }}-${{ hashFiles('go.mod', 'go.sum') }}
|
|
restore-keys: beads-go-mod-v2-${{ runner.os }}-${{ runner.arch }}-go-${{ steps.setup-go.outputs.go-version }}-
|
|
|
|
- name: Exercise the real Bash process boundary
|
|
shell: bash
|
|
run: go test '-tags=integration,gms_pure_go' -count=1 -run '^TestPRPreflight' ./scripts
|
|
|
|
- name: Check native user config diagnostics
|
|
shell: bash
|
|
env:
|
|
CGO_ENABLED: "0"
|
|
run: bash scripts/ci/test-user-config-diagnostic.sh '${{ matrix.expected_goos }}'
|
|
|
|
- name: Exercise test.sh prebuilt binary path
|
|
shell: bash
|
|
run: go test '-tags=gms_pure_go' -count=1 -run '^TestTestScriptPrebuiltBinaryContract$' ./scripts
|
|
|
|
- name: Exercise generated Git hook timeout process boundary
|
|
shell: bash
|
|
run: go test '-tags=gms_pure_go' -count=1 -run '^TestGeneratedHookTimeoutProcessBoundary$' ./cmd/bd
|
|
|
|
- name: Exercise native init gateway credential shell
|
|
shell: bash
|
|
run: bash scripts/ci/test-init-gateway-credential.sh "$RUNNER_OS"
|
|
|
|
- name: Exercise credential command fixtures on Windows
|
|
if: matrix.os == 'windows-latest'
|
|
shell: pwsh
|
|
env:
|
|
CGO_ENABLED: "0"
|
|
run: |
|
|
$go = (Get-Command go -CommandType Application -ErrorAction Stop | Select-Object -First 1).Source
|
|
$hostInfo = @(& $go env GOHOSTOS GOOS)
|
|
if ($LASTEXITCODE -ne 0 -or ($hostInfo -join ',') -ne 'windows,windows') {
|
|
throw 'Credential fixtures require native Windows Go'
|
|
}
|
|
$expected = @{
|
|
'github.com/steveyegge/beads/internal/testutil/credentialcmd' = @('TestProtocol')
|
|
'github.com/steveyegge/beads/internal/creds' = @(
|
|
'TestCommandSourceRealShell', 'TestCredentialCommandFixtureProtocol')
|
|
'github.com/steveyegge/beads/internal/storage/dolt' = @(
|
|
'TestApplyGatewayCredentialCommand', 'TestApplyGatewayCredentialJSONEnvelope',
|
|
'TestApplyGatewayCredentialFailsClosed', 'TestApplyGatewayCredentialPresetWins',
|
|
'TestApplyGatewayCredentialRejectsBadCharToken', 'TestApplyResolvedConfigGatewayCredential')
|
|
}
|
|
$selector = '^(' + (($expected.Values | ForEach-Object { $_ }) -join '|') + ')$'
|
|
$raw = & $go test -json -tags gms_pure_go -count=1 -run $selector @($expected.Keys)
|
|
$testStatus = $LASTEXITCODE
|
|
$events = @($raw | ForEach-Object { $_ | ConvertFrom-Json -ErrorAction Stop })
|
|
$events | Where-Object Output | ForEach-Object { [Console]::Write($_.Output) }
|
|
if ($testStatus -ne 0) { exit $testStatus }
|
|
if (@($events | Where-Object { $_.Action -in 'fail', 'skip' }).Count -ne 0) {
|
|
throw 'Credential fixtures must pass without skips'
|
|
}
|
|
foreach ($package in $expected.Keys) {
|
|
foreach ($test in $expected[$package]) {
|
|
$passes = @($events | Where-Object {
|
|
$_.Package -eq $package -and $_.Test -eq $test -and $_.Action -eq 'pass'
|
|
})
|
|
if ($passes.Count -ne 1) { throw "Expected one PASS for $package/$test" }
|
|
}
|
|
}
|
|
|
|
- name: Check benchmark environment scrubbing
|
|
if: matrix.os == 'windows-latest'
|
|
shell: bash
|
|
run: go test -tags gms_pure_go -count=1 -run '^(TestCleanEnvUsesHostKeySemantics|TestBenchmarkCommandBuildersStripDoltEnvOverrides)$' ./scripts/repro-dolt-prod-timeouts
|
|
|
|
- name: Check shared environment key semantics
|
|
if: matrix.os == 'windows-latest'
|
|
shell: bash
|
|
run: bash scripts/ci/test-windows-env-helpers.sh
|
|
|
|
# Fast check to catch accidental .beads/issues.jsonl changes from contributors
|
|
check-no-beads-changes:
|
|
name: Check for .beads changes
|
|
runs-on: ubuntu-latest
|
|
if: github.event_name == 'pull_request'
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Check for .beads/issues.jsonl changes
|
|
run: |
|
|
if git diff --name-only origin/${{ github.base_ref }}...HEAD | grep -q "^\.beads/issues\.jsonl$"; then
|
|
echo "This PR includes changes to .beads/issues.jsonl"
|
|
echo ""
|
|
echo "This file is the project's issue database and should not be modified in PRs."
|
|
echo ""
|
|
echo "To fix, run:"
|
|
echo " git checkout origin/main -- .beads/issues.jsonl"
|
|
echo " git commit --amend"
|
|
echo " git push --force"
|
|
echo ""
|
|
exit 1
|
|
fi
|
|
echo "No .beads/issues.jsonl changes detected"
|
|
|
|
detect-package-gates:
|
|
name: Detect package gates
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
mcp_package: ${{ steps.detect.outputs.mcp_package }}
|
|
npm_package: ${{ steps.detect.outputs.npm_package }}
|
|
reason: ${{ steps.detect.outputs.reason }}
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Decide package gates
|
|
id: detect
|
|
env:
|
|
PR_BASE_SHA: ${{ github.event.pull_request.base.sha }}
|
|
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
|
|
PUSH_BEFORE_SHA: ${{ github.event.before }}
|
|
PUSH_AFTER_SHA: ${{ github.sha }}
|
|
run: ./scripts/ci/detect-package-gates.sh
|
|
|
|
package-mcp:
|
|
name: Package Gate (MCP)
|
|
runs-on: ubuntu-latest
|
|
needs: [detect-package-gates, build-artifacts]
|
|
steps:
|
|
- name: Check applicability
|
|
id: applicability
|
|
run: |
|
|
echo "run=${{ needs.detect-package-gates.outputs.mcp_package }}" >> "$GITHUB_OUTPUT"
|
|
if [[ "${{ needs.detect-package-gates.outputs.mcp_package }}" != "true" ]]; then
|
|
echo "MCP package gate is not applicable: ${{ needs.detect-package-gates.outputs.reason }}"
|
|
fi
|
|
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
|
|
if: steps.applicability.outputs.run == 'true'
|
|
|
|
- name: Set up Python
|
|
if: steps.applicability.outputs.run == 'true'
|
|
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
with:
|
|
python-version: '3.14'
|
|
|
|
- name: Install uv
|
|
if: steps.applicability.outputs.run == 'true'
|
|
run: python -m pip install uv==0.11.16
|
|
|
|
- name: Download build artifacts
|
|
if: steps.applicability.outputs.run == 'true'
|
|
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
|
|
with:
|
|
name: ci-build-artifacts
|
|
path: ci-build-artifacts
|
|
|
|
- name: Verify build artifacts
|
|
if: steps.applicability.outputs.run == 'true'
|
|
run: |
|
|
set -euo pipefail
|
|
cd ci-build-artifacts
|
|
sha256sum -c SHA256SUMS
|
|
chmod +x bd-linux-gms-pure
|
|
|
|
- name: Run MCP package gate
|
|
if: steps.applicability.outputs.run == 'true'
|
|
env:
|
|
BEADS_TEST_BD_BINARY: ${{ github.workspace }}/ci-build-artifacts/bd-linux-gms-pure
|
|
run: make ci-package-mcp
|
|
|
|
package-npm:
|
|
name: Package Gate (npm)
|
|
runs-on: ubuntu-latest
|
|
needs: [detect-package-gates, build-artifacts]
|
|
steps:
|
|
- name: Check applicability
|
|
id: applicability
|
|
run: |
|
|
echo "run=${{ needs.detect-package-gates.outputs.npm_package }}" >> "$GITHUB_OUTPUT"
|
|
if [[ "${{ needs.detect-package-gates.outputs.npm_package }}" != "true" ]]; then
|
|
echo "npm package gate is not applicable: ${{ needs.detect-package-gates.outputs.reason }}"
|
|
fi
|
|
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
|
|
if: steps.applicability.outputs.run == 'true'
|
|
|
|
- name: Set up Node.js
|
|
if: steps.applicability.outputs.run == 'true'
|
|
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v6
|
|
with:
|
|
node-version: '24'
|
|
|
|
- name: Download build artifacts
|
|
if: steps.applicability.outputs.run == 'true'
|
|
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
|
|
with:
|
|
name: ci-build-artifacts
|
|
path: ci-build-artifacts
|
|
|
|
- name: Verify build artifacts
|
|
if: steps.applicability.outputs.run == 'true'
|
|
run: |
|
|
set -euo pipefail
|
|
cd ci-build-artifacts
|
|
sha256sum -c SHA256SUMS
|
|
chmod +x bd-linux-gms-pure
|
|
|
|
- name: Run npm package gate
|
|
if: steps.applicability.outputs.run == 'true'
|
|
env:
|
|
BEADS_TEST_BD_BINARY: ${{ github.workspace }}/ci-build-artifacts/bd-linux-gms-pure
|
|
run: make ci-package-npm
|
|
|
|
|
|
pr-policy-wrapper:
|
|
name: PR Policy (wrapper timing)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
cache: false
|
|
|
|
# The module fetch is the only part of this job that talks to the network,
|
|
# and setup-go above runs with cache: false, so every run pulls the whole
|
|
# module graph from the proxy. Doing it here, retried, means a proxy blip
|
|
# costs seconds instead of failing a required check.
|
|
#
|
|
# Deliberately NOT wrapped around the build: `make ci-pr-policy` runs a
|
|
# `go build ./cmd/bd` (scripts/ci/pr-policy.sh, build_docs_binary), and a
|
|
# compile error is not transient. Retrying it would make a genuinely broken
|
|
# build take three attempts to report and look like a slow one. The fetch
|
|
# has a legitimate transient failure mode; the build does not.
|
|
#
|
|
# 3 attempts x 120s + 2 backoffs x 10s = 380s worst case. 8m leaves ~100s
|
|
# of headroom, matching the bounded apt-get steps in migration-test.yml.
|
|
- name: Download modules
|
|
timeout-minutes: 8
|
|
run: |
|
|
downloaded=""
|
|
for attempt in 1 2 3; do
|
|
if timeout 120 go mod download; then
|
|
downloaded=yes
|
|
break
|
|
fi
|
|
echo "::warning::go mod download attempt $attempt failed or timed out"
|
|
# No backoff after the final attempt - there is nothing left to wait for.
|
|
if [ "$attempt" -lt 3 ]; then
|
|
sleep 10
|
|
fi
|
|
done
|
|
# Unlike the best-effort apt-get retries elsewhere in this repo, this
|
|
# one is load-bearing: nothing downstream can build without the
|
|
# modules. Fail here, naming the fetch, so a module outage is not
|
|
# reported as a build failure.
|
|
if [ -z "$downloaded" ]; then
|
|
echo "::error::go mod download failed after 3 attempts - module fetch failure, not a build failure"
|
|
exit 1
|
|
fi
|
|
|
|
- name: Run PR policy wrapper
|
|
run: make ci-pr-policy
|
|
|
|
pr-core-wrapper:
|
|
name: PR Core (wrapper timing)
|
|
runs-on: ubuntu-latest
|
|
needs: build-artifacts
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
|
|
|
|
- name: Set up Go
|
|
id: setup-go
|
|
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
cache: false
|
|
|
|
- name: Restore Go module cache
|
|
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
|
with:
|
|
path: ~/go/pkg/mod
|
|
key: beads-go-mod-v2-${{ runner.os }}-${{ runner.arch }}-go-${{ steps.setup-go.outputs.go-version }}-${{ hashFiles('go.mod', 'go.sum') }}
|
|
restore-keys: beads-go-mod-v2-${{ runner.os }}-${{ runner.arch }}-go-${{ steps.setup-go.outputs.go-version }}-
|
|
|
|
- name: Restore race Go build cache
|
|
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
|
with:
|
|
path: ${{ runner.temp }}/go-cache/race
|
|
key: beads-go-build-v2-${{ runner.os }}-${{ runner.arch }}-go-${{ steps.setup-go.outputs.go-version }}-base-gms_pure_go-race-${{ github.sha }}
|
|
restore-keys: beads-go-build-v2-${{ runner.os }}-${{ runner.arch }}-go-${{ steps.setup-go.outputs.go-version }}-base-gms_pure_go-race-
|
|
|
|
- name: Install Dolt
|
|
run: ./scripts/ci/install-dolt.sh
|
|
|
|
- name: Configure Git and Dolt identity
|
|
run: |
|
|
git config --global user.name "CI Bot"
|
|
git config --global user.email "ci@beads.test"
|
|
dolt config --global --add user.name "CI Bot"
|
|
dolt config --global --add user.email "ci@beads.test"
|
|
|
|
- name: Download build artifacts
|
|
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
|
|
with:
|
|
name: ci-build-artifacts
|
|
path: ci-build-artifacts
|
|
|
|
- name: Verify build artifacts
|
|
run: |
|
|
set -euo pipefail
|
|
cd ci-build-artifacts
|
|
sha256sum -c SHA256SUMS
|
|
chmod +x bd-linux-gms-pure
|
|
|
|
- name: Run PR core wrapper
|
|
env:
|
|
BEADS_TEST_REQUIRE_EXCLUDE_PERMISSION: '1'
|
|
BEADS_TEST_BD_BINARY: ${{ github.workspace }}/ci-build-artifacts/bd-linux-gms-pure
|
|
GOCACHE: ${{ runner.temp }}/go-cache/race
|
|
run: make ci-pr-core
|
|
|
|
pr-lint-wrapper:
|
|
name: PR Lint (wrapper timing)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
|
|
with:
|
|
# --new-from-merge-base below walks real history.
|
|
fetch-depth: 0
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
cache: false
|
|
|
|
- name: Install golangci-lint
|
|
run: go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.10.1
|
|
|
|
# Scope the wrapper's lint to what this PR introduces, matching the
|
|
# `lint` job's only-new-issues below. main.yml runs the same wrapper with
|
|
# this unset, so the whole tree is still swept on every push to main.
|
|
# Both PR triggers (pull_request, merge_group) target main.
|
|
- name: Run PR lint wrapper
|
|
env:
|
|
BD_LINT_NEW_FROM_MERGE_BASE: origin/main
|
|
run: make ci-pr-lint
|
|
|
|
# Advisory architecture signal. This deliberately does not participate in
|
|
# ci-gate while maintainers evaluate the baseline and refactoring payoff.
|
|
complexity-report:
|
|
name: Complexity report (advisory)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
|
|
timeout-minutes: 3
|
|
continue-on-error: true
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set up Go
|
|
timeout-minutes: 3
|
|
continue-on-error: true
|
|
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
cache: false
|
|
|
|
- name: Install gocyclo
|
|
timeout-minutes: 5
|
|
continue-on-error: true
|
|
run: go install github.com/fzipp/gocyclo/cmd/gocyclo@v0.6.0
|
|
|
|
- name: Generate complexity report
|
|
id: generate-complexity
|
|
if: always()
|
|
timeout-minutes: 8
|
|
continue-on-error: true
|
|
run: |
|
|
set +e
|
|
COMPLEXITY_BASE_REF=origin/main ./scripts/ci/complexity.sh diff > complexity-report.txt 2>&1
|
|
status=$?
|
|
if [ "$status" -ne 0 ]; then
|
|
echo "complexity report unavailable (exit $status); see log above" >> complexity-report.txt
|
|
fi
|
|
exit 0
|
|
|
|
- name: Annotate unavailable complexity report
|
|
if: always()
|
|
timeout-minutes: 1
|
|
continue-on-error: true
|
|
run: |
|
|
if [ ! -s complexity-report.txt ] || grep -q 'complexity report unavailable' complexity-report.txt; then
|
|
echo "::warning title=Complexity report unavailable::Advisory complexity analysis did not complete; inspect the artifact or job log."
|
|
fi
|
|
|
|
- name: Upload complexity report
|
|
if: always()
|
|
timeout-minutes: 3
|
|
continue-on-error: true
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
|
|
with:
|
|
name: complexity-report
|
|
path: complexity-report.txt
|
|
retention-days: 7
|
|
if-no-files-found: error
|
|
|
|
# Focused job for the hexagonal storage layer (internal/storage/domain/* and
|
|
# internal/storage/uow). These packages back the proxied-server init path and
|
|
# also live behind the existing ./... matrix, but TestDomainDB requires the
|
|
# Dolt sql-server image cached locally (testcontainers checks `docker image
|
|
# inspect` and skips otherwise). Pulling the image up front guarantees the
|
|
# suite actually runs and surfaces failures here with a clear job name.
|
|
test-domain-uow:
|
|
name: Test (storage domain + uow)
|
|
runs-on: ubuntu-latest
|
|
needs: build-artifacts
|
|
# The race-enabled storage package has outgrown Go's implicit 10-minute
|
|
# timeout. Keep both per-package deadlines inside one finite job budget.
|
|
timeout-minutes: 30
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
cache: false
|
|
|
|
- name: Install Dolt CLI
|
|
run: ./scripts/ci/install-dolt.sh
|
|
|
|
- name: Verify dolt on PATH
|
|
run: dolt version
|
|
|
|
- name: Configure Git and Dolt identity
|
|
run: |
|
|
git config --global user.name "CI Bot"
|
|
git config --global user.email "ci@beads.test"
|
|
dolt config --global --add user.name "CI Bot"
|
|
dolt config --global --add user.email "ci@beads.test"
|
|
|
|
- name: Pull Dolt sql-server image
|
|
# Keep tag in sync with internal/testutil/testdoltcommon.go:DoltDockerImage.
|
|
# Without this, RequireDoltContainer reports doltNoImage and TestDomainDB skips.
|
|
run: ./scripts/ci/pull-dolt-image.sh
|
|
|
|
- name: Download build artifacts
|
|
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
|
|
with:
|
|
name: ci-build-artifacts
|
|
path: ci-build-artifacts
|
|
|
|
- name: Verify build artifacts
|
|
run: |
|
|
set -euo pipefail
|
|
cd ci-build-artifacts
|
|
sha256sum -c SHA256SUMS
|
|
chmod +x bd-linux-gms-pure
|
|
|
|
# The only lane with both the image and the pinned dolt CLI: compares
|
|
# the container and the local test server backend against the one
|
|
# checked-in fingerprint, so an image bump cannot drift the container
|
|
# side unnoticed. REQUIRE makes the container half fail, not skip.
|
|
- name: Test Dolt server fingerprint (container + local)
|
|
env:
|
|
BEADS_TEST_REQUIRE_DOLT_CONTAINER: "1"
|
|
run: go test -tags gms_pure_go -count=1 -timeout 5m -v -run '^TestDoltServerFingerprint$' ./internal/testutil/
|
|
|
|
- name: Test domain + uow + tracker
|
|
env:
|
|
BEADS_TEST_BD_BINARY: ${{ github.workspace }}/ci-build-artifacts/bd-linux-gms-pure
|
|
run: go test -tags gms_pure_go -race -count=1 -timeout 15m -v ./internal/storage/domain/... ./internal/storage/uow/... ./internal/tracker/...
|
|
|
|
# The doctor/fix DB-backed suite spins its own Dolt container in
|
|
# TestMain. BEADS_FIX_REQUIRE_DOLT=1 turns a missing container into a
|
|
# hard failure so the suite can never silently skip in CI again
|
|
# (bd-nxt5e: it was dark for months); this job pulls the image above.
|
|
- name: Test doctor/fix (Dolt-backed, hard-require container)
|
|
env:
|
|
BEADS_TEST_BD_BINARY: ${{ github.workspace }}/ci-build-artifacts/bd-linux-gms-pure
|
|
BEADS_FIX_REQUIRE_DOLT: "1"
|
|
run: go test -tags gms_pure_go -race -count=1 -timeout 10m -v ./cmd/bd/doctor/fix/
|
|
|
|
# macOS-only regressions were landing on main undetected: main.yml's Test
|
|
# (macos-latest) leg only runs `if: github.event_name == 'push' &&
|
|
# github.ref == 'refs/heads/main'`, so no PR ever exercises it. On
|
|
# 2026-08-01 that leg went red from three separately-merged PRs in a single
|
|
# day, all $TMPDIR=/var/folders symlink/path-depth consequences that only
|
|
# reproduce on macOS - none of the three could have seen the failure
|
|
# pre-merge, and the local bisect lane can't diagnose it either (Linux
|
|
# host, macOS-only failure). This job mirrors that leg's steps on every PR
|
|
# so the same class of regression fails here instead of on main. It is
|
|
# self-contained (no build-artifacts dependency): the macOS leg in main.yml
|
|
# never downloads or verifies the Linux build-artifacts bundle, it just
|
|
# builds and tests directly.
|
|
#
|
|
# Deliberately NOT continue-on-error: unlike the advisory legs elsewhere in
|
|
# this file that tolerate infrastructure flakiness, a red macOS test here is
|
|
# a real regression, and blocking the merge lane on it is the entire point.
|
|
#
|
|
# Deliberately NOT yet added to ci-gate's `needs`/`CI_GATE_REQUIRED`:
|
|
# promoting a new job to required-for-merge, once it has run clean for a
|
|
# while, is a separate maintainer call - same pattern as other jobs in this
|
|
# file that run on every PR without yet gating the merge.
|
|
test-macos:
|
|
name: Test (macos-latest)
|
|
runs-on: macos-latest
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
|
|
|
|
- name: Set up Go
|
|
id: setup-go
|
|
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
cache: false
|
|
|
|
- name: Restore Go module cache
|
|
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
|
with:
|
|
path: ~/go/pkg/mod
|
|
key: beads-go-mod-v2-${{ runner.os }}-${{ runner.arch }}-go-${{ steps.setup-go.outputs.go-version }}-${{ hashFiles('go.mod', 'go.sum') }}
|
|
restore-keys: beads-go-mod-v2-${{ runner.os }}-${{ runner.arch }}-go-${{ steps.setup-go.outputs.go-version }}-
|
|
|
|
- name: Restore non-race Go build cache
|
|
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
|
with:
|
|
path: ${{ runner.temp }}/go-cache/non-race
|
|
key: beads-go-build-v2-${{ runner.os }}-${{ runner.arch }}-go-${{ steps.setup-go.outputs.go-version }}-base-gms_pure_go-non-race-${{ github.sha }}
|
|
restore-keys: beads-go-build-v2-${{ runner.os }}-${{ runner.arch }}-go-${{ steps.setup-go.outputs.go-version }}-base-gms_pure_go-non-race-
|
|
|
|
- name: Restore race Go build cache
|
|
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
|
with:
|
|
path: ${{ runner.temp }}/go-cache/race
|
|
key: beads-go-build-v2-${{ runner.os }}-${{ runner.arch }}-go-${{ steps.setup-go.outputs.go-version }}-base-gms_pure_go-race-${{ github.sha }}
|
|
restore-keys: beads-go-build-v2-${{ runner.os }}-${{ runner.arch }}-go-${{ steps.setup-go.outputs.go-version }}-base-gms_pure_go-race-
|
|
|
|
- name: Install Dolt (Linux/macOS)
|
|
run: ./scripts/ci/install-dolt.sh
|
|
|
|
- name: Verify dolt on PATH
|
|
run: dolt version
|
|
|
|
- name: Configure Git and Dolt identity
|
|
run: |
|
|
git config --global user.name "CI Bot"
|
|
git config --global user.email "ci@beads.test"
|
|
dolt config --global --add user.name "CI Bot"
|
|
dolt config --global --add user.email "ci@beads.test"
|
|
|
|
- name: Build
|
|
env:
|
|
GOCACHE: ${{ runner.temp }}/go-cache/non-race
|
|
run: go build -v -tags gms_pure_go ./cmd/bd
|
|
|
|
- name: Test
|
|
env:
|
|
BEADS_TEST_BD_BINARY: ${{ github.workspace }}/bd
|
|
GOCACHE: ${{ runner.temp }}/go-cache/race
|
|
# -timeout is explicit for the same reason it is in scripts/ci/pr-core.sh
|
|
# (#6091): ./cmd/bd has outgrown `go test`'s 10m per-package default. On
|
|
# this runner it lands between 357s and 600s across recent runs — #6091's
|
|
# own macOS lane passed at 596.7s, 3.3s under the wall — so the package
|
|
# intermittently dies on the alarm and the panic names whichever test was
|
|
# in flight, which reads like a hang instead of the clock running out. 30m
|
|
# matches every other -race lane here for this same code.
|
|
run: go test -tags gms_pure_go -v -race -short -timeout=30m -skip '^TestEmbedded' ./...
|
|
|
|
# Producer-side guard for the Beads<->consumer CLI contract. Runs the whole
|
|
# cmd/bd/protocol package: the golden corpus (regenerated from this branch's
|
|
# bd and byte-compared to the committed testdata/corpus/, so an unreviewed
|
|
# wire change is a hard failure — run `make corpus-regen`), the double-run
|
|
# determinism check, and the TestProtocol_/TestJSONContract_ behavioral
|
|
# conformance suite that pins the CLI's JSON payloads and semantics.
|
|
#
|
|
# Run the PACKAGE, never a -run subset: a filter here is what let the
|
|
# conformance tests sit red on main for ~3 months while every CI run was
|
|
# green (they matched no job's -run, and every broad ./... job skips them
|
|
# for want of a Dolt store). Package scope means a newly added protocol test
|
|
# is gated the moment it lands.
|
|
#
|
|
# Needs the Dolt sql-server image (the protocol harness spins a container).
|
|
# ~10 min: each test builds an isolated Dolt-backed workspace. If that ever
|
|
# becomes unacceptable on PRs, shard this job by an exhaustive `go test
|
|
# -list` partition — do not reintroduce a hand-written -run regex.
|
|
contract-corpus:
|
|
name: Contract corpus (golden + determinism + conformance)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
cache: false
|
|
|
|
- name: Install Dolt CLI
|
|
run: ./scripts/ci/install-dolt.sh
|
|
|
|
- name: Configure Git and Dolt identity
|
|
run: |
|
|
git config --global user.name "CI Bot"
|
|
git config --global user.email "ci@beads.test"
|
|
dolt config --global --add user.name "CI Bot"
|
|
dolt config --global --add user.email "ci@beads.test"
|
|
|
|
- name: Pull Dolt sql-server image
|
|
# Keep tag in sync with internal/testutil/testdoltcommon.go:DoltDockerImage.
|
|
run: ./scripts/ci/pull-dolt-image.sh
|
|
|
|
- name: Protocol conformance + corpus golden + determinism
|
|
# Require a live Dolt store here: this is the gate that must exercise the
|
|
# conformance, golden and double-run checks, so a failed container is a
|
|
# hard failure, not a silent skip (see requireDoltStore in the
|
|
# cmd/bd/protocol tests).
|
|
#
|
|
# -timeout is explicit because the package runs well past `go test`'s
|
|
# 10m default; without it a slow runner reports a panic, not a verdict.
|
|
env:
|
|
BEADS_PROTOCOL_REQUIRE_DOLT: "1"
|
|
run: go test -tags gms_pure_go -count=1 -timeout 30m ./cmd/bd/protocol
|
|
|
|
fmt-check:
|
|
name: Check formatting
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
cache: false
|
|
|
|
- name: Check gofmt
|
|
run: make fmt-check
|
|
|
|
# Lint lanes are split deliberately: the PR lane reports only the issues a PR
|
|
# introduces, and main.yml's identical job sweeps the whole tree on every
|
|
# push. The tradeoff is that a pre-existing issue in untouched code no longer
|
|
# blocks a PR — but a lint word that lands on main now reds main's own run,
|
|
# where it belongs, instead of reddening every open PR for a change it did
|
|
# not make.
|
|
#
|
|
# "New" is measured off the diff, so MOVED CODE READS AS NEW: a pre-existing
|
|
# violation carried into a PR by a move or a rename is reported against that
|
|
# PR and blocks it. Fix it or //nolint it there — that is the accepted cost of
|
|
# the trade above.
|
|
lint:
|
|
name: Lint
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
# only-new-issues reads the PR patch from the API.
|
|
pull-requests: read
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
|
|
with:
|
|
# On merge_group there is no PR patch, so the action falls back to
|
|
# --new-from-rev and needs real history.
|
|
fetch-depth: 0
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
cache: false
|
|
|
|
- name: golangci-lint
|
|
uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9
|
|
env:
|
|
GOWORK: "off"
|
|
with:
|
|
version: v2.10.1
|
|
only-new-issues: true
|
|
args: --config=.golangci.yml --modules-download-mode=readonly --timeout=5m --build-tags=gms_pure_go
|
|
|
|
windows-make-shell:
|
|
name: Windows Make shell (${{ matrix.host }})
|
|
runs-on: windows-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
host:
|
|
- native
|
|
- msys2
|
|
- cygwin
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
|
|
|
|
- name: Install native GNU Make
|
|
if: matrix.host == 'native'
|
|
shell: pwsh
|
|
run: choco install make --version=4.4.1 --yes --no-progress
|
|
|
|
- name: Set up MSYS2 GNU Make
|
|
if: matrix.host == 'msys2'
|
|
uses: msys2/setup-msys2@66cd2cce69caa17b53920067426061ca1de3a884 # v2.32.0
|
|
with:
|
|
msystem: MSYS
|
|
install: git make
|
|
path-type: minimal
|
|
|
|
- name: Set up Cygwin GNU Make
|
|
if: matrix.host == 'cygwin'
|
|
id: cygwin
|
|
# cygwin-install-action downloads setup-x86_64.exe from cygwin.com. That
|
|
# download times out often enough to red the required check for a reason
|
|
# unrelated to the change under test. Treat a setup failure as a
|
|
# (non-blocking) warning: the smoke step below is gated on this step
|
|
# succeeding, so a genuine Cygwin Make regression still fails loudly,
|
|
# while a flaky installer download only skips the leg with a warning.
|
|
continue-on-error: true
|
|
uses: cygwin/cygwin-install-action@3f0a3f9f988f7e96b8c18098ae05eaec175f5b52 # v6
|
|
with:
|
|
packages: git make
|
|
add-to-path: 'false'
|
|
|
|
- name: Warn when Cygwin setup was skipped by a download failure
|
|
if: matrix.host == 'cygwin' && steps.cygwin.outcome == 'failure'
|
|
shell: bash
|
|
run: |
|
|
echo "::warning title=Cygwin Make-shell leg skipped::cygwin-install-action could not download the Cygwin installer (network flake); skipping the Cygwin-hosted Make smoke test. This is an infrastructure failure, not a code failure."
|
|
|
|
- name: Exercise native Windows Make
|
|
if: matrix.host == 'native'
|
|
shell: pwsh
|
|
run: |
|
|
$ErrorActionPreference = 'Stop'
|
|
$make = (Get-Command make.exe -ErrorAction Stop).Source
|
|
$hostOutput = & $make --no-print-directory -f NUL --eval '$(info MAKE_HOST=$(MAKE_HOST))' --eval 'noop:;' noop
|
|
$makeHost = (($hostOutput | Where-Object { $_ -like 'MAKE_HOST=*' }) -replace '^MAKE_HOST=', '').Trim()
|
|
if ($LASTEXITCODE -ne 0 -or ($makeHost -ne 'Windows32' -and $makeHost -notmatch '-mingw32$')) {
|
|
throw "Expected native Windows GNU Make, found '$makeHost' at '$make'"
|
|
}
|
|
|
|
$git = (Get-Command git.exe -ErrorAction Stop).Source
|
|
if ($git -notmatch ' ') {
|
|
throw "Expected the hosted Git for Windows path to contain a space, found '$git'"
|
|
}
|
|
|
|
$profile = Join-Path $env:RUNNER_TEMP 'profile with spaces'
|
|
New-Item -ItemType Directory -Force -Path $profile | Out-Null
|
|
$poison = Join-Path $profile 'poison bash env.sh'
|
|
Set-Content -LiteralPath $poison -Encoding utf8 -Value 'exit 97'
|
|
|
|
$env:USERPROFILE = $profile
|
|
$env:BASH_ENV = $poison
|
|
$env:BASHOPTS = 'failglob'
|
|
$env:SHELLOPTS = 'nounset'
|
|
$env:GIT_EXEC_PATH = Join-Path $profile 'missing git exec path'
|
|
$env:PATH = "$(Split-Path $git);$env:SystemRoot\System32"
|
|
|
|
& $make --no-print-directory help | Out-Null
|
|
if ($LASTEXITCODE -ne 0) {
|
|
throw 'Native Make failed while parsing or running help'
|
|
}
|
|
|
|
@'
|
|
include Makefile
|
|
.RECIPEPREFIX := >
|
|
.PHONY: windows-make-shell-smoke
|
|
windows-make-shell-smoke:
|
|
>@case "$(SHELL)" in */bin/bash.exe) ;; *) exit 1;; esac
|
|
>@test -n "$$BASH_VERSION"
|
|
>@test "$$(command -v sed)" = /usr/bin/sed
|
|
>@test "$$(command -v env)" = /usr/bin/env
|
|
>@test -z "$${BASH_ENV+x}"
|
|
>@case "$$-" in *u*) exit 1;; esac
|
|
>@shopt -q failglob && exit 1 || :
|
|
>@test -z "$${GIT_EXEC_PATH+x}"
|
|
>@env printf '%s\n' 'native Windows Make shell smoke passed'
|
|
'@ | & $make --no-print-directory -f - windows-make-shell-smoke
|
|
if ($LASTEXITCODE -ne 0) {
|
|
throw 'Native Make shell smoke failed'
|
|
}
|
|
|
|
function Get-TreeManifest {
|
|
param([Parameter(Mandatory)][string]$Root)
|
|
|
|
@(
|
|
Get-ChildItem -LiteralPath $Root -Recurse -Force | ForEach-Object {
|
|
$relative = [IO.Path]::GetRelativePath($Root, $_.FullName).Replace('\', '/')
|
|
if ($_.PSIsContainer) {
|
|
"D $relative"
|
|
} else {
|
|
$hash = (Get-FileHash -LiteralPath $_.FullName -Algorithm SHA256).Hash
|
|
"F $relative $hash"
|
|
}
|
|
}
|
|
) | Sort-Object
|
|
}
|
|
|
|
$proofRoot = Join-Path $env:RUNNER_TEMP ("make install proof " + [guid]::NewGuid().ToString('N'))
|
|
$fixtureRepo = Join-Path $proofRoot 'fixture repo'
|
|
$buildDir = Join-Path $fixtureRepo 'build output'
|
|
$fakeGoDir = Join-Path $proofRoot 'fake go bin'
|
|
$installRoot = Join-Path $proofRoot 'install sandbox'
|
|
$installProfile = Join-Path $installRoot 'profile with spaces'
|
|
New-Item -ItemType Directory -Force -Path $buildDir, $fakeGoDir, $installProfile | Out-Null
|
|
Copy-Item -LiteralPath (Join-Path $env:GITHUB_WORKSPACE 'Makefile') -Destination $fixtureRepo
|
|
Copy-Item -LiteralPath (Join-Path $env:GITHUB_WORKSPACE 'go.mod') -Destination $fixtureRepo
|
|
|
|
$sentinel = Join-Path $buildDir 'bd.exe'
|
|
$fakeGo = Join-Path $fakeGoDir 'go'
|
|
$fakeGoScript = @'
|
|
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
[[ "${1-}" == build ]] || exit 91
|
|
shift
|
|
output=
|
|
while (($#)); do
|
|
case "$1" in
|
|
-o)
|
|
[[ $# -ge 2 ]] || exit 92
|
|
output=$2
|
|
shift 2
|
|
;;
|
|
*) shift ;;
|
|
esac
|
|
done
|
|
[[ "$(cygpath -aw "$output")" == "$(cygpath -aw "$BEADS_FAKE_GO_EXPECTED_OUTPUT")" ]] || {
|
|
printf 'fake go received output %q, expected %q\n' "$output" "$BEADS_FAKE_GO_EXPECTED_OUTPUT" >&2
|
|
exit 93
|
|
}
|
|
printf native-build-sentinel > "$(cygpath -u "$output")"
|
|
'@
|
|
if (-not $fakeGoScript.StartsWith('#!', [StringComparison]::Ordinal)) {
|
|
throw 'Fake Go shebang must start at byte zero after YAML extraction'
|
|
}
|
|
[IO.File]::WriteAllText(
|
|
$fakeGo,
|
|
($fakeGoScript -replace "`r`n", "`n"),
|
|
[Text.UTF8Encoding]::new($false)
|
|
)
|
|
$priorPath = $env:PATH
|
|
Push-Location $fixtureRepo
|
|
try {
|
|
$env:BEADS_FAKE_GO_EXPECTED_OUTPUT = $sentinel
|
|
$env:PATH = "$fakeGoDir;$priorPath"
|
|
& $make --no-print-directory "BUILD_DIR=$buildDir" GIT_BUILD=build-proof CC=proof build
|
|
if ($LASTEXITCODE -ne 0) {
|
|
throw 'Native Make build failed for a spaced BUILD_DIR'
|
|
}
|
|
} finally {
|
|
$env:PATH = $priorPath
|
|
Remove-Item -LiteralPath Env:BEADS_FAKE_GO_EXPECTED_OUTPUT
|
|
Pop-Location
|
|
}
|
|
if (-not (Test-Path -LiteralPath $sentinel -PathType Leaf)) {
|
|
throw "Native Make did not build bd.exe at the exact spaced destination '$sentinel'"
|
|
}
|
|
$sentinelHash = (Get-FileHash -LiteralPath $sentinel -Algorithm SHA256).Hash
|
|
|
|
& $git -C $fixtureRepo init --quiet
|
|
& $git -C $fixtureRepo config core.hooksPath .githooks
|
|
if ($LASTEXITCODE -ne 0) {
|
|
throw 'Could not initialize the isolated install fixture repository'
|
|
}
|
|
& $git -C $fixtureRepo -c user.name=install-proof -c user.email=install-proof@example.invalid `
|
|
-c commit.gpgsign=false commit --allow-empty --quiet -m 'Initialize install proof'
|
|
if ($LASTEXITCODE -ne 0) {
|
|
throw 'Could not commit the isolated install fixture repository'
|
|
}
|
|
$fixtureBefore = @(Get-TreeManifest -Root $fixtureRepo)
|
|
|
|
$env:USERPROFILE = $installProfile
|
|
Push-Location $fixtureRepo
|
|
try {
|
|
& $make --no-print-directory -o build "BUILD_DIR=$buildDir" GIT_BUILD=install-proof install-force
|
|
if ($LASTEXITCODE -ne 0) {
|
|
throw 'Native Make install-force failed for a spaced USERPROFILE'
|
|
}
|
|
} finally {
|
|
Pop-Location
|
|
}
|
|
|
|
$installed = Join-Path $installProfile '.local\bin\bd.exe'
|
|
if (-not (Test-Path -LiteralPath $installed -PathType Leaf)) {
|
|
throw "Native Make did not install bd.exe at the exact destination '$installed'"
|
|
}
|
|
if ((Get-FileHash -LiteralPath $installed -Algorithm SHA256).Hash -ne $sentinelHash) {
|
|
throw 'Native Make installed bd.exe with unexpected contents'
|
|
}
|
|
|
|
$expectedFirstInstall = @(
|
|
'D profile with spaces'
|
|
'D profile with spaces/.local'
|
|
'D profile with spaces/.local/bin'
|
|
"F profile with spaces/.local/bin/bd.exe $sentinelHash"
|
|
) | Sort-Object
|
|
$actualFirstInstall = @(Get-TreeManifest -Root $installRoot)
|
|
if (Compare-Object -ReferenceObject $expectedFirstInstall -DifferenceObject $actualFirstInstall) {
|
|
throw "Native Make changed paths outside the exact first install destination:`n$($actualFirstInstall -join "`n")"
|
|
}
|
|
|
|
$fixtureAfterFirstInstall = @(Get-TreeManifest -Root $fixtureRepo)
|
|
if (Compare-Object -ReferenceObject $fixtureBefore -DifferenceObject $fixtureAfterFirstInstall) {
|
|
throw 'Native Make split the spaced first-install path or otherwise mutated the fixture repository'
|
|
}
|
|
|
|
$legacyAlias = Join-Path $installProfile '.local\bin\BD'
|
|
Set-Content -LiteralPath $legacyAlias -Encoding ascii -NoNewline -Value 'legacy-extensionless-alias'
|
|
$installBeforeFailedReplacement = @(Get-TreeManifest -Root $installRoot)
|
|
$fixtureBeforeFailedReplacement = @(Get-TreeManifest -Root $fixtureRepo)
|
|
$missingBuildDir = Join-Path $fixtureRepo 'missing build output'
|
|
if (Test-Path -LiteralPath $missingBuildDir) {
|
|
throw "Failure-injection source unexpectedly exists: '$missingBuildDir'"
|
|
}
|
|
|
|
Push-Location $fixtureRepo
|
|
try {
|
|
& $make --no-print-directory -o build "BUILD_DIR=$missingBuildDir" GIT_BUILD=install-proof install-force
|
|
if ($LASTEXITCODE -eq 0) {
|
|
throw 'Native Make replacement unexpectedly succeeded without a source bd.exe'
|
|
}
|
|
} finally {
|
|
Pop-Location
|
|
}
|
|
|
|
$installAfterFailedReplacement = @(Get-TreeManifest -Root $installRoot)
|
|
if (Compare-Object -ReferenceObject $installBeforeFailedReplacement -DifferenceObject $installAfterFailedReplacement) {
|
|
throw "Failed native Make replacement changed the live install tree:`n$($installAfterFailedReplacement -join "`n")"
|
|
}
|
|
$fixtureAfterFailedReplacement = @(Get-TreeManifest -Root $fixtureRepo)
|
|
if (Compare-Object -ReferenceObject $fixtureBeforeFailedReplacement -DifferenceObject $fixtureAfterFailedReplacement) {
|
|
throw 'Failed native Make replacement mutated the fixture repository'
|
|
}
|
|
|
|
Set-Content -LiteralPath $sentinel -Encoding ascii -NoNewline -Value 'native-install-sentinel-v2'
|
|
$replacementHash = (Get-FileHash -LiteralPath $sentinel -Algorithm SHA256).Hash
|
|
$fixtureBeforeReplacement = @(Get-TreeManifest -Root $fixtureRepo)
|
|
|
|
Push-Location $fixtureRepo
|
|
try {
|
|
& $make --no-print-directory -o build "BUILD_DIR=$buildDir" GIT_BUILD=install-proof install-force
|
|
if ($LASTEXITCODE -ne 0) {
|
|
throw 'Native Make replacement install-force failed with a case-variant legacy alias'
|
|
}
|
|
} finally {
|
|
Pop-Location
|
|
}
|
|
|
|
if (Test-Path -LiteralPath $legacyAlias) {
|
|
throw "Native Make left the case-variant legacy alias '$legacyAlias'"
|
|
}
|
|
if (-not (Test-Path -LiteralPath $installed -PathType Leaf)) {
|
|
throw "Native Make replacement left no bd.exe at '$installed'"
|
|
}
|
|
if ((Get-FileHash -LiteralPath $installed -Algorithm SHA256).Hash -ne $replacementHash) {
|
|
throw 'Native Make replacement installed bd.exe with unexpected contents'
|
|
}
|
|
|
|
$expectedReplacement = @(
|
|
'D profile with spaces'
|
|
'D profile with spaces/.local'
|
|
'D profile with spaces/.local/bin'
|
|
"F profile with spaces/.local/bin/bd.exe $replacementHash"
|
|
) | Sort-Object
|
|
$actualReplacement = @(Get-TreeManifest -Root $installRoot)
|
|
if (Compare-Object -ReferenceObject $expectedReplacement -DifferenceObject $actualReplacement) {
|
|
throw "Native Make replacement changed paths outside the exact install destination:`n$($actualReplacement -join "`n")"
|
|
}
|
|
|
|
$fixtureAfterReplacement = @(Get-TreeManifest -Root $fixtureRepo)
|
|
if (Compare-Object -ReferenceObject $fixtureBeforeReplacement -DifferenceObject $fixtureAfterReplacement) {
|
|
throw 'Native Make split the spaced replacement path or otherwise mutated the fixture repository'
|
|
}
|
|
|
|
$junctionRoot = Join-Path $proofRoot 'junction install sandbox'
|
|
$junctionProfile = Join-Path $junctionRoot 'profile with spaces'
|
|
$junctionParent = Join-Path $junctionProfile '.local'
|
|
$junctionTarget = Join-Path $junctionRoot 'bin target with spaces'
|
|
New-Item -ItemType Directory -Force -Path $junctionParent, $junctionTarget | Out-Null
|
|
$junctionBin = Join-Path $junctionParent 'bin'
|
|
New-Item -ItemType Junction -Path $junctionBin -Target $junctionTarget | Out-Null
|
|
$junctionLegacyAlias = Join-Path $junctionTarget 'bd'
|
|
Set-Content -LiteralPath $junctionLegacyAlias -Encoding ascii -NoNewline -Value 'junction-legacy-alias'
|
|
Set-Content -LiteralPath $sentinel -Encoding ascii -NoNewline -Value 'native-install-sentinel-v3'
|
|
$junctionHash = (Get-FileHash -LiteralPath $sentinel -Algorithm SHA256).Hash
|
|
$fixtureBeforeJunctionInstall = @(Get-TreeManifest -Root $fixtureRepo)
|
|
|
|
$env:USERPROFILE = $junctionProfile
|
|
Push-Location $fixtureRepo
|
|
try {
|
|
& $make --no-print-directory -o build "BUILD_DIR=$buildDir" GIT_BUILD=install-proof install-force
|
|
if ($LASTEXITCODE -ne 0) {
|
|
throw 'Native Make install-force failed through a junction install directory'
|
|
}
|
|
} finally {
|
|
Pop-Location
|
|
}
|
|
|
|
if (Test-Path -LiteralPath $junctionLegacyAlias) {
|
|
throw "Native Make left the legacy alias behind the install junction '$junctionLegacyAlias'"
|
|
}
|
|
$junctionInstalled = Join-Path $junctionTarget 'bd.exe'
|
|
$junctionVisibleInstalled = Join-Path $junctionBin 'bd.exe'
|
|
foreach ($path in @($junctionInstalled, $junctionVisibleInstalled)) {
|
|
if (-not (Test-Path -LiteralPath $path -PathType Leaf)) {
|
|
throw "Native Make junction install left no bd.exe at '$path'"
|
|
}
|
|
if ((Get-FileHash -LiteralPath $path -Algorithm SHA256).Hash -ne $junctionHash) {
|
|
throw "Native Make junction install wrote unexpected contents at '$path'"
|
|
}
|
|
}
|
|
$expectedJunctionTarget = @("F bd.exe $junctionHash")
|
|
$actualJunctionTarget = @(Get-TreeManifest -Root $junctionTarget)
|
|
if (Compare-Object -ReferenceObject $expectedJunctionTarget -DifferenceObject $actualJunctionTarget) {
|
|
throw "Native Make junction install left unexpected target entries:`n$($actualJunctionTarget -join "`n")"
|
|
}
|
|
|
|
$fixtureAfterJunctionInstall = @(Get-TreeManifest -Root $fixtureRepo)
|
|
if (Compare-Object -ReferenceObject $fixtureBeforeJunctionInstall -DifferenceObject $fixtureAfterJunctionInstall) {
|
|
throw 'Native Make junction install mutated the fixture repository'
|
|
}
|
|
|
|
$directoryAlias = Join-Path $installProfile '.local/bin/BD'
|
|
New-Item -ItemType Directory -Path $directoryAlias | Out-Null
|
|
$directorySentinel = Join-Path $directoryAlias 'keep.txt'
|
|
Set-Content -LiteralPath $directorySentinel -Encoding ascii -NoNewline -Value 'preserve-bd-directory'
|
|
$directorySentinelHash = (Get-FileHash -LiteralPath $directorySentinel -Algorithm SHA256).Hash
|
|
Set-Content -LiteralPath $sentinel -Encoding ascii -NoNewline -Value 'native-install-sentinel-v4'
|
|
$directoryInstallHash = (Get-FileHash -LiteralPath $sentinel -Algorithm SHA256).Hash
|
|
$fixtureBeforeDirectoryInstall = @(Get-TreeManifest -Root $fixtureRepo)
|
|
|
|
$env:USERPROFILE = $installProfile
|
|
Push-Location $fixtureRepo
|
|
try {
|
|
& $make --no-print-directory -o build "BUILD_DIR=$buildDir" GIT_BUILD=install-proof install-force
|
|
if ($LASTEXITCODE -ne 0) {
|
|
throw 'Native Make install-force failed with a directory named BD'
|
|
}
|
|
} finally {
|
|
Pop-Location
|
|
}
|
|
|
|
$expectedDirectoryInstall = @(
|
|
'D profile with spaces'
|
|
'D profile with spaces/.local'
|
|
'D profile with spaces/.local/bin'
|
|
'D profile with spaces/.local/bin/BD'
|
|
"F profile with spaces/.local/bin/BD/keep.txt $directorySentinelHash"
|
|
"F profile with spaces/.local/bin/bd.exe $directoryInstallHash"
|
|
) | Sort-Object
|
|
$actualDirectoryInstall = @(Get-TreeManifest -Root $installRoot)
|
|
if (Compare-Object -ReferenceObject $expectedDirectoryInstall -DifferenceObject $actualDirectoryInstall) {
|
|
throw "Native Make changed the preserved BD directory or install tree:`n$($actualDirectoryInstall -join "`n")"
|
|
}
|
|
$fixtureAfterDirectoryInstall = @(Get-TreeManifest -Root $fixtureRepo)
|
|
if (Compare-Object -ReferenceObject $fixtureBeforeDirectoryInstall -DifferenceObject $fixtureAfterDirectoryInstall) {
|
|
throw 'Native Make install with a BD directory mutated the fixture repository'
|
|
}
|
|
Write-Output 'Native Make install proof passed: first install, failed copy, case-variant alias, junction, preserved BD directory'
|
|
|
|
- name: Exercise MSYS2-hosted Make
|
|
if: matrix.host == 'msys2'
|
|
shell: msys2 {0}
|
|
run: |
|
|
set -euo pipefail
|
|
make_host="$(
|
|
make --no-print-directory -f /dev/null \
|
|
--eval '$(info $(MAKE_HOST))' \
|
|
--eval 'noop:;' noop |
|
|
sed -n '1p'
|
|
)"
|
|
case "$make_host" in
|
|
*-msys|*-cygwin) ;;
|
|
*) echo "Expected a POSIX-hosted MSYS2 GNU Make, found '$make_host'" >&2; exit 1 ;;
|
|
esac
|
|
|
|
profile="$(cygpath -u "$RUNNER_TEMP")/profile with spaces"
|
|
mkdir -p "$profile"
|
|
bash_env="$profile/compat bash env.sh"
|
|
printf '%s\n' 'exit 97' > "$bash_env"
|
|
export BASH_ENV="$bash_env"
|
|
export GIT_EXEC_PATH="$profile/missing git exec path"
|
|
export PATH=/usr/bin
|
|
|
|
make --no-print-directory help >/dev/null
|
|
cat > "$profile/smoke.mk" <<'MAKE_EOF'
|
|
include Makefile
|
|
.RECIPEPREFIX := >
|
|
.PHONY: windows-make-shell-smoke
|
|
windows-make-shell-smoke:
|
|
>@case "$(SHELL)" in */sh) ;; *) exit 1;; esac
|
|
>@test -n "$$BASH_VERSION"
|
|
>@test "$$(command -v sed)" = /usr/bin/sed
|
|
>@test "$$(command -v env)" = /usr/bin/env
|
|
>@test -f "$$BASH_ENV"
|
|
>@test -n "$$GIT_EXEC_PATH"
|
|
>@case "$$PATH" in *';'*) exit 1;; esac
|
|
>@env printf '%s\n' 'MSYS2 Make shell smoke passed'
|
|
MAKE_EOF
|
|
make --no-print-directory -f "$profile/smoke.mk" windows-make-shell-smoke
|
|
|
|
- name: Exercise Cygwin-hosted Make
|
|
# Only run when the Cygwin toolchain actually installed; a skipped install
|
|
# (download flake) leaves this leg un-exercised rather than failing on a
|
|
# missing bash. A real install success followed by a Make regression here
|
|
# still fails the job as before.
|
|
if: matrix.host == 'cygwin' && steps.cygwin.outcome == 'success'
|
|
shell: pwsh
|
|
env:
|
|
CYGWIN_ROOT: ${{ steps.cygwin.outputs.root }}
|
|
run: |
|
|
$ErrorActionPreference = 'Stop'
|
|
$bash = Join-Path $env:CYGWIN_ROOT 'bin\bash.exe'
|
|
$script = @'
|
|
set -euo pipefail
|
|
export PATH=/usr/bin
|
|
cd "$(cygpath -u "$GITHUB_WORKSPACE")"
|
|
|
|
make_host="$(
|
|
make --no-print-directory -f /dev/null \
|
|
--eval '$(info $(MAKE_HOST))' \
|
|
--eval 'noop:;' noop |
|
|
sed -n '1p'
|
|
)"
|
|
case "$make_host" in
|
|
*-cygwin) ;;
|
|
*) echo "Expected Cygwin GNU Make, found '$make_host'" >&2; exit 1 ;;
|
|
esac
|
|
|
|
profile="$(mktemp -d)"
|
|
trap 'rm -rf -- "$profile"' EXIT
|
|
bash_env="$profile/cygwin bash env.sh"
|
|
printf '%s\n' 'exit 97' > "$bash_env"
|
|
export BASH_ENV="$bash_env"
|
|
export GIT_EXEC_PATH="$profile/missing git exec path"
|
|
|
|
make --no-print-directory help >/dev/null
|
|
cat > "$profile/smoke.mk" <<'MAKE_EOF'
|
|
include Makefile
|
|
.RECIPEPREFIX := >
|
|
.PHONY: windows-make-shell-smoke
|
|
windows-make-shell-smoke:
|
|
>@case "$(SHELL)" in */sh) ;; *) exit 1;; esac
|
|
>@test -n "$$BASH_VERSION"
|
|
>@test "$$(command -v sed)" = /usr/bin/sed
|
|
>@test "$$(command -v env)" = /usr/bin/env
|
|
>@test -f "$$BASH_ENV"
|
|
>@test -n "$$GIT_EXEC_PATH"
|
|
>@case "$$PATH" in *';'*) exit 1;; esac
|
|
>@env printf '%s\n' 'Cygwin Make shell smoke passed'
|
|
MAKE_EOF
|
|
make --no-print-directory -f "$profile/smoke.mk" windows-make-shell-smoke
|
|
'@
|
|
$script = $script.Replace("`r`n", "`n")
|
|
& $bash --noprofile --norc -c $script
|
|
if ($LASTEXITCODE -ne 0) {
|
|
throw 'Cygwin Make shell smoke failed'
|
|
}
|
|
|
|
# The Bazel lane (bazel.yml), gated alongside the legacy jobs it mirrors
|
|
# (PR Core, build-artifacts, the pure-Go/js-wasm check, domain+uow and
|
|
# contract corpus, and pr-risk.yml's embedded-Dolt, proxied-server and
|
|
# server-Dolt storage tiers), all of which stay required, except that
|
|
# pr-risk.yml's embedded-Dolt test jobs stand down on same-repo PRs with
|
|
# the executor secret while BAZEL_RETIRES_LEGACY_EMBEDDED is "true" (its
|
|
# bazel-embedded-coverage job; D2 step 1), and ci-gate then requires this
|
|
# call's embedded lane to have run remotely and passed. bazel.yml has no pull_request/merge_group trigger of its own:
|
|
# this call is its only PR run. It gets the four RBE secrets and nothing
|
|
# else; its rbe job decides remote, local (forks, Dependabot: no
|
|
# remote-only lanes) or skip, and exports that for ci-gate. Its
|
|
# bazel-integration lane (main.yml's integration jobs, which run only on
|
|
# push to main) is on and required here, remote only: same-repo PRs run
|
|
# it, fork and Dependabot PRs (mode local) skip it until the farm has a
|
|
# read-only cache for them. Its bd artifact is renamed so it cannot
|
|
# collide with build-artifacts' upload.
|
|
bazel:
|
|
name: Bazel
|
|
permissions:
|
|
contents: read
|
|
uses: ./.github/workflows/bazel.yml
|
|
secrets:
|
|
RBE_WEST_EXECUTOR: ${{ secrets.RBE_WEST_EXECUTOR }}
|
|
RBE_TLS_CERT: ${{ secrets.RBE_TLS_CERT }}
|
|
RBE_TLS_KEY: ${{ secrets.RBE_TLS_KEY }}
|
|
RBE_TLS_CA: ${{ secrets.RBE_TLS_CA }}
|
|
with:
|
|
build-artifact-name: bazel-ci-build-artifacts
|
|
integration: "on"
|
|
|
|
# D2 step 1: pr-risk.yml's bazel-embedded-coverage job, verbatim (policy-
|
|
# tested identical). Where it says covered, PR Risk skips its legacy
|
|
# embedded test jobs, so ci-gate requires the Bazel embedded lane to have
|
|
# run remotely and passed in this run.
|
|
bazel-embedded-coverage:
|
|
name: Bazel embedded coverage
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 5
|
|
outputs:
|
|
covered: ${{ steps.decide.outputs.covered }}
|
|
steps:
|
|
# GitHub's == is case-insensitive. FORK and HAS_EXECUTOR are bazel.yml's
|
|
# rbe job's expressions, verbatim; RBE_WEST_WORKERS is deliberately not
|
|
# read (a mutable variable, evaluated per run, would let one workflow's
|
|
# re-run disagree with the other's).
|
|
- name: Decide whether the Bazel lane covers the embedded tier
|
|
id: decide
|
|
env:
|
|
RETIRED: ${{ env.BAZEL_RETIRES_LEGACY_EMBEDDED == 'true' }}
|
|
PULL_REQUEST: ${{ github.event_name == 'pull_request' }}
|
|
FORK: ${{ github.event.pull_request.head.repo.fork == true }}
|
|
HAS_EXECUTOR: ${{ secrets.RBE_WEST_EXECUTOR != '' }}
|
|
run: |
|
|
for v in RETIRED PULL_REQUEST FORK HAS_EXECUTOR; do
|
|
case "${!v}" in
|
|
true|false) ;;
|
|
*) echo "::error::$v is '${!v}', want true or false"; exit 1 ;;
|
|
esac
|
|
done
|
|
covered=false
|
|
if [ "$RETIRED" = true ] && [ "$PULL_REQUEST" = true ] && [ "$FORK" = false ] && [ "$HAS_EXECUTOR" = true ]; then
|
|
covered=true
|
|
fi
|
|
echo "covered=$covered" >> "$GITHUB_OUTPUT"
|
|
echo "Legacy embedded Dolt tier retired in favour of the Bazel lane: **$covered** (retired: $RETIRED, pull_request: $PULL_REQUEST, fork: $FORK, executor secret: $HAS_EXECUTOR)" | tee -a "$GITHUB_STEP_SUMMARY"
|
|
|
|
ci-gate:
|
|
name: CI Gate / Required
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- build-artifacts
|
|
- check-build-tags
|
|
- check-cmd-bd-puregeo-tests
|
|
- check-release-target-cross-compilation
|
|
- test-windows-liveness
|
|
- worktree-remove-windows
|
|
- check-version-consistency
|
|
- check-migration-hygiene
|
|
- check-doc-flags
|
|
- check-doc-freshness-platforms
|
|
- pr-preflight-platforms
|
|
- check-no-beads-changes
|
|
- detect-package-gates
|
|
- package-mcp
|
|
- package-npm
|
|
- pr-policy-wrapper
|
|
- pr-core-wrapper
|
|
- pr-lint-wrapper
|
|
- test-domain-uow
|
|
- contract-corpus
|
|
- fmt-check
|
|
- lint
|
|
- windows-make-shell
|
|
- bazel
|
|
- bazel-embedded-coverage
|
|
if: ${{ always() }}
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
|
|
|
|
- name: Evaluate CI gate
|
|
env:
|
|
CI_GATE_NAME: PR baseline gate
|
|
CI_GATE_REQUIRED: >-
|
|
BUILD_ARTIFACTS
|
|
CHECK_BUILD_TAGS
|
|
CHECK_CMD_BD_PUREGEO_TESTS
|
|
CHECK_RELEASE_TARGET_CROSS_COMPILATION
|
|
TEST_WINDOWS_LIVENESS
|
|
WORKTREE_REMOVE_WINDOWS
|
|
CHECK_VERSION_CONSISTENCY
|
|
CHECK_MIGRATION_HYGIENE
|
|
CHECK_DOC_FLAGS
|
|
CHECK_DOC_FRESHNESS_PLATFORMS
|
|
PR_PREFLIGHT_PLATFORMS
|
|
CHECK_NO_BEADS_CHANGES
|
|
DETECT_PACKAGE_GATES
|
|
PACKAGE_MCP
|
|
PACKAGE_NPM
|
|
PR_POLICY_WRAPPER
|
|
PR_CORE_WRAPPER
|
|
PR_LINT_WRAPPER
|
|
TEST_DOMAIN_UOW
|
|
CONTRACT_CORPUS
|
|
FMT_CHECK
|
|
LINT
|
|
WINDOWS_MAKE_SHELL
|
|
BAZEL
|
|
BAZEL_TEST
|
|
BAZEL_PURE
|
|
BAZEL_EMBEDDED
|
|
BAZEL_INTEGRATION
|
|
BAZEL_DOLTSERVER
|
|
BAZEL_PROXIED
|
|
BAZEL_SERVER_STORAGE
|
|
BAZEL_EMBEDDED_COVERAGE
|
|
BAZEL_EMBEDDED_RETIRED
|
|
BUILD_ARTIFACTS: ${{ needs.build-artifacts.result }}
|
|
CHECK_BUILD_TAGS: ${{ needs.check-build-tags.result }}
|
|
CHECK_CMD_BD_PUREGEO_TESTS: ${{ needs.check-cmd-bd-puregeo-tests.result }}
|
|
CHECK_RELEASE_TARGET_CROSS_COMPILATION: ${{ needs.check-release-target-cross-compilation.result }}
|
|
TEST_WINDOWS_LIVENESS: ${{ needs.test-windows-liveness.result }}
|
|
WORKTREE_REMOVE_WINDOWS: ${{ needs.worktree-remove-windows.result }}
|
|
CHECK_VERSION_CONSISTENCY: ${{ needs.check-version-consistency.result }}
|
|
CHECK_MIGRATION_HYGIENE: ${{ needs.check-migration-hygiene.result }}
|
|
CHECK_DOC_FLAGS: ${{ needs.check-doc-flags.result }}
|
|
CHECK_DOC_FRESHNESS_PLATFORMS: ${{ needs.check-doc-freshness-platforms.result }}
|
|
PR_PREFLIGHT_PLATFORMS: ${{ needs.pr-preflight-platforms.result }}
|
|
CHECK_NO_BEADS_CHANGES: ${{ needs.check-no-beads-changes.result }}
|
|
DETECT_PACKAGE_GATES: ${{ needs.detect-package-gates.result }}
|
|
PACKAGE_MCP: ${{ needs.package-mcp.result }}
|
|
PACKAGE_NPM: ${{ needs.package-npm.result }}
|
|
PR_POLICY_WRAPPER: ${{ needs.pr-policy-wrapper.result }}
|
|
PR_CORE_WRAPPER: ${{ needs.pr-core-wrapper.result }}
|
|
PR_LINT_WRAPPER: ${{ needs.pr-lint-wrapper.result }}
|
|
TEST_DOMAIN_UOW: ${{ needs.test-domain-uow.result }}
|
|
CONTRACT_CORPUS: ${{ needs.contract-corpus.result }}
|
|
FMT_CHECK: ${{ needs.fmt-check.result }}
|
|
LINT: ${{ needs.lint.result }}
|
|
WINDOWS_MAKE_SHELL: ${{ needs.windows-make-shell.result }}
|
|
# bazel.yml's lanes report their job.status as outputs; a lane that
|
|
# did not report (skipped, or lost before its last step) reads as
|
|
# skipped, which passes only in the modes bazel-gate.sh allows.
|
|
BAZEL_TEST: ${{ needs.bazel.outputs.bazel-test || 'skipped' }}
|
|
BAZEL_PURE: ${{ needs.bazel.outputs.bazel-pure || 'skipped' }}
|
|
BAZEL_EMBEDDED: ${{ needs.bazel.outputs.bazel-embedded || 'skipped' }}
|
|
BAZEL_INTEGRATION: ${{ needs.bazel.outputs.bazel-integration || 'skipped' }}
|
|
BAZEL_DOLTSERVER: ${{ needs.bazel.outputs.bazel-doltserver || 'skipped' }}
|
|
BAZEL_PROXIED: ${{ needs.bazel.outputs.bazel-proxied || 'skipped' }}
|
|
BAZEL_SERVER_STORAGE: ${{ needs.bazel.outputs.bazel-server-storage || 'skipped' }}
|
|
# Inputs of bazel-gate.sh, which sets BAZEL (the call's aggregate,
|
|
# red on a missing or inconsistent mode) and the expected skips
|
|
# from bazel.yml's own rbe job decision.
|
|
BAZEL_CALL: ${{ needs.bazel.result }}
|
|
BAZEL_RBE_MODE: ${{ needs.bazel.outputs.rbe-mode }}
|
|
BAZEL_RBE_ENABLED: ${{ needs.bazel.outputs.rbe-enabled }}
|
|
# D2 step 1: whether PR Risk retired its legacy embedded tier for
|
|
# this PR (BAZEL_EMBEDDED_RETIRED below).
|
|
BAZEL_EMBEDDED_COVERAGE: ${{ needs.bazel-embedded-coverage.result }}
|
|
BAZEL_COVERS_EMBEDDED: ${{ needs.bazel-embedded-coverage.outputs.covered }}
|
|
run: |
|
|
skipped_ok=""
|
|
if [[ "$GITHUB_EVENT_NAME" == "merge_group" ]]; then
|
|
skipped_ok="CHECK_NO_BEADS_CHANGES"
|
|
fi
|
|
# Bazel lanes skipped by design in the call's execution mode (all
|
|
# of them in mode skip, the remote-only embedded, integration,
|
|
# proxied and server-storage tiers in mode local), and the
|
|
# aggregate unless the mode is missing or invalid.
|
|
skipped_ok="$skipped_ok $(bash .github/scripts/bazel-gate.sh skips)"
|
|
BAZEL="$(bash .github/scripts/bazel-gate.sh aggregate)"
|
|
export BAZEL
|
|
# Where PR Risk's legacy embedded tier is retired, this run's Bazel
|
|
# embedded lane is the tier's only pre-merge run: it must have run
|
|
# remotely and passed. Mode skip (the farm switch off), or any
|
|
# other result, is red whatever bazel-gate.sh allows.
|
|
BAZEL_EMBEDDED_RETIRED=success
|
|
if [[ "$BAZEL_COVERS_EMBEDDED" == "true" ]] && { [[ "$BAZEL_RBE_MODE" != "remote" ]] || [[ "$BAZEL_EMBEDDED" != "success" ]]; }; then
|
|
BAZEL_EMBEDDED_RETIRED="not-run-remotely"
|
|
echo "::error::PR Risk's legacy embedded Dolt tier is retired (BAZEL_RETIRES_LEGACY_EMBEDDED) and the Bazel embedded lane did not run remotely and pass (mode '${BAZEL_RBE_MODE:-none}', result '${BAZEL_EMBEDDED:-none}'). If remote execution is off on purpose, commit BAZEL_RETIRES_LEGACY_EMBEDDED: \"false\" in pr.yml and pr-risk.yml and push this PR again."
|
|
fi
|
|
export BAZEL_EMBEDDED_RETIRED
|
|
export CI_GATE_SKIPPED_OK="$skipped_ok"
|
|
bash .github/scripts/ci-gate.sh
|