beads/internal/httpapi/BUILD.bazel
Julian Knutsen d90823480a
ci(bazel): split //scripts:scripts_test by what it reads; partition //:repo_files (#7414)
* ci(bazel): split //scripts:scripts_test by what it reads; partition //:repo_files

//scripts:scripts_test declared //:repo_files (the whole checkout), so every
PR re-ran it, and it took ~181s on rbe-west. Most of that (60-79s) was
TestBazelGatedLanesNeverRetryFlakyTests line-regexping the --run_under
wrapper's pinned dolt binary (tools/bazel/hermetic_bin/dolt, in every
test's runfiles); it now skips binary files, as git grep -I does.

tools/bazel/go_srcs.py's per-package repo_files block now partitions each
package's files into repo_go_srcs, repo_go_test_srcs, repo_doc_files and
repo_other_files, aggregated at the root; //:repo_files is their union
(same 4679 files). The //scripts tests are split into go_test targets by
what they read (traced per test with strace over a runfiles-shaped tree):

  scripts_test          CI/Bazel policy: //:repo_other_files (+1 Go file)
  shell_scripts_test    script fixtures: //scripts files, a few root files
  go_test_sources_test  _test.go scans: //:repo_go_test_srcs + shard files
  go_sources_test       check-testing-short.sh: every .go file
  tracked_files_test    every tracked file: //:repo_files

Shared helpers move to helpers-only files; TestScriptsTestTargetsPartition-
TheTests fails on a test file in no target or in two. //test/docsync and
the //scripts/repochecks slices declare partitions or single files instead
of //:repo_files where they can.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* ci(bazel): skip only the non-checkout hermetic_bin dir in the flaky-retry walk

Skipping every binary file also stopped scanning tracked binaries (images,
.binpb fixtures). Skip just tools/bazel/hermetic_bin, the --run_under
wrapper's runfiles directory, which is not in the checkout, so the walk's
coverage of tracked files is unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-09 05:13:07 +00:00

193 lines
4.6 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_doc_files",
srcs = glob(
[
"**/*.md",
"**/*.mdx",
],
allow_empty = True,
exclude = ["**/node_modules/**"],
),
visibility = ["//:__subpackages__"],
)
filegroup(
name = "repo_go_srcs",
srcs = glob(
["**/*.go"],
allow_empty = True,
exclude = [
"**/*_test.go",
"**/node_modules/**",
],
),
visibility = ["//:__subpackages__"],
)
filegroup(
name = "repo_go_test_srcs",
srcs = glob(
["**/*_test.go"],
allow_empty = True,
exclude = ["**/node_modules/**"],
),
visibility = ["//:__subpackages__"],
)
filegroup(
name = "repo_other_files",
srcs = glob(
["**"],
exclude = [
"**/*.db",
"**/*.exe",
"**/*.go",
"**/*.md",
"**/*.mdx",
"**/*.out",
"**/*.prof",
"**/*.pyc",
"**/*.test",
"**/__pycache__/**",
"**/node_modules/**",
],
),
visibility = ["//:__subpackages__"],
)
# --- end repo_files ---