Port gascity's remote repo contents cache wiring (gascity #7467, #7478) to bazel.yml, gated on the repository variable RBE_REPO_CONTENTS_CACHE (unset/off: nothing; seed: rrc-seed on push to main; canary: + bazel-test reads; on: + every test lane reads). Mode remote only. - rbe job: an rrc step turns the variable into the rrc output. - Readers: the eight test lanes append startup --experimental_remote_repo_contents_cache and common --loading_phase_threads=64 to .bazelrc.local before Set up Bazel. - rrc-seed (push to main, id-token: write): a 30-minute rbe-rrc-writer-beads certificate from rbe-west's mint (.github/scripts/rrc-writer-credential.sh), then every lane's command (.github/scripts/rrc-lane-commands.txt) with --nobuild, --remote_cache only and --remote_upload_local_results (.github/scripts/rrc-run-lanes.sh). - rrc-verify (schedule/dispatch, issues: write): cold fetch of every lane and tools/bazel/rrc_verify.py against the cache; a mismatch opens an rrc-verify issue. - pr.yml, nightly.yml and bazel-farm.yml grant id-token: write and issues: write on their bazel.yml call (startup_failure otherwise); TestBazelWorkflowCallersGrantEveryRequestedPermission guards it. rrc-writer-credential.sh, rrc_verify.py and rrc_verify_test.py are byte copies of gascity's, pinned by sha256. Refs ga-vnycm2.29. Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1507 lines
76 KiB
YAML
1507 lines
76 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/**', 'hotfix/**' ]
|
|
# Merge queue (engdocs/CI_REQUIRED_CHECK_TOPOLOGY.md, "Merge Queue"):
|
|
# the ruleset's required gate must also report on each queue entry's
|
|
# merge-group commit, or a queued PR waits until the queue times it out.
|
|
# checks_requested is the queue asking for those checks; pinned
|
|
# explicitly (scripts/ci_merge_queue_test.go). The concurrency group
|
|
# below keys a merge group on its own gh-readonly-queue/* ref, so queue
|
|
# runs never cancel each other or a PR's own runs.
|
|
merge_group:
|
|
types: [ checks_requested ]
|
|
|
|
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"
|
|
# step's run script. Committed, not a repo variable, so a re-run can never
|
|
# change it.
|
|
# bazel.yml's bazel-cmd-dolt lane (the cmd/bd Dolt-server tier: the
|
|
# Dolt-gated cmd/bd tests no other lane runs) is advisory while this is
|
|
# "false": it runs and reports in the bazel call (continue-on-error, so a
|
|
# failure never turns the call's aggregate red), and ci-gate ignores its
|
|
# BAZEL_CMD_DOLT result. "true" adds BAZEL_CMD_DOLT to CI_GATE_REQUIRED in
|
|
# the "Evaluate CI gate" step's run script; bazel-gate.sh still accepts
|
|
# its skip in modes skip and local. Committed, not a repo variable, so a
|
|
# re-run can never change it. The `bazel` job's cmd-dolt-required
|
|
# input must equal it (a `with:` cannot read env; policy-tested): "true"
|
|
# also drops //cmd/bd:bd_test from bazel-integration, because the required
|
|
# lane runs the same integration-build bd_test without the dolt skip, so
|
|
# each cmd/bd test runs once. Rollback: commit "false" here and false in
|
|
# that input together; bazel-integration runs bd_test again on the next run.
|
|
BAZEL_CMD_DOLT_REQUIRED: "true"
|
|
|
|
jobs:
|
|
|
|
# The checks that need the PR's base commit, so no hermetic Bazel target
|
|
# can hold them: check-migration-hygiene.sh's delta half (C: shipped
|
|
# migrations are frozen, D: ignored-plane twins, E: no prepared DML in new
|
|
# migrations, all over `git diff <merge-base>`) and the .beads/issues.jsonl
|
|
# guard. Everything else this job ran is a Bazel test in bazel.yml's `test`
|
|
# lane (ga-96smfk.20): //scripts/repochecks:build_tags_test,
|
|
# :go_install_guidance_test, :winget_portable_alias_test,
|
|
# :migration_hygiene_test (checks A and B) and :fmt_test, and
|
|
# //internal/versioncheck:versioncheck_test for check-versions.sh. No Go:
|
|
# both steps are bash and git.
|
|
#
|
|
# Each step has its own id and `if: ${{ !cancelled() }}`, so one failure
|
|
# does not hide the other, and its outcome is a job output that ci-gate
|
|
# requires (TestPRCIGateFastChecksTokens). FAST_CHECKS (the job's own
|
|
# `result`) is the backstop token for a job lost before any step set its
|
|
# output.
|
|
fast-checks:
|
|
name: Fast checks (frozen migrations, .beads diff)
|
|
runs-on: ${{ (github.event_name == 'merge_group' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]')) && 'blacksmith-2vcpu-ubuntu-2404' || 'ubuntu-latest' }}
|
|
timeout-minutes: 10
|
|
outputs:
|
|
migration-hygiene: ${{ steps.migration-hygiene.outcome }}
|
|
no-beads-changes: ${{ steps.no-beads-changes.outcome }}
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
|
|
with:
|
|
# check-migration-hygiene and check-no-beads-changes diff against
|
|
# the base branch; a shallow checkout starves both.
|
|
fetch-depth: 0
|
|
|
|
# Migration hygiene, delta half: edits to migration files that already
|
|
# exist on the base branch (shipped migrations are frozen; fix forward
|
|
# with a new version), and the twin and prepared-DML rules for new
|
|
# migrations. Checks A and B (duplicate versions, nondeterministic SQL)
|
|
# read only the tree and run in Bazel. Details:
|
|
# scripts/check-migration-hygiene.sh.
|
|
- name: Run migration hygiene checks
|
|
id: migration-hygiene
|
|
if: ${{ !cancelled() }}
|
|
env:
|
|
BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha }}
|
|
MIGRATION_HYGIENE_SCOPE: delta
|
|
run: ./scripts/check-migration-hygiene.sh
|
|
|
|
# Fast check to catch accidental .beads/issues.jsonl changes from
|
|
# contributors. Runs on both PR triggers: a pull_request diffs against
|
|
# origin/<base branch> (GITHUB_BASE_REF), a merge group (which has no
|
|
# base_ref) against the queue's merge_group.base_sha, the commit the
|
|
# group's head is built on (fetch-depth 0 above fetches it).
|
|
- name: Check for .beads/issues.jsonl changes
|
|
id: no-beads-changes
|
|
if: ${{ !cancelled() }}
|
|
env:
|
|
MERGE_GROUP_BASE_SHA: ${{ github.event.merge_group.base_sha }}
|
|
run: |
|
|
base="${MERGE_GROUP_BASE_SHA:-origin/${GITHUB_BASE_REF:-main}}"
|
|
# Fail closed: a pipe into grep -q would pass on a failed diff.
|
|
if ! git rev-parse --verify --quiet "$base^{commit}" >/dev/null; then
|
|
echo "::error::diff base $base is unavailable"
|
|
exit 1
|
|
fi
|
|
if git diff --name-only "$base"...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"
|
|
|
|
# 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.
|
|
# Blacksmith Windows (blacksmith-4vcpu-windows-2025: GitHub's windows-2025
|
|
# image minus the full Visual Studio IDE/EdgeDriver/WinAppDriver, VS Build
|
|
# Tools 2022 present, no Linux Docker) for every PR and merge group, forks
|
|
# and Dependabot included (ga-96smfk.22): Windows and macOS jobs run on
|
|
# Blacksmith, everything Linux under Bazel on rbe-west. The first step
|
|
# builds ./cmd/bd with CGO_ENABLED=1 (embedded Dolt); the toolchain
|
|
# diagnostic step below prints which cgo toolchain backs it. Since
|
|
# ga-96smfk.22 this job (not a cross-compiled "-prebuilt" twin) is the
|
|
# required run of these tests.
|
|
test-windows-liveness:
|
|
name: Test (Windows) cmd/bd liveness regression
|
|
runs-on: ${{ 'blacksmith-4vcpu-windows-2025' }}
|
|
# F7b review fix (S6): raised from 15 to 20, matching open PR #7143's own
|
|
# measurement on this exact job (retained runs take about 8m; one run's
|
|
# own step timing showed 451s total with a 403s compile step) and
|
|
# main.yml's test-windows (S8) for consistency.
|
|
timeout-minutes: 20
|
|
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
|
|
|
|
# F7b review fix (S9): Blacksmith's windows-2025 image docs confirm "VS
|
|
# Build Tools 2022" but not which cgo toolchain backs CGO_ENABLED=1 go
|
|
# builds there (see the RISK comment above). Print the relevant tool
|
|
# versions early and clearly-labelled so a toolchain gap surfaces in
|
|
# this step's own log instead of failing deep into the liveness test
|
|
# below with an opaque cgo/link error.
|
|
- name: Check Windows cgo toolchain diagnostics
|
|
shell: bash
|
|
run: |
|
|
echo "::group::go env (CGO_ENABLED, CC, GOOS, GOARCH)"
|
|
go env CGO_ENABLED CC GOOS GOARCH
|
|
echo "::endgroup::"
|
|
echo "::group::gcc (mingw-w64) presence"
|
|
command -v gcc && gcc --version || echo "gcc not found on PATH"
|
|
echo "::endgroup::"
|
|
echo "::group::choco presence"
|
|
command -v choco && choco --version || echo "choco not found on PATH"
|
|
echo "::endgroup::"
|
|
|
|
- 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 }}-
|
|
|
|
# F7b review fix (S2): restore-only non-race Go build cache seeded by
|
|
# main.yml's test-windows Blacksmith leg (warm-non-race-cache.sh) on
|
|
# the exact same runner selection, so the cold cmd/bd compile below
|
|
# (the real long pole here per the reviewer's step-timing data) gets a
|
|
# true cache hit instead of starting cold every PR.
|
|
- 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 global Prime override
|
|
shell: bash
|
|
env:
|
|
CGO_ENABLED: "1"
|
|
GOCACHE: ${{ runner.temp }}/go-cache/non-race
|
|
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
|
|
env:
|
|
GOCACHE: ${{ runner.temp }}/go-cache/non-race
|
|
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).
|
|
#
|
|
# internal/storage/dbproxy/server carries the platform-portable path
|
|
# handling that #5820 introduced (testPlatformPath, external dolt config
|
|
# validation, DSN shaping); run exactly this package on windows-latest -
|
|
# the platform those paths target. 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.
|
|
#
|
|
# F7a: fold of two small, independent windows-latest jobs
|
|
# (test-windows-doltversion, test-windows-dbproxy-server) into one. Neither
|
|
# was in ci-gate's needs/CI_GATE_REQUIRED before the fold (promoting either
|
|
# to required-for-merge, once it has run clean for a while, is a separate
|
|
# maintainer call), so this fold needs no gate changes. Not one of the
|
|
# Windows jobs F4 touches (test-windows-liveness, worktree-remove-windows,
|
|
# the preflight/doc-freshness matrices, the twins).
|
|
#
|
|
# Review SF-1 (2026-10-03): neither step carries continue-on-error, so a
|
|
# failing test already fails the job on its own; `if: ${{ !cancelled() }}`
|
|
# on the second step only ensures it still runs after the first fails,
|
|
# giving both packages' results in one log instead of stopping at the
|
|
# first failure. No aggregator step is needed.
|
|
# Blacksmith Windows (blacksmith-2vcpu-windows-2025) for every PR; both steps
|
|
# build with CGO_ENABLED=0 (or no cgo at all for doltversion), so this job
|
|
# carries none of test-windows-liveness's cgo-toolchain risk.
|
|
test-windows-small:
|
|
name: Test (Windows) small packages (doltversion, dbproxy server)
|
|
runs-on: ${{ 'blacksmith-2vcpu-windows-2025' }}
|
|
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
|
|
|
|
# F7b review fix (S9): see test-windows-liveness's identical step for
|
|
# the full rationale. Both packages here build with CGO_ENABLED=0 (or
|
|
# no cgo at all), so this is lower-risk than test-windows-liveness, but
|
|
# printing the toolchain state costs nothing and keeps the diagnostic
|
|
# convention uniform across every moved Windows job.
|
|
- name: Check Windows toolchain diagnostics
|
|
shell: bash
|
|
run: go env CGO_ENABLED CC GOOS GOARCH
|
|
|
|
- name: Run doltversion package tests on Windows
|
|
id: doltversion
|
|
if: ${{ !cancelled() }}
|
|
run: go test -tags gms_pure_go -count=1 ./internal/doltversion/
|
|
|
|
- name: Run dbproxy server package tests on Windows
|
|
id: dbproxy-server
|
|
if: ${{ !cancelled() }}
|
|
env:
|
|
CGO_ENABLED: "0"
|
|
run: go test -tags gms_pure_go -count=1 -v ./internal/storage/dbproxy/server/
|
|
|
|
# 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.
|
|
# Blacksmith Windows (blacksmith-4vcpu-windows-2025) for every PR.
|
|
# CGO_ENABLED=0 below, so no cgo-toolchain risk; its non-race GOCACHE
|
|
# restore-keys prefix gets a hit from main.yml's test-windows job, which
|
|
# saves that key on this exact runner selection (restore-keys falls back
|
|
# to the most recent prefix match regardless of the exact sha). Since
|
|
# ga-96smfk.22 this job is the required run of these tests.
|
|
#
|
|
# RISK (F7b review: not flagged in the original implementation --
|
|
# cmd/bd/worktree_remove_git_windows_test.go:233 shells out to
|
|
# `fsutil file SetCaseSensitiveInfo`, which requires the "Windows Subsystem
|
|
# for Linux" optional feature's per-directory case-sensitivity support to
|
|
# be enabled on the image. If that feature is not enabled on Blacksmith's
|
|
# windows-2025 image, this FAILS OUTRIGHT rather than skipping (the test
|
|
# does not treat an unsupported fsutil call as a skip condition). The
|
|
# diagnostic step below surfaces that gap in this job's own log instead of
|
|
# a bare test failure deep in the suite; if it reports the feature missing,
|
|
# roll back this job's runs-on to the literal `windows-latest` until
|
|
# Blacksmith confirms/enables it.
|
|
worktree-remove-windows:
|
|
name: Worktree remove boundary (Windows)
|
|
runs-on: ${{ 'blacksmith-4vcpu-windows-2025' }}
|
|
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: Check Windows case-sensitivity tooling diagnostics
|
|
shell: pwsh
|
|
run: |
|
|
Write-Output "::group::fsutil file SetCaseSensitiveInfo capability"
|
|
$tmp = Join-Path $env:RUNNER_TEMP "case-sensitivity-probe"
|
|
New-Item -ItemType Directory -Path $tmp -Force | Out-Null
|
|
& fsutil file SetCaseSensitiveInfo $tmp enable
|
|
if ($LASTEXITCODE -ne 0) {
|
|
Write-Output "::warning::fsutil file SetCaseSensitiveInfo failed (exit $LASTEXITCODE) - this job's worktree-remove tests require the Windows Subsystem for Linux optional feature's per-directory case-sensitivity support and will FAIL (not skip) below if it is unavailable on this image"
|
|
} else {
|
|
Write-Output "fsutil file SetCaseSensitiveInfo: supported"
|
|
}
|
|
Remove-Item -Recurse -Force $tmp -ErrorAction SilentlyContinue
|
|
Write-Output "::endgroup::"
|
|
|
|
- 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
|
|
|
|
# Check documentation references match actual CLI flags
|
|
#
|
|
# Stays a job: the generated CLI docs describe the release pinned in
|
|
# docs/cli-docs.pin, and check-doc-flags.sh validates them against bd built
|
|
# from that tag (scripts/resolve-docs-bd.sh: git fetch the tag, pure-Go go
|
|
# build), attributing drift against the merge-base. Neither input can enter
|
|
# a Bazel action key: releases publish no pure-Go linux binary to pin, and
|
|
# the attribution needs the PR's base. check-doc-freshness.sh, which this
|
|
# job also ran, is //scripts/repochecks:doc_freshness_test.
|
|
#
|
|
# F7a: moved to Blacksmith for same-repo PRs/merge_group. This job's module
|
|
# cache restore step was already absent before the fold (every run cold-
|
|
# builds bd), so there is no GitHub-saved cache to lose here.
|
|
check-doc-flags:
|
|
name: Check doc flags freshness
|
|
runs-on: ${{ (github.event_name == 'merge_group' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]')) && 'blacksmith-4vcpu-ubuntu-2404' || 'ubuntu-latest' }}
|
|
timeout-minutes: 15
|
|
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
|
|
# Merge queue: a merge group has no GITHUB_BASE_REF, and without a
|
|
# diff base check-cli-docs-drift.sh fails on any drift, including
|
|
# drift already on main that the PR run attributed away, which
|
|
# would eject every queued PR. Diff against the queue's base
|
|
# commit instead (empty on pull_request: origin/$GITHUB_BASE_REF).
|
|
BD_DOCS_DIFF_BASE: ${{ github.event.merge_group.base_sha }}
|
|
run: ./scripts/check-doc-flags.sh ./bd
|
|
|
|
# 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
|
|
|
|
# The Linux leg is Bazel's (ga-96smfk.20): //scripts:doc_freshness_required_test
|
|
# (integration lane: the doc-freshness suite under -required-suite) and
|
|
# //scripts/gitattributespolicy:gitattributespolicy_required_host_test
|
|
# (-required-host -expected-goos linux), both on rbe-west's Linux workers.
|
|
# The macOS and Windows legs stay here, on Blacksmith for every PR and
|
|
# merge group, forks and Dependabot included (ga-96smfk.22). Each leg's
|
|
# `include` entry names its Blacksmith label in `runner` (`os` keeps the
|
|
# check names stable and selects the Windows-only steps). Every leg
|
|
# restores a non-race Go build cache seeded by main.yml's push-to-main
|
|
# savers on the exact same label (S2 below): test-windows for Windows,
|
|
# blacksmith-macos-go-build-cache for macOS. The macOS label is pinned to
|
|
# macos-26 (Apple Silicon, the image GitHub's macos-latest resolves to);
|
|
# 6 vCPU is enough for a leg dominated by one incremental ./cmd/bd test
|
|
# compile.
|
|
check-doc-freshness-platforms:
|
|
name: Check doc freshness (${{ matrix.os }})
|
|
runs-on: ${{ matrix.runner }}
|
|
timeout-minutes: 10
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- os: macos-latest
|
|
expected_goos: darwin
|
|
runner: blacksmith-6vcpu-macos-26
|
|
- os: windows-latest
|
|
expected_goos: windows
|
|
runner: blacksmith-4vcpu-windows-2025
|
|
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 }}-
|
|
|
|
# F7b review fix (S2): same restore-only non-race Go build cache as
|
|
# pr-preflight-platforms above, seeded by the same push-to-main savers
|
|
# on the exact same runner selections; this job's two "go test" steps
|
|
# below compile ./scripts and ./scripts/gitattributespolicy, so they
|
|
# benefit from the same warm cache (main.yml's warm-non-race-cache.sh
|
|
# run compiles both exact packages -- F7b spec 4.2).
|
|
- 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: Exercise native date and Bash process boundary
|
|
env:
|
|
GOCACHE: ${{ runner.temp }}/go-cache/non-race
|
|
run: go test '-tags=integration,gms_pure_go' -count=1 -run '^(TestDocFreshness.*|TestRequiredSuiteContract)$' ./scripts -args -required-suite=doc-freshness
|
|
|
|
- name: Exercise repository text EOL policy boundary
|
|
env:
|
|
GOCACHE: ${{ runner.temp }}/go-cache/non-race
|
|
run: go test '-tags=integration,gms_pure_go' -count=1 ./scripts/gitattributespolicy -args -required-host -expected-goos '${{ matrix.expected_goos }}'
|
|
|
|
# Blacksmith macOS and Windows legs, labels in the matrix (see
|
|
# check-doc-freshness-platforms above). The Linux leg is retired
|
|
# (ga-96smfk.22): every Linux step's tests run under Bazel on rbe-west
|
|
# (//scripts:scripts_test, //cmd/bd:bd_test, //internal/config:config_test).
|
|
# Only the two
|
|
# tests of go test's own bd build fallback
|
|
# (tools/bazel/equivalence_allowlist.txt) skip under Bazel; they keep
|
|
# running here on macOS and Windows.
|
|
#
|
|
# F7b review (S1): an earlier revision of this job split the Windows leg
|
|
# into two `shard` entries on the theory that it would turn one ~9-minute
|
|
# leg into two ~4-5 minute parallel legs. Real step-timing data from PR
|
|
# runs disproved that: shard 2 (the three Windows-only steps moved below)
|
|
# only ever holds 15-25s of work, while shard 1 still takes 450-480s, so
|
|
# the split added a second billed Blacksmith Windows runner for no
|
|
# measurable critical-path win. The actual long pole on every OS is the
|
|
# cold `cmd/bd` test compile in "Exercise generated Git hook timeout
|
|
# process boundary" (250-300s); see S2 below (the restore-non-race-cache
|
|
# step) for the fix that actually targets it. Reverted to one leg per OS.
|
|
#
|
|
# Windows leg budget with the caches warm (merge group 37710264475 and PR
|
|
# runs, 2026-10-07/08): 45-115s setup (setup-go, then the two cache
|
|
# restores, mostly tar extraction), 33-71s for TestPRPreflight (Git Bash
|
|
# process creation, now parallel subtests), 27-58s to compile and link
|
|
# ./cmd/bd's test binary, and about 25s for the rest. A second Windows leg
|
|
# would pay the setup again to save about 20s, so it stays one leg. An
|
|
# 8 vCPU Windows leg was tried (#7381): cache restores still hit, but it
|
|
# queued 63s for the larger runner and finished at 144s vs 129s here.
|
|
pr-preflight-platforms:
|
|
name: PR preflight process (${{ matrix.os }})
|
|
runs-on: ${{ matrix.runner }}
|
|
timeout-minutes: 20
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- os: macos-latest
|
|
expected_goos: darwin
|
|
runner: blacksmith-6vcpu-macos-26
|
|
- os: windows-latest
|
|
expected_goos: windows
|
|
runner: blacksmith-4vcpu-windows-2025
|
|
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 }}-
|
|
|
|
# F7b review (S2): restore-only non-race Go build cache, seeded by the
|
|
# push-to-main saver on the exact same Blacksmith label (Windows:
|
|
# main.yml's test-windows; macOS: main.yml's
|
|
# blacksmith-macos-go-build-cache) so the cold cmd/bd compile below
|
|
# (the real long pole, 250-300s uncached) gets a true cache hit instead
|
|
# of starting cold. GOCACHE must match the seeder's exactly, and
|
|
# CGO_ENABLED is left at its platform default (same as the seeder) so
|
|
# the key families line up; see mainBlacksmithWindows4vcpuRunsOn in
|
|
# ci_workflow_test.go for the seeder side of this contract.
|
|
- 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: Exercise the real Bash process boundary
|
|
shell: bash
|
|
env:
|
|
GOCACHE: ${{ runner.temp }}/go-cache/non-race
|
|
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"
|
|
GOCACHE: ${{ runner.temp }}/go-cache/non-race
|
|
run: bash scripts/ci/test-user-config-diagnostic.sh '${{ matrix.expected_goos }}'
|
|
|
|
- name: Exercise test.sh prebuilt binary path
|
|
shell: bash
|
|
env:
|
|
GOCACHE: ${{ runner.temp }}/go-cache/non-race
|
|
run: go test '-tags=gms_pure_go' -count=1 -run '^TestTestScriptPrebuiltBinaryContract$' ./scripts
|
|
|
|
# One go test of ./cmd/bd runs the generated hook timeout boundary and
|
|
# plain go test's own bd build fallback (BEADS_TEST_BD_BINARY unset),
|
|
# which Bazel never takes, on every OS developers run go test on: the
|
|
# tests tools/bazel/equivalence_allowlist.txt lists as skipped under
|
|
# Bazel. They were two steps; each go test of ./cmd/bd re-hashes its
|
|
# ~1500 packages and relinks the test binary, which cost 5-9s on
|
|
# Windows for a fallback run of under one second.
|
|
- name: Exercise generated Git hook timeout process boundary and go test's bd build fallback
|
|
shell: bash
|
|
env:
|
|
GOCACHE: ${{ runner.temp }}/go-cache/non-race
|
|
run: go test '-tags=gms_pure_go' -count=1 -run '^(TestGeneratedHookTimeoutProcessBoundary|TestGOMODCACHENotUnderTestHome|TestGoBuildBDCommandIsCWDIndependent)$' ./cmd/bd
|
|
|
|
# This step recompiles ./cmd/bd's test binary. It must share the restored
|
|
# GOCACHE with the hook-timeout/bd-build-fallback step above (same tags, same platform
|
|
# default CGO_ENABLED, see the script's header) so it is a relink rather
|
|
# than a second cold compile: without GOCACHE here it fell back to the
|
|
# runner's empty default cache and cold-compiled all of ./cmd/bd on every
|
|
# PR (210-240s on macos-latest, ~120s on Windows; the leg's long pole).
|
|
# TestPRPreflightPlatformsRunStepsUseRestoredGoBuildCache pins this.
|
|
- name: Exercise native init gateway credential shell
|
|
shell: bash
|
|
env:
|
|
GOCACHE: ${{ runner.temp }}/go-cache/non-race
|
|
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"
|
|
GOCACHE: ${{ runner.temp }}/go-cache/non-race
|
|
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
|
|
env:
|
|
GOCACHE: ${{ runner.temp }}/go-cache/non-race
|
|
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
|
|
env:
|
|
GOCACHE: ${{ runner.temp }}/go-cache/non-race
|
|
run: bash scripts/ci/test-windows-env-helpers.sh
|
|
|
|
# F7a: fold of build-examples + complexity-report, the two pr.yml jobs that
|
|
# are advisory-only (not in ci-gate's needs/CI_GATE_REQUIRED) and restore no
|
|
# GitHub-saved build cache, onto one Blacksmith runner for same-repo
|
|
# PRs/merge_group. Both keep their pre-fold step-level
|
|
# continue-on-error/timeout-minutes design: a job-level timeout or failure
|
|
# would CANCEL or red the job, and a cancelled/red advisory check is exactly
|
|
# the blocking-by-a-different-door outcome both were written to avoid. A
|
|
# generous job-level timeout-minutes is still set, because
|
|
# TestSameRepoBlacksmithRunners requires one of every job it pins (so a
|
|
# stuck Blacksmith runner cannot spend minutes forever) - it sits comfortably
|
|
# above the sum of the step timeouts below so it is a backstop, not a
|
|
# realistic ceiling.
|
|
#
|
|
# 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.
|
|
#
|
|
# To promote the examples check to a real gate: drop its step's
|
|
# continue-on-error and warning step, then add `advisory-reports` to
|
|
# ci-gate's `needs`, `CI_GATE_REQUIRED`, and its env map.
|
|
#
|
|
# The complexity report is an advisory architecture signal; it deliberately
|
|
# does not participate in ci-gate while maintainers evaluate the baseline
|
|
# and refactoring payoff.
|
|
advisory-reports:
|
|
name: Advisory reports (examples build, complexity)
|
|
runs-on: ${{ (github.event_name == 'merge_group' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]')) && 'blacksmith-2vcpu-ubuntu-2404' || 'ubuntu-latest' }}
|
|
# Review N-2 (2026-10-03): step timeouts sum to 42 min; 60 (not 45) keeps
|
|
# job setup/post overhead from turning a stacked near-timeout stall into a
|
|
# job-level cancel, which would red this advisory check through "another
|
|
# door" instead of the step that actually stalled.
|
|
timeout-minutes: 60
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
|
|
id: checkout
|
|
continue-on-error: true
|
|
timeout-minutes: 5
|
|
with:
|
|
# complexity.sh diffs against origin/main; examples/ does not need
|
|
# history but shares this checkout.
|
|
fetch-depth: 0
|
|
|
|
- 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 examples build 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."
|
|
|
|
- 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
|
|
|
|
# `test-macos` / "Test (macos-latest)" used to run here and is deliberately
|
|
# removed (F4, PR CI -> 5 min). It was a non-required, PR-side mirror of
|
|
# main.yml's `test` job's macOS leg (full `go test -race -short ./...`),
|
|
# added after the 2026-08-01 incident where three separately-merged PRs each
|
|
# introduced a $TMPDIR=/var/folders regression that only reproduces on
|
|
# macOS and that main.yml's leg -- `if: github.event_name == 'push' &&
|
|
# github.ref == 'refs/heads/main'`, i.e. push-to-main only -- could not have
|
|
# caught pre-merge.
|
|
#
|
|
# Removing it is an accepted tradeoff, not a coverage-neutral cleanup:
|
|
# required merge-gate coverage is unaffected (this job was never in
|
|
# ci-gate's needs/CI_GATE_REQUIRED), but PRs lose the one pre-merge signal
|
|
# for macOS-only `go test -race ./...` regressions of this kind; such a
|
|
# regression can land on main again and will only be caught by main.yml's
|
|
# push-triggered leg, after the fact. The other macOS matrix legs left in
|
|
# this file (check-doc-freshness-platforms, pr-preflight-platforms) run on
|
|
# every PR but exercise narrow, specific scripts, not the full suite, so
|
|
# they are not a substitute. If this tradeoff turns out to be wrong,
|
|
# reinstate a PR-side mirror rather than relying on main.yml alone.
|
|
|
|
# F7a: fold of a 3-host matrix (native, msys2, cygwin) into one sequential
|
|
# job on a single windows-latest runner. Review SF-1 (2026-10-03): only the
|
|
# Cygwin *setup* step keeps `continue-on-error: true` (a flaky installer
|
|
# download is infrastructure noise, not a code failure). The native and
|
|
# msys2 install/exercise steps and the Cygwin *exercise* step carry no
|
|
# continue-on-error, so a genuine failure in any of them already fails the
|
|
# job on its own - no hand-written aggregator step needed. Each of those
|
|
# steps keeps `if: ${{ !cancelled() }}` (plus a check that its own leg's
|
|
# setup succeeded) so a failure in one leg does not stop the later legs
|
|
# from attempting to run - the fail-fast: false behavior the matrix used to
|
|
# give for free.
|
|
# Blacksmith Windows (blacksmith-4vcpu-windows-2025) for every PR.
|
|
#
|
|
# RISK (unverified from this sandbox, flagged in the F7b report): the
|
|
# native-Make step below assumes Chocolatey is preinstalled (`choco
|
|
# install ...`), as it is on GitHub's windows-latest image. Blacksmith's
|
|
# windows-2025 image is documented as GitHub's windows-2025 minus the full
|
|
# Visual Studio IDE/EdgeDriver/WinAppDriver; Chocolatey is a base-image
|
|
# tool unrelated to those, so it is expected to still be present, but this
|
|
# is not independently confirmed. The msys2/setup-msys2 and
|
|
# cygwin/cygwin-install-action steps download their own tooling and do not
|
|
# depend on any preinstalled image contents, so they carry no equivalent
|
|
# risk. If only the native-Make step fails here, that is the gap to roll
|
|
# back on (revert this runs-on line to the literal `windows-latest`).
|
|
windows-make-shell:
|
|
name: Windows Make shell (native, msys2, cygwin)
|
|
runs-on: ${{ 'blacksmith-4vcpu-windows-2025' }}
|
|
timeout-minutes: 30
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
|
|
|
|
# F7b review fix (S9): print the preinstalled tool versions this job
|
|
# depends on before relying on them, so a Blacksmith image gap (see the
|
|
# RISK comment above) surfaces here instead of failing deep in a later
|
|
# step with an opaque "command not found".
|
|
- name: Check Windows tooling diagnostics
|
|
shell: pwsh
|
|
run: |
|
|
Write-Output "::group::choco"
|
|
choco --version
|
|
Write-Output "::endgroup::"
|
|
Write-Output "::group::go env (CGO_ENABLED, CC)"
|
|
go env CGO_ENABLED CC
|
|
Write-Output "::endgroup::"
|
|
|
|
- name: Install native GNU Make
|
|
id: install-native
|
|
if: ${{ !cancelled() }}
|
|
shell: pwsh
|
|
run: choco install make --version=4.4.1 --yes --no-progress
|
|
|
|
# F7b review fix (B1): msys2/setup-msys2 caches its installed packages
|
|
# by default (action.yml: cache.default = true), which means this step
|
|
# would SAVE an actions/cache entry from a same-repo PR the moment it
|
|
# moved onto a Blacksmith runner -- confirmed via a real GitHub cache
|
|
# list entry (msys2-pkgs-upd:false-conf:...) with a
|
|
# refs/pull/.../merge ref. `runner.environment == 'github-hosted'`
|
|
# disables that implicit save on Blacksmith (fail-closed: only the
|
|
# literal "github-hosted" value keeps caching on, matching the
|
|
# fail-closed convention F7c review fix N1 set for actions/setup-go's
|
|
# own `cache` input). Pinned by
|
|
# TestBlacksmithReachablePRJobsDisableDefaultCachingActions.
|
|
- name: Set up MSYS2 GNU Make
|
|
id: install-msys2
|
|
if: ${{ !cancelled() }}
|
|
timeout-minutes: 10
|
|
uses: msys2/setup-msys2@66cd2cce69caa17b53920067426061ca1de3a884 # v2.32.0
|
|
with:
|
|
msystem: MSYS
|
|
install: git make
|
|
path-type: minimal
|
|
cache: ${{ runner.environment == 'github-hosted' }}
|
|
|
|
- name: Set up Cygwin GNU Make
|
|
if: ${{ !cancelled() }}
|
|
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.
|
|
# Review SF-2 (2026-10-03): a 10-minute step timeout caps how long a
|
|
# hung download can block the native/msys2 legs' exercise steps
|
|
# behind it, instead of consuming the whole 30-minute job timeout.
|
|
continue-on-error: true
|
|
timeout-minutes: 10
|
|
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: ${{ !cancelled() && 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
|
|
id: native
|
|
if: ${{ !cancelled() && steps.install-native.outcome == 'success' }}
|
|
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
|
|
id: msys2
|
|
if: ${{ !cancelled() && steps.install-msys2.outcome == 'success' }}
|
|
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
|
|
id: cygwin-test
|
|
# 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: ${{ !cancelled() && 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 lanes (bazel.yml): the only pre-merge run of every Linux Go
|
|
# test tier (PR core, pure-Go and js/wasm, the release cross-compile, the
|
|
# dolt-server lane, the embedded-Dolt, proxied-server and server-Dolt
|
|
# storage tiers that pr-risk.yml used to run, integration and the cmd/bd
|
|
# Dolt-server tier).
|
|
# ci-gate requires each of them to have run remotely on rbe-west and
|
|
# passed, on every pull_request and merge group: same-repo PRs and merge
|
|
# groups in mode remote, fork and Dependabot PRs through rbe-west's mint
|
|
# (rbe-fork, modes fork-ro/fork-rw). Mode skip (the farm switch off) or
|
|
# cache (no secret, or rbe-fork closed or refusing) is red, never a silent
|
|
# pass with fewer tests. 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 the pre-warm app key and nothing else. Test results are cached: a PR
|
|
# or merge group re-runs only tests whose inputs changed (nightly re-runs
|
|
# everything; .bazelrc test:fresh). Its bd artifact
|
|
# (bazel-ci-build-artifacts) is kept for debugging; F3: the package gates
|
|
# build their own bd via this call's rbe job.
|
|
bazel:
|
|
name: Bazel
|
|
# A called workflow's job gets at most this call's token permissions, and
|
|
# GitHub checks them when the run starts, even for a job whose if: skips
|
|
# it (startup_failure otherwise; gascity #7478): bazel.yml's rrc-seed asks
|
|
# id-token: write (push to main only) and rrc-verify issues: write
|
|
# (schedule and dispatch only). Neither runs for this event, every other
|
|
# bazel.yml job keeps contents: read, and rbe-west's mint refuses any OIDC
|
|
# token but a main-push bazel.yml one
|
|
# (scripts/bazel_rrc_test.go, TestBazelWorkflowCallersGrantEveryRequestedPermission).
|
|
permissions:
|
|
contents: read
|
|
id-token: write
|
|
issues: write
|
|
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 }}
|
|
RBE_POOL_APP_PRIVATE_KEY: ${{ secrets.RBE_POOL_APP_PRIVATE_KEY }}
|
|
with:
|
|
build-artifact-name: bazel-ci-build-artifacts
|
|
integration: "on"
|
|
# Must equal BAZEL_CMD_DOLT_REQUIRED (top of this file; policy-tested):
|
|
# true leaves //cmd/bd:bd_test to the then-required bazel-cmd-dolt.
|
|
cmd-dolt-required: true
|
|
# F3: only pr.yml opts in; the package-mcp/package-npm jobs run inside
|
|
# this call, needing only its rbe job.
|
|
package-gates: "on"
|
|
|
|
ci-gate:
|
|
name: CI Gate / Required
|
|
# F3: same-repo PRs and merge_group get the org's Blacksmith pool; forks,
|
|
# Dependabot and any other event stay GitHub-hosted. This job restores no
|
|
# GitHub-saved cache. Must match the TestSameRepoBlacksmithRunners pin;
|
|
# the gate's NAME must never change (ruleset requires exactly "CI Gate /
|
|
# Required").
|
|
runs-on: ${{ (github.event_name == 'merge_group' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]')) && 'blacksmith-2vcpu-ubuntu-2404' || 'ubuntu-latest' }}
|
|
# F3: now on Blacksmith for same-repo PRs; a hang used to burn only the
|
|
# default 360 minutes of a free GitHub-hosted runner, now Blacksmith
|
|
# minutes too.
|
|
timeout-minutes: 10
|
|
needs:
|
|
- fast-checks
|
|
- test-windows-liveness
|
|
- worktree-remove-windows
|
|
- check-doc-flags
|
|
- check-doc-freshness-platforms
|
|
- pr-preflight-platforms
|
|
- windows-make-shell
|
|
- bazel
|
|
if: ${{ always() }}
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
|
|
|
|
- name: Evaluate CI gate
|
|
env:
|
|
CI_GATE_NAME: PR baseline gate
|
|
CI_GATE_REQUIRED: >-
|
|
FAST_CHECKS
|
|
CHECK_MIGRATION_HYGIENE
|
|
CHECK_NO_BEADS_CHANGES
|
|
CHECK_DOC_FLAGS
|
|
CHECK_DOC_FRESHNESS_PLATFORMS
|
|
PR_PREFLIGHT_PLATFORMS
|
|
PACKAGE_MCP
|
|
PACKAGE_NPM
|
|
TEST_WINDOWS_LIVENESS
|
|
WORKTREE_REMOVE_WINDOWS
|
|
WINDOWS_MAKE_SHELL
|
|
BAZEL
|
|
BAZEL_TEST
|
|
BAZEL_PURE
|
|
BAZEL_RELEASE_CROSS
|
|
BAZEL_EMBEDDED
|
|
BAZEL_INTEGRATION
|
|
BAZEL_DOLTSERVER
|
|
BAZEL_PROXIED
|
|
BAZEL_SERVER_STORAGE
|
|
BAZEL_REMOTE
|
|
# fast-checks' two base-diff steps; each token reads that step's
|
|
# outcome (via the job's outputs), with a 'skipped' fallback for a
|
|
# lost job (see FAST_CHECKS below). TestPRCIGateFastChecksTokens
|
|
# pins this mapping. The repository guards the job used to run
|
|
# (build tags, versions, migration checks A and B, gofmt) are Bazel
|
|
# tests and gate through BAZEL_TEST.
|
|
CHECK_MIGRATION_HYGIENE: ${{ needs.fast-checks.outputs.migration-hygiene || 'skipped' }}
|
|
CHECK_NO_BEADS_CHANGES: ${{ needs.fast-checks.outputs.no-beads-changes || 'skipped' }}
|
|
# Backstop: if fast-checks itself is lost (e.g. a cancelled runner)
|
|
# before any step sets an output, the two tokens above read
|
|
# 'skipped' (neither is in CI_GATE_SKIPPED_OK, so the gate still
|
|
# reds) - FAST_CHECKS gives ci-gate.sh one clear line naming the
|
|
# job.
|
|
FAST_CHECKS: ${{ needs.fast-checks.result }}
|
|
TEST_WINDOWS_LIVENESS: ${{ needs.test-windows-liveness.result }}
|
|
WORKTREE_REMOVE_WINDOWS: ${{ needs.worktree-remove-windows.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 }}
|
|
# F3: package-mcp/package-npm now run inside the bazel call; their
|
|
# job.status surfaces as a call output exactly like the Bazel lanes
|
|
# below, never "skipped" on pr.yml (package-gates is always "on"
|
|
# here).
|
|
PACKAGE_MCP: ${{ needs.bazel.outputs.package-mcp || 'skipped' }}
|
|
PACKAGE_NPM: ${{ needs.bazel.outputs.package-npm || 'skipped' }}
|
|
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_RELEASE_CROSS: ${{ needs.bazel.outputs.bazel-release-cross || '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' }}
|
|
# Advisory unless BAZEL_CMD_DOLT_REQUIRED (top of this file) is
|
|
# "true": see the run script.
|
|
BAZEL_CMD_DOLT: ${{ needs.bazel.outputs.bazel-cmd-dolt || '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 }}
|
|
run: |
|
|
skipped_ok=""
|
|
# The cmd/bd Dolt-server tier (bazel.yml's bazel-cmd-dolt) is
|
|
# advisory until BAZEL_CMD_DOLT_REQUIRED (top of this file) is
|
|
# "true"; it is never in the static list above.
|
|
if [[ "$BAZEL_CMD_DOLT_REQUIRED" == "true" ]]; then
|
|
CI_GATE_REQUIRED="$CI_GATE_REQUIRED BAZEL_CMD_DOLT"
|
|
fi
|
|
export CI_GATE_REQUIRED
|
|
# Bazel lanes skipped by design in the call's execution mode (all
|
|
# of them in mode skip, the remote-only embedded, proxied and
|
|
# server-storage tiers in modes local and cache, and integration
|
|
# 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
|
|
# The Bazel lanes are the only run of every Linux Go test tier
|
|
# (there is no legacy job to fall back to), so on every pull_request
|
|
# and merge group they must have run remotely on rbe-west: mode
|
|
# remote, or fork-ro/fork-rw through rbe-fork for a PR without the
|
|
# CI secrets; mode skip (the farm switch off) or cache (no
|
|
# secret, or rbe-fork closed or refusing) is red whatever
|
|
# bazel-gate.sh's skip list allows; each lane's own result is
|
|
# required above.
|
|
BAZEL_REMOTE=success
|
|
if [[ ! "$BAZEL_RBE_MODE" =~ ^(remote|fork-ro|fork-rw)$ ]]; then
|
|
BAZEL_REMOTE=not-run-remotely
|
|
echo "::error::The Bazel lanes did not run remotely on rbe-west (mode '${BAZEL_RBE_MODE:-none}'); they are this PR's only run of the Linux Go test tiers. In mode cache on a PR without the CI secrets, rbe-fork was closed or refused this run: re-run all jobs later."
|
|
fi
|
|
export BAZEL_REMOTE
|
|
export CI_GATE_SKIPPED_OK="$skipped_ok"
|
|
bash .github/scripts/ci-gate.sh
|