* fix(http): bd link over a connected HTTP workspace, through the DependencyEditor role bd link wrote through the store's raw AddDependencyWithOptions, which the HTTP client refuses by design (D8), so every bd link failed on an HTTP workspace whatever the type. Its direct route now writes through the DependencyEditor role with the helper bd dep add uses (addDependencyEdgesDirect), which serves local stores and HTTP workspaces alike: over HTTP one dependencies:add request, and the server already takes any 1-32 character type. link keeps its own checks before the write (and before the dial): the dotted-child rule and the type's length only, never bd dep add's well-known-type list. The proxied-server route is unchanged. backend/http TestE2E_LinkOverHTTP covers owned-by and the other roadmap types, the empty and over-long type refusals (no write reaches the server), and the typed conflict for an edge of another type. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * build(bazel): auto-sync BUILD files Applied from the bazel-sync-patch artifact of https://github.com/gastownhall/beads/actions/runs/39201892756 (`make bazel-sync`: gazelle, tools/bazel/go_srcs.py, bazel mod tidy). Only BUILD.bazel, MODULE.bazel and MODULE.bazel.lock are ever pushed; see scripts/bazel-autofix-push.sh. --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
192 lines
5.9 KiB
Python
192 lines
5.9 KiB
Python
load("@rules_go//go:def.bzl", "go_library", "go_test")
|
|
load("@rules_shell//shell:sh_test.bzl", "sh_test")
|
|
|
|
go_library(
|
|
name = "http",
|
|
srcs = [
|
|
"attach.go",
|
|
"credential.go",
|
|
"errors.go",
|
|
"http.go",
|
|
"target.go",
|
|
],
|
|
importpath = "github.com/steveyegge/beads/backend/http",
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
"//backend",
|
|
"//internal/configfile",
|
|
"//internal/gitignore",
|
|
"//internal/httpapi/apigen",
|
|
"//internal/httpclient",
|
|
"//internal/httpclient/wire",
|
|
"//internal/storage/backends",
|
|
],
|
|
)
|
|
|
|
go_test(
|
|
name = "http_test",
|
|
# The served e2e cases run ~4-5 min on the farm under
|
|
# BEADS_TEST_EMBEDDED_DOLT=1, past the medium 300s action limit.
|
|
size = "large",
|
|
timeout = "long",
|
|
srcs = [
|
|
"attach_test.go",
|
|
"e2e_blocked_flags_test.go",
|
|
"e2e_blocked_test.go",
|
|
"e2e_cli_test.go",
|
|
"e2e_export_test.go",
|
|
"e2e_gates_test.go",
|
|
"e2e_heartbeat_test.go",
|
|
"e2e_link_test.go",
|
|
"e2e_list_filters_test.go",
|
|
"e2e_list_page_edges_test.go",
|
|
"e2e_mol_test.go",
|
|
"e2e_promote_test.go",
|
|
"e2e_read_your_own_write_test.go",
|
|
"e2e_recompute_blocked_test.go",
|
|
"e2e_remote_roles_test.go",
|
|
"e2e_request_budget_test.go",
|
|
"e2e_search_test.go",
|
|
"e2e_show_current_test.go",
|
|
"e2e_show_single_fetch_test.go",
|
|
"open_test.go",
|
|
"per_open_credential_test.go",
|
|
"register_test.go",
|
|
],
|
|
# The e2e files exec the real bd (bazeltest.PrebuiltBD); they run under
|
|
# BEADS_TEST_EMBEDDED_DOLT=1 and skip otherwise.
|
|
data = ["//cmd/bd:bd_for_tests"],
|
|
env = {"BEADS_TEST_BD_BINARY": "$(rlocationpath //cmd/bd:bd_for_tests)"},
|
|
deps = [
|
|
":http",
|
|
"//backend",
|
|
"//internal/configfile",
|
|
"//internal/httpapi",
|
|
"//internal/httpclient",
|
|
"//internal/storage",
|
|
"//internal/storage/backends",
|
|
"//internal/storage/domain",
|
|
"//internal/storage/embeddeddolt",
|
|
"//internal/storage/issueops",
|
|
"//internal/testutil/bazeltest",
|
|
],
|
|
)
|
|
|
|
# http_test again, with the e2e tier on: BEADS_TEST_EMBEDDED_DOLT=1 starts the
|
|
# in-process server over embedded Dolt and BEADS_HTTP_TEST_REQUIRED=1 turns a
|
|
# skip of that tier into a failure. http_test alone skips the TestE2E_* cases
|
|
# in every lane, because no lane sets those variables for it. It repeats
|
|
# http_test's `env` (go_test_pinned_shard.sh, like go_test_variant.sh, does
|
|
# not inherit it).
|
|
#
|
|
# Shard count: the package's tests are serial, and as one shard the target
|
|
# ran 235-394s on the lane's executors (2026-10-10..13), the embedded lane's
|
|
# longest action in most runs where it executed; the lane's other shards end
|
|
# by ~90-125s. The 19 TestE2E_* cases that take >= 3s are pinned
|
|
# (tools/bazel/go_test_pinned_shard.sh, served_pinned_shards.txt from
|
|
# tools/bazel/pin_shards.py --shards 6 --min-seconds 3) onto 6 shards, and
|
|
# the binary's round-robin runs the other ~28 (well under a second
|
|
# together) in the 7th. The durations are the maximum over two sharded runs
|
|
# of the lane (bazel.yml's bazel-embedded-served-testxml artifact): 11-90s
|
|
# each, ~770s together. The same test's time varied 2-5x between those runs
|
|
# with the executors' load, and sharded runs took up to 2x what the
|
|
# single-shard runs did, so size the pins from sharded runs of the lane,
|
|
# never from a single-shard or local one.
|
|
# Regenerate the manifest from PR runs' bazel-embedded-served-testxml
|
|
# artifacts (each http_served_test directory holds shard_*_of_7/test.xml;
|
|
# pass several runs, pin_shards.py takes each test's maximum):
|
|
# python3 tools/bazel/pin_shards.py --shards 6 --min-seconds 3 \
|
|
# --write backend/http/served_pinned_shards.txt \
|
|
# <run1>/http_served_test <run2>/http_served_test
|
|
#
|
|
# Tags:
|
|
# embedded: the embedded-Dolt tier; excluded from --config=prcore/ci,
|
|
# selected by --config=embedded.
|
|
sh_test(
|
|
name = "http_served_test",
|
|
size = "large",
|
|
# -test.timeout=19m fires (with a goroutine dump) before Bazel's 1200s
|
|
# action limit (eternal under --config=embedded).
|
|
timeout = "eternal",
|
|
srcs = ["//tools/bazel:go_test_pinned_shard.sh"],
|
|
args = [
|
|
"$(rootpath :served_pinned_shards.txt)",
|
|
"$(rootpath :http_test)",
|
|
"-test.v",
|
|
"-test.count=1",
|
|
"-test.timeout=19m",
|
|
],
|
|
data = [
|
|
"served_pinned_shards.txt",
|
|
":http_test",
|
|
"//cmd/bd:bd_for_tests",
|
|
],
|
|
env = {
|
|
"BEADS_HTTP_TEST_REQUIRED": "1",
|
|
"BEADS_TEST_BD_BINARY": "$(rlocationpath //cmd/bd:bd_for_tests)",
|
|
"BEADS_TEST_EMBEDDED_DOLT": "1",
|
|
},
|
|
shard_count = 7,
|
|
tags = ["embedded"],
|
|
)
|
|
|
|
# --- 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 ---
|