* ci: make the required gates merge-queue ready
The default-branch ruleset requires "CI Gate / Required" and "PR Risk
Gate / Required". Prepare both for a GitHub merge queue (ALLGREEN,
squash), so enabling the ruleset's merge_queue rule is the only step left.
- pr.yml, pr-risk.yml: merge_group pinned to types [checks_requested].
- D2: bazel-coverage covers every merge_group run (same repository, CI
secrets, actor github-merge-queue[bot], bazel.yml mode remote), so the
retired legacy tiers stay retired in the queue and ci-gate requires
their Bazel lanes to have run remotely and passed; a missing secret or
the farm switch off is red, as on a same-repo PR.
- Diff bases on merge_group: the package gates diff
merge_group.base_sha..head_sha (not HEAD^, which misses all but the
last commit of a rebase-method entry), the .beads/issues.jsonl guard
now runs on merge_group against base_sha (ci-gate no longer excuses
its skip), and check-doc-flags passes BD_DOCS_DIFF_BASE so CLI-docs
drift already on main cannot eject every queued PR.
- Test result reuse: on a merge_group run and on attempt 2+ of a PR run,
the six always-execute Bazel lanes append --config=reuse-test-results
(--cache_test_results=auto), so tests whose action key is unchanged
reuse the farm's recorded PASS and only what the merge changed runs.
Failures are never reused, eviction retries stay 0, and each PR's first
attempt, push to main and nightly still execute every test.
- scripts/ci_merge_queue_test.go simulates merge_group through the shared
evalGHExpr evaluator (now with true/false/null literals, hyphenated
identifiers and case-insensitive ==) and the workflows' own scripts:
triggers and gate names, concurrency groups, every pull_request field
read, the coverage and rbe decisions, result reuse, the package-gate,
.beads and doc-drift diff bases.
- engdocs/CI_REQUIRED_CHECK_TOPOLOGY.md: new "Merge Queue" section (how
to queue, settings, what runs, result reuse rationale, ejection and
flakes, rollback).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci: cache Bazel test results except nightly; queue trust and sizing
Review follow-ups to the merge-queue readiness change.
- Test results (S1): --nocache_test_results also stops Bazel writing
results, so a PR's first run never fed the cache and the merge-queue
reuse config could only hit on later reuse runs. Drop it from
test:embedded, test:doltserver-proxied, test:doltserver-integration and
test:sole-run (which keeps --experimental_remote_cache_eviction_retries=0),
and drop test:reuse-test-results and BAZEL_REUSE_RESULTS. Results are now
cached (read and write) on PRs, merge groups and pushes to main.
nightly.yml passes the new fresh-test-results input, so every `bazel
test` appends --config=fresh (--nocache_test_results) and the suite
re-executes nightly. The docker lane keeps --nocache_test_results.
Measured locally with a disk cache: a default run writes and the next
reads ("(cached) PASSED"); a fresh run neither reads nor writes.
- Security headers (S2): bazel.yml now states that a merge_group run
executes the queued commit's workflows, so a queued fork or Dependabot
PR's CI edits run with every CI secret, the pre-warm app key included
(merging-level trust), and records the maintainer rule: review fork
changes to .github/, .bazelrc, tools/bazel, MODULE.bazel, BUILD files
and CI scripts before queueing. Same note in the topology doc.
- Queue sizing (S3): recommend max_entries_to_build 3 and
check_response_timeout_minutes 60 (max_entries_to_merge 5, ALLGREEN,
SQUASH unchanged).
- Nits: the .beads guard fails closed on a missing diff base, and its
test runs under GitHub's default `bash -e`; evalGHExpr follows GitHub's
loose equality (true == 'true' is false, false == '' is true, missing
context keys are null) with a typed-context variant; the
detect-package-gates comment notes the SQUASH/HEAD^ equivalence and
path-filter scope; the doc covers re-run reuse, flake re-sampling via
dispatch, stale queue runs and how to confirm reuse on the farm.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
123 lines
3.7 KiB
Python
123 lines
3.7 KiB
Python
load("@rules_go//go:def.bzl", "go_test")
|
|
|
|
# CI and repo-policy tests: they parse the workflows and run the CI shell
|
|
# scripts against fixtures.
|
|
#
|
|
# Tags:
|
|
# host-tools: the scripts and fixtures run the host's git, python3, awk,
|
|
# sed, find, grep and timeout (beyond the bash the test wrapper needs).
|
|
# Under Bazel a missing git or bash fails the test (under go test it
|
|
# skips).
|
|
# no-remote-exec: so they always run where that inventory is known (the
|
|
# developer machine or the CI runner). The farm workers do have these
|
|
# tools today (the target passes there), so this can be dropped once that
|
|
# is guaranteed.
|
|
# no-remote-cache: the action key does not cover the host's tools, so a
|
|
# result from one host is neither uploaded for nor served to another.
|
|
go_test(
|
|
name = "scripts_test",
|
|
srcs = [
|
|
"bazel_autofix_push_test.go",
|
|
"bazel_cache_mode_test.go",
|
|
"bazel_farm_workflow_test.go",
|
|
"bazel_fork_mode_test.go",
|
|
"bazel_policy_test.go",
|
|
"bazel_rbe_prewarm_test.go",
|
|
"bazel_skip_allowlist_test.go",
|
|
"check_build_tags_test.go",
|
|
"check_doc_freshness_test.go",
|
|
"check_release_cross_compile_test.go",
|
|
"check_testing_short_test.go",
|
|
"check_winget_portable_alias_test.go",
|
|
"ci_actions_policy_test.go",
|
|
"ci_blacksmith_runner_test.go",
|
|
"ci_capability_selector_test.go",
|
|
"ci_f7b_review_test.go",
|
|
"ci_f7c_advisory_test.go",
|
|
"ci_merge_queue_test.go",
|
|
"ci_workflow_apt_get_timeout_test.go",
|
|
"ci_workflow_test.go",
|
|
"complexity_script_test.go",
|
|
"conformance_script_test.go",
|
|
"embedded_shard_count_test.go",
|
|
"host_tools_test.go",
|
|
"install_dolt_test.go",
|
|
"pr_lanes_bazel_coverage_test.go",
|
|
"pr_preflight_test.go",
|
|
"pr_risk_bazel_coverage_test.go",
|
|
"pull_dolt_image_test.go",
|
|
"release_script_test.go",
|
|
"required_suite_test.go",
|
|
"test_script_test.go",
|
|
"upgrade_smoke_loop_test.go",
|
|
"windows_test_binaries_manifest_test.go",
|
|
],
|
|
data = [
|
|
":scripts_files",
|
|
"//:.githooks/pre-commit",
|
|
"//:.goreleaser.yml",
|
|
"//:bazel_policy_files",
|
|
"//:engdocs/LINTING.md",
|
|
"//:mcp_package_policy_files",
|
|
"//:test_sh_files",
|
|
"//:workflow_files",
|
|
"//internal/testutil:testdoltcommon.go",
|
|
"//tools/bazel:dolt.bzl",
|
|
],
|
|
tags = [
|
|
"host-tools",
|
|
"no-remote-cache",
|
|
"no-remote-exec",
|
|
],
|
|
deps = [
|
|
"//internal/formula",
|
|
"//internal/testutil/bazeltest",
|
|
"//scripts/internal/testbash",
|
|
"@in_gopkg_yaml_v3//:yaml_v3",
|
|
],
|
|
)
|
|
|
|
# The scripts scripts_test reads and runs (CI helpers, check-*.sh, release.sh,
|
|
# test.sh, conformance.sh, ...). Globs stop at subpackages, so this is only
|
|
# this package's own tree.
|
|
filegroup(
|
|
name = "scripts_files",
|
|
srcs = glob(
|
|
["**"],
|
|
exclude = [
|
|
"BUILD.bazel",
|
|
"**/*_test.go",
|
|
],
|
|
),
|
|
)
|
|
|
|
exports_files(
|
|
["migration-test/release-catalog.json"],
|
|
visibility = ["//scripts/migration-test/catalog:__pkg__"],
|
|
)
|
|
|
|
exports_files(
|
|
[
|
|
"ci/fmt-check.sh",
|
|
"ci/lib/timing.sh",
|
|
"ci/pr-lint.sh",
|
|
],
|
|
visibility = ["//scripts/prlintmake:__pkg__"],
|
|
)
|
|
|
|
exports_files(
|
|
["README.md"],
|
|
visibility = ["//:__pkg__"],
|
|
)
|
|
|
|
exports_files(
|
|
["ci/gofmt-bin.sh"],
|
|
visibility = ["//scripts/prlintmake:__pkg__"],
|
|
)
|
|
|
|
# The compatibility entrypoint whose exit-status contract
|
|
# //scripts/check-versions:check-versions_test drives.
|
|
exports_files(
|
|
["check-versions.sh"],
|
|
visibility = ["//scripts/check-versions:__pkg__"],
|
|
)
|