beads/internal/httpapi/BUILD.bazel
Julian Knutsen 0500fc6f40
ci(bazel): run the scripts and source-walking tests remotely; retire their go test legs (#7320)
//scripts:scripts_test and //scripts/check-versions:check-versions_test
drop their host-tools/no-remote-exec/no-remote-cache tags and run on the
rbe-west workers like every other target (the worker image ships bash, git,
python3, jq, yq, curl, openssl, unzip and coreutils; a missing tool fails the
test under Bazel rather than skipping it). Go comes in hermetically as the
registered SDK; check-versions.sh's `go build` is stood in for by the
Bazel-built checker.

The tests that walked the source checkout now get it as data:
tools/bazel/go_srcs.py keeps a managed `repo_files` filegroup in every
package and aggregates them into //:repo_files (exactly the tracked files
Bazel can see; make bazel-sync-check fails on a package without one).
scripts_test and docsync_test take it instead of hand-listed filegroups,
and every TEST_SRCDIR/IsBazel skip and go-test-only block in them is gone.
The release formula under .bazelignore'd .beads/ comes in through a
@beads_formulas local repository; npm-package/ and .claude/ are visible to
Bazel again (only their node_modules/worktrees stay ignored), so the npm
manifest release check and the AGENTS.md skill links run under Bazel too.
TestZZStdioNotLeaked falls back to TestMain's pre-run streams instead of
skipping in a shard without its baseline.

tools/bazel/equivalence_allowlist.txt shrinks from 20 skip entries to the
two cmd/bd tests of plain go test's own bd build fallback, which Bazel never
takes; pr-preflight-platforms now runs them on Linux, macOS and Windows. The
scripts-go-checks scripts-test and allowlisted legs, their scripts
(scripts-go-test.sh, allowlisted-go-tests.sh, run_allowlisted_go_tests.py)
and main.yml's --compile-only warm for them are removed. The vet leg stays
(ga-96smfk.18).

Refs: ga-96smfk.16

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-06 22:20:16 +00:00

154 lines
3.8 KiB
Python

load("@rules_go//go:def.bzl", "go_library", "go_test")
go_library(
name = "httpapi",
srcs = [
"auth.go",
"batch_apply.go",
"batch_close.go",
"batch_create.go",
"batch_get.go",
"blocking.go",
"claim.go",
"claim_next.go",
"close.go",
"comments.go",
"create.go",
"cursor.go",
"cycles.go",
"delete.go",
"dependency_edit.go",
"doc.go",
"edges.go",
"events.go",
"events_watch.go",
"handlers.go",
"memories.go",
"metadata_cas.go",
"pinning.go",
"problem.go",
"query.go",
"reads.go",
"related.go",
"release.go",
"reopen.go",
"roles.go",
"routes.go",
"server.go",
"settings.go",
"stats.go",
"sweep.go",
"tree.go",
"update.go",
"wire_revision.go",
],
importpath = "github.com/steveyegge/beads/internal/httpapi",
visibility = ["//:__subpackages__"],
deps = [
"//internal/config",
"//internal/eventsjournal",
"//internal/httpapi/apigen",
"//internal/storage",
"//internal/storage/domain",
"//internal/storage/uow",
"//internal/types",
"//issueops",
"//memoryops",
"@com_github_go_sql_driver_mysql//:mysql",
"@org_golang_x_net//netutil",
],
)
go_test(
name = "httpapi_test",
srcs = [
"auth_test.go",
"batch_apply_test.go",
"batch_close_test.go",
"batch_create_test.go",
"batch_get_test.go",
"blocking_test.go",
"brief_projection_test.go",
"claim_next_test.go",
"claim_test.go",
"close_test.go",
"comments_test.go",
"context_test.go",
"count_test.go",
"create_test.go",
"cycles_test.go",
"delete_test.go",
"dependency_edit_test.go",
"edge_counts_test.go",
"edges_test.go",
"events_test.go",
"events_watch_test.go",
"get_issue_test.go",
"large_batch_apply_test.go",
"list_comments_omitted_test.go",
"list_sort_test.go",
"memories_test.go",
"metadata_cas_test.go",
"problem_test.go",
"project_stamp_test.go",
"reads_test.go",
"ready_count_test.go",
"related_test.go",
"release_test.go",
"reopen_test.go",
"roles_test.go",
"server_test.go",
"settings_write_test.go",
"spec_parity_test.go",
"stats_test.go",
"sweep_test.go",
"timed_provider_binding_test.go",
"tree_test.go",
"update_test.go",
"wire_bijection_test.go",
"wire_revision_test.go",
],
data = [
"claim.go",
"//cmd/bd:list.go",
"//cmd/bd:ready.go",
] + glob(["testdata/**"]),
embed = [":httpapi"],
deps = [
"//internal/config",
"//internal/eventsjournal",
"//internal/httpapi/apigen",
"//internal/httpapi/spec",
"//internal/storage",
"//internal/storage/domain",
"//internal/storage/uow",
"//internal/types",
"//internal/workapi",
"//issueops",
"//memoryops",
"@com_github_go_sql_driver_mysql//:mysql",
"@in_gopkg_yaml_v3//:yaml_v3",
],
)
# --- begin repo_files (managed by tools/bazel/go_srcs.py; run `make bazel-sync`) ---
filegroup(
name = "repo_files",
srcs = glob(
["**"],
exclude = [
"**/*.db",
"**/*.exe",
"**/*.out",
"**/*.prof",
"**/*.pyc",
"**/*.test",
"**/__pycache__/**",
"**/node_modules/**",
],
),
visibility = ["//:__pkg__"],
)
# --- end repo_files ---