* build(bazel): add side-by-side Bazel scaffold (module + gazelle) Add a Bzlmod Bazel build alongside the Go toolchain. `go build` and `go test` are unchanged; nothing in CI invokes Bazel yet. - MODULE.bazel: rules_go 0.63.0, gazelle 0.53.0, Go SDK 1.26.7 (matches the go.mod toolchain directive), go_deps from go.mod. - ICU policy (engdocs/ICU-POLICY.md): a go-mysql-server gazelle_override selects the pure-Go regex backend and excludes regex_cgo.go, and .bazelrc builds with --@rules_go//go/config:tags=gms_pure_go, so no target depends on go-icu-regex or links libicu. - third_party/patches: three module_override patches for dolt deps that ship WORKSPACE-era BUILD files, adapted from the gascity project. - .bazelrc: prcore/ci test configs (inert for now; they match pr-core's test selection, not yet its environment isolation) and a generic remote-exec config with a bounded remote timeout. Executor endpoints and TLS credentials come only from a gitignored .bazelrc.local/user.bazelrc or a CI rc outside the workspace. - .bazelversion pins Bazel 9.2.0; .bazelignore skips separate modules, non-Go trees, nested agent worktrees (.claude, .worktrees) and local data/output dirs (.beads, .dolt, dist, .runtime, tmp), so a primary checkout neither builds nor gazelle-rewrites nested worktree copies. - Gazelle-generated BUILD.bazel files for every Go package. - Makefile: `make bazel-sync` (gazelle + bazel mod tidy). - .gitignore: bazel-* output symlinks and machine-local rc files. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * test(bazel): policy tests for the Bazel configuration Add scripts/bazel_policy_test.go, plain Go tests that run under both `go test ./scripts` and `bazel test //scripts:scripts_test`: - MODULE.bazel go_sdk.download version equals the go.mod toolchain. - ICU policy: .bazelrc sets gms_pure_go for build, the go-mysql-server gazelle_override excludes regex_cgo.go, and the root BUILD.bazel carries `# gazelle:build_tags gms_pure_go`. - .bazelversion pins an exact Bazel release. - .bazelrc.local and user.bazelrc are gitignored (parsed from .gitignore and cross-checked with git check-ignore when in a checkout). - No remote-execution endpoints or credentials in committed bazelrc-like files, Markdown docs or .github/**: remote/BES/TLS flags (--remote_executor, --remote_cache, --bes_backend, --remote_header, --tls_client_certificate, ...) with a literal value, with or without a URL scheme, and non-loopback gRPC URLs in rc/.github files. Placeholders, $VARIABLES, and loopback are allowed; Markdown gRPC URLs (OTel exporter docs) are not flagged. Skipped outside a git checkout, e.g. in the Bazel sandbox. Each check is a pure function also exercised against fixtures that break the invariant. The files the tests read are declared as data via //:bazel_policy_files so they resolve from runfiles under Bazel. scripts/check-build-tags.sh now treats Bazel invocations as governed by .bazelrc: the shell command segment that invokes Bazel (split on &&, ||, ;, |, $( and backticks) is exempt from the per-line `go` tag check, while a bare `go` in another segment of the same line is still flagged. When any scanned file invokes Bazel (or .bazelrc exists) .bazelrc must set --@rules_go//go/config:tags=gms_pure_go for build. scripts/check_build_tags_test.go covers both in a temp repository. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * fix(scripts): split bazel lines in pure bash so check-build-tags works with BSD sed BSD sed (macOS) does not expand \n in s/// replacements, so the segment split never happened and the Bazel-exemption tests failed on macos-latest. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * test(scripts): skip check-build-tags tests when bash lacks mapfile macOS runners use /bin/bash 3.2, which has no mapfile; check-build-tags.sh has always required bash >= 4, so the new tests are skipped there. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
85 lines
2.5 KiB
Python
85 lines
2.5 KiB
Python
load("@rules_go//go:def.bzl", "go_library", "go_test")
|
|
|
|
go_library(
|
|
name = "proxy",
|
|
srcs = [
|
|
"backend.go",
|
|
"control.go",
|
|
"endpoint.go",
|
|
"endpoint_unix.go",
|
|
"endpoint_windows.go",
|
|
"force_stop.go",
|
|
"process_executable_darwin.go",
|
|
"process_executable_linux.go",
|
|
"process_executable_windows.go",
|
|
"proxy.go",
|
|
"read_status.go",
|
|
"server.go",
|
|
"shutdown.go",
|
|
"stats.go",
|
|
"unverified_process_darwin.go",
|
|
"unverified_process_linux.go",
|
|
"unverified_process_unsupported.go",
|
|
"unverified_process_windows.go",
|
|
],
|
|
importpath = "github.com/steveyegge/beads/internal/storage/dbproxy/proxy",
|
|
visibility = ["//:__subpackages__"],
|
|
deps = [
|
|
"//internal/atomicfile",
|
|
"//internal/configfile",
|
|
"//internal/debug",
|
|
"//internal/fdhygiene",
|
|
"//internal/lockfile",
|
|
"//internal/procid",
|
|
"//internal/storage/dbproxy/identity",
|
|
"//internal/storage/dbproxy/pidfile",
|
|
"//internal/storage/dbproxy/server",
|
|
"//internal/storage/dbproxy/util",
|
|
"@com_github_cenkalti_backoff_v4//:backoff",
|
|
"@org_golang_x_sync//errgroup",
|
|
] + select({
|
|
"@rules_go//go/platform:android": [
|
|
"@org_golang_x_sys//unix",
|
|
],
|
|
"@rules_go//go/platform:darwin": [
|
|
"@org_golang_x_sys//unix",
|
|
],
|
|
"@rules_go//go/platform:ios": [
|
|
"@org_golang_x_sys//unix",
|
|
],
|
|
"@rules_go//go/platform:linux": [
|
|
"@org_golang_x_sys//unix",
|
|
],
|
|
"@rules_go//go/platform:windows": [
|
|
"@org_golang_x_sys//windows",
|
|
],
|
|
"//conditions:default": [],
|
|
}),
|
|
)
|
|
|
|
go_test(
|
|
name = "proxy_test",
|
|
srcs = [
|
|
"backend_dial_timeout_test.go",
|
|
"control_test.go",
|
|
"endpoint_mismatch_test.go",
|
|
"endpoint_no_data_probe_test.go",
|
|
"endpoint_security_test.go",
|
|
"endpoint_spawn_stop_unix_test.go",
|
|
"external_transport_lifecycle_internal_test.go",
|
|
"force_stop_linux_test.go",
|
|
"server_epoch_internal_test.go",
|
|
"server_test.go",
|
|
],
|
|
embed = [":proxy"],
|
|
deps = [
|
|
"//internal/configfile",
|
|
"//internal/procid",
|
|
"//internal/storage/dbproxy/identity",
|
|
"//internal/storage/dbproxy/pidfile",
|
|
"//internal/storage/dbproxy/server",
|
|
"//internal/storage/dbproxy/util",
|
|
"@com_github_stretchr_testify//assert",
|
|
"@com_github_stretchr_testify//require",
|
|
],
|
|
)
|