From 57ef3645019d7c9872d2451f439e18885a33c67a Mon Sep 17 00:00:00 2001 From: Julian Knutsen Date: Sun, 27 Sep 2026 03:41:02 -0700 Subject: [PATCH] build(bazel): side-by-side Bazel scaffold + policy tests (#6798) * 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) * 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) * 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) * 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) --------- Co-authored-by: Claude Opus 5.5 (1M context) --- .bazelignore | 13 + .bazelrc | 52 + .bazelversion | 1 + .gitignore | 6 + BUILD.bazel | 83 ++ MODULE.bazel | 44 + MODULE.bazel.lock | 798 +++++++++++ Makefile | 10 + backend/BUILD.bazel | 30 + backend/conformance/BUILD.bazel | 90 ++ beadserrors/BUILD.bazel | 8 + cmd/bd/BUILD.bazel | 1191 +++++++++++++++++ cmd/bd/doctor/BUILD.bazel | 164 +++ cmd/bd/doctor/fix/BUILD.bazel | 97 ++ cmd/bd/protocol/BUILD.bazel | 49 + cmd/bd/setup/BUILD.bazel | 56 + format/BUILD.bazel | 19 + internal/ado/BUILD.bazel | 51 + internal/atomicfile/BUILD.bazel | 14 + internal/audit/BUILD.bazel | 21 + internal/beads/BUILD.bazel | 43 + internal/compact/BUILD.bazel | 39 + internal/config/BUILD.bazel | 65 + internal/configfile/BUILD.bazel | 34 + internal/creds/BUILD.bazel | 20 + internal/debug/BUILD.bazel | 14 + internal/doltremote/BUILD.bazel | 8 + internal/doltserver/BUILD.bazel | 83 ++ internal/doltversion/BUILD.bazel | 28 + internal/eventsjournal/BUILD.bazel | 31 + internal/fdhygiene/BUILD.bazel | 90 ++ internal/formula/BUILD.bazel | 47 + internal/formula/cmd/schemagen/BUILD.bazel | 15 + internal/formula/schemagen/BUILD.bazel | 8 + internal/git/BUILD.bazel | 17 + internal/githooksenv/BUILD.bazel | 14 + internal/github/BUILD.bazel | 37 + internal/gitlab/BUILD.bazel | 39 + internal/gittraceenv/BUILD.bazel | 14 + internal/hooks/BUILD.bazel | 215 +++ internal/httpapi/BUILD.bazel | 121 ++ internal/httpapi/apigen/BUILD.bazel | 16 + internal/httpapi/spec/BUILD.bazel | 9 + internal/idgen/BUILD.bazel | 14 + internal/jira/BUILD.bazel | 39 + internal/linear/BUILD.bazel | 64 + internal/lockfile/BUILD.bazel | 61 + internal/memoryapi/BUILD.bazel | 16 + internal/metrics/BUILD.bazel | 36 + internal/migration/BUILD.bazel | 14 + internal/migration/legacysqlite/BUILD.bazel | 27 + internal/molecules/BUILD.bazel | 28 + internal/notion/BUILD.bazel | 36 + internal/procid/BUILD.bazel | 51 + internal/query/BUILD.bazel | 28 + internal/recipes/BUILD.bazel | 22 + internal/remotecache/BUILD.bazel | 30 + internal/routing/BUILD.bazel | 16 + internal/storage/BUILD.bazel | 111 ++ internal/storage/backendnames/BUILD.bazel | 8 + internal/storage/backends/BUILD.bazel | 26 + internal/storage/contextinfo/BUILD.bazel | 18 + internal/storage/dberrors/BUILD.bazel | 22 + internal/storage/dbproxy/identity/BUILD.bazel | 22 + internal/storage/dbproxy/pidfile/BUILD.bazel | 15 + internal/storage/dbproxy/proxy/BUILD.bazel | 85 ++ internal/storage/dbproxy/server/BUILD.bazel | 49 + internal/storage/dbproxy/util/BUILD.bazel | 21 + internal/storage/depid/BUILD.bazel | 15 + internal/storage/dolt/BUILD.bazel | 354 +++++ internal/storage/doltutil/BUILD.bazel | 31 + internal/storage/domain/BUILD.bazel | 51 + internal/storage/domain/db/BUILD.bazel | 121 ++ internal/storage/domain/fs/BUILD.bazel | 40 + internal/storage/domain/git/BUILD.bazel | 25 + internal/storage/embeddeddolt/BUILD.bazel | 233 ++++ internal/storage/embeddeddolt/cmd/BUILD.bazel | 15 + internal/storage/externaldeps/BUILD.bazel | 43 + internal/storage/fs/BUILD.bazel | 12 + internal/storage/git/BUILD.bazel | 12 + internal/storage/issueops/BUILD.bazel | 196 +++ internal/storage/journalscan/BUILD.bazel | 14 + internal/storage/kvkeys/BUILD.bazel | 14 + internal/storage/memoryops/BUILD.bazel | 18 + internal/storage/rowid/BUILD.bazel | 15 + internal/storage/schema/BUILD.bazel | 167 +++ internal/storage/sqlbuild/BUILD.bazel | 35 + internal/storage/storagecontract/BUILD.bazel | 9 + internal/storage/uow/BUILD.bazel | 177 +++ .../storage/versioncontrolops/BUILD.bazel | 53 + internal/telemetry/BUILD.bazel | 82 ++ internal/templates/BUILD.bazel | 12 + internal/templates/agents/BUILD.bazel | 26 + internal/testutil/BUILD.bazel | 114 ++ internal/testutil/fixtures/BUILD.bazel | 12 + internal/timeparsing/BUILD.bazel | 22 + internal/tracker/BUILD.bazel | 60 + internal/tracker/conformance/BUILD.bazel | 28 + internal/types/BUILD.bazel | 24 + internal/ui/BUILD.bazel | 33 + internal/uimd/BUILD.bazel | 21 + internal/utils/BUILD.bazel | 47 + internal/validation/BUILD.bazel | 32 + internal/workapi/BUILD.bazel | 71 + internal/workapi/storecounter/BUILD.bazel | 14 + internal/workapi/storequerier/BUILD.bazel | 13 + internal/workapi/storereader/BUILD.bazel | 25 + .../workapi/storereadycounter/BUILD.bazel | 13 + internal/workapi/storestats/BUILD.bazel | 14 + .../storeversionreconciler/BUILD.bazel | 13 + .../workapi/storeworkspaceconfig/BUILD.bazel | 13 + internal/workspacegate/BUILD.bazel | 15 + internal/worktreeremove/BUILD.bazel | 14 + issueops/BUILD.bazel | 56 + journalops/BUILD.bazel | 12 + memoryops/BUILD.bazel | 13 + plugins/beads/BUILD.bazel | 9 + schema/BUILD.bazel | 15 + scripts/BUILD.bazel | 24 + scripts/bazel_policy_test.go | 498 +++++++ scripts/bench-ready-indexes/BUILD.bazel | 22 + scripts/check-build-tags.sh | 59 + scripts/check_build_tags_test.go | 105 ++ scripts/gitattributespolicy/BUILD.bazel | 10 + scripts/migration-test/catalog/BUILD.bazel | 20 + scripts/prlintmake/BUILD.bazel | 6 + scripts/repro-dolt-hang/BUILD.bazel | 18 + scripts/repro-dolt-prod-timeouts/BUILD.bazel | 32 + test/conformance/BUILD.bazel | 8 + test/docsync/BUILD.bazel | 9 + test/testmainconvention/BUILD.bazel | 6 + third_party/patches/BUILD.bazel | 12 + third_party/patches/dolt_go_serial.patch | 42 + .../patches/eventsapi_schema_build.patch | 120 ++ .../patches/flatbuffers_v23_importpath.patch | 11 + tools/docsmint/BUILD.bazel | 27 + 136 files changed, 8165 insertions(+) create mode 100644 .bazelignore create mode 100644 .bazelrc create mode 100644 .bazelversion create mode 100644 BUILD.bazel create mode 100644 MODULE.bazel create mode 100644 MODULE.bazel.lock create mode 100644 backend/BUILD.bazel create mode 100644 backend/conformance/BUILD.bazel create mode 100644 beadserrors/BUILD.bazel create mode 100644 cmd/bd/BUILD.bazel create mode 100644 cmd/bd/doctor/BUILD.bazel create mode 100644 cmd/bd/doctor/fix/BUILD.bazel create mode 100644 cmd/bd/protocol/BUILD.bazel create mode 100644 cmd/bd/setup/BUILD.bazel create mode 100644 format/BUILD.bazel create mode 100644 internal/ado/BUILD.bazel create mode 100644 internal/atomicfile/BUILD.bazel create mode 100644 internal/audit/BUILD.bazel create mode 100644 internal/beads/BUILD.bazel create mode 100644 internal/compact/BUILD.bazel create mode 100644 internal/config/BUILD.bazel create mode 100644 internal/configfile/BUILD.bazel create mode 100644 internal/creds/BUILD.bazel create mode 100644 internal/debug/BUILD.bazel create mode 100644 internal/doltremote/BUILD.bazel create mode 100644 internal/doltserver/BUILD.bazel create mode 100644 internal/doltversion/BUILD.bazel create mode 100644 internal/eventsjournal/BUILD.bazel create mode 100644 internal/fdhygiene/BUILD.bazel create mode 100644 internal/formula/BUILD.bazel create mode 100644 internal/formula/cmd/schemagen/BUILD.bazel create mode 100644 internal/formula/schemagen/BUILD.bazel create mode 100644 internal/git/BUILD.bazel create mode 100644 internal/githooksenv/BUILD.bazel create mode 100644 internal/github/BUILD.bazel create mode 100644 internal/gitlab/BUILD.bazel create mode 100644 internal/gittraceenv/BUILD.bazel create mode 100644 internal/hooks/BUILD.bazel create mode 100644 internal/httpapi/BUILD.bazel create mode 100644 internal/httpapi/apigen/BUILD.bazel create mode 100644 internal/httpapi/spec/BUILD.bazel create mode 100644 internal/idgen/BUILD.bazel create mode 100644 internal/jira/BUILD.bazel create mode 100644 internal/linear/BUILD.bazel create mode 100644 internal/lockfile/BUILD.bazel create mode 100644 internal/memoryapi/BUILD.bazel create mode 100644 internal/metrics/BUILD.bazel create mode 100644 internal/migration/BUILD.bazel create mode 100644 internal/migration/legacysqlite/BUILD.bazel create mode 100644 internal/molecules/BUILD.bazel create mode 100644 internal/notion/BUILD.bazel create mode 100644 internal/procid/BUILD.bazel create mode 100644 internal/query/BUILD.bazel create mode 100644 internal/recipes/BUILD.bazel create mode 100644 internal/remotecache/BUILD.bazel create mode 100644 internal/routing/BUILD.bazel create mode 100644 internal/storage/BUILD.bazel create mode 100644 internal/storage/backendnames/BUILD.bazel create mode 100644 internal/storage/backends/BUILD.bazel create mode 100644 internal/storage/contextinfo/BUILD.bazel create mode 100644 internal/storage/dberrors/BUILD.bazel create mode 100644 internal/storage/dbproxy/identity/BUILD.bazel create mode 100644 internal/storage/dbproxy/pidfile/BUILD.bazel create mode 100644 internal/storage/dbproxy/proxy/BUILD.bazel create mode 100644 internal/storage/dbproxy/server/BUILD.bazel create mode 100644 internal/storage/dbproxy/util/BUILD.bazel create mode 100644 internal/storage/depid/BUILD.bazel create mode 100644 internal/storage/dolt/BUILD.bazel create mode 100644 internal/storage/doltutil/BUILD.bazel create mode 100644 internal/storage/domain/BUILD.bazel create mode 100644 internal/storage/domain/db/BUILD.bazel create mode 100644 internal/storage/domain/fs/BUILD.bazel create mode 100644 internal/storage/domain/git/BUILD.bazel create mode 100644 internal/storage/embeddeddolt/BUILD.bazel create mode 100644 internal/storage/embeddeddolt/cmd/BUILD.bazel create mode 100644 internal/storage/externaldeps/BUILD.bazel create mode 100644 internal/storage/fs/BUILD.bazel create mode 100644 internal/storage/git/BUILD.bazel create mode 100644 internal/storage/issueops/BUILD.bazel create mode 100644 internal/storage/journalscan/BUILD.bazel create mode 100644 internal/storage/kvkeys/BUILD.bazel create mode 100644 internal/storage/memoryops/BUILD.bazel create mode 100644 internal/storage/rowid/BUILD.bazel create mode 100644 internal/storage/schema/BUILD.bazel create mode 100644 internal/storage/sqlbuild/BUILD.bazel create mode 100644 internal/storage/storagecontract/BUILD.bazel create mode 100644 internal/storage/uow/BUILD.bazel create mode 100644 internal/storage/versioncontrolops/BUILD.bazel create mode 100644 internal/telemetry/BUILD.bazel create mode 100644 internal/templates/BUILD.bazel create mode 100644 internal/templates/agents/BUILD.bazel create mode 100644 internal/testutil/BUILD.bazel create mode 100644 internal/testutil/fixtures/BUILD.bazel create mode 100644 internal/timeparsing/BUILD.bazel create mode 100644 internal/tracker/BUILD.bazel create mode 100644 internal/tracker/conformance/BUILD.bazel create mode 100644 internal/types/BUILD.bazel create mode 100644 internal/ui/BUILD.bazel create mode 100644 internal/uimd/BUILD.bazel create mode 100644 internal/utils/BUILD.bazel create mode 100644 internal/validation/BUILD.bazel create mode 100644 internal/workapi/BUILD.bazel create mode 100644 internal/workapi/storecounter/BUILD.bazel create mode 100644 internal/workapi/storequerier/BUILD.bazel create mode 100644 internal/workapi/storereader/BUILD.bazel create mode 100644 internal/workapi/storereadycounter/BUILD.bazel create mode 100644 internal/workapi/storestats/BUILD.bazel create mode 100644 internal/workapi/storeversionreconciler/BUILD.bazel create mode 100644 internal/workapi/storeworkspaceconfig/BUILD.bazel create mode 100644 internal/workspacegate/BUILD.bazel create mode 100644 internal/worktreeremove/BUILD.bazel create mode 100644 issueops/BUILD.bazel create mode 100644 journalops/BUILD.bazel create mode 100644 memoryops/BUILD.bazel create mode 100644 plugins/beads/BUILD.bazel create mode 100644 schema/BUILD.bazel create mode 100644 scripts/BUILD.bazel create mode 100644 scripts/bazel_policy_test.go create mode 100644 scripts/bench-ready-indexes/BUILD.bazel create mode 100644 scripts/check_build_tags_test.go create mode 100644 scripts/gitattributespolicy/BUILD.bazel create mode 100644 scripts/migration-test/catalog/BUILD.bazel create mode 100644 scripts/prlintmake/BUILD.bazel create mode 100644 scripts/repro-dolt-hang/BUILD.bazel create mode 100644 scripts/repro-dolt-prod-timeouts/BUILD.bazel create mode 100644 test/conformance/BUILD.bazel create mode 100644 test/docsync/BUILD.bazel create mode 100644 test/testmainconvention/BUILD.bazel create mode 100644 third_party/patches/BUILD.bazel create mode 100644 third_party/patches/dolt_go_serial.patch create mode 100644 third_party/patches/eventsapi_schema_build.patch create mode 100644 third_party/patches/flatbuffers_v23_importpath.patch create mode 100644 tools/docsmint/BUILD.bazel diff --git a/.bazelignore b/.bazelignore new file mode 100644 index 000000000..9ab1ce255 --- /dev/null +++ b/.bazelignore @@ -0,0 +1,13 @@ +examples/library-usage +examples/bd-example-extension-go +integrations +npm-package +website +node_modules +.claude +.worktrees +.beads +.dolt +dist +.runtime +tmp diff --git a/.bazelrc b/.bazelrc new file mode 100644 index 000000000..1344a57fe --- /dev/null +++ b/.bazelrc @@ -0,0 +1,52 @@ +# Bazel configuration for beads (side-by-side with the Go toolchain; `go build` +# and `go test` are unaffected). Bzlmod only; Bazel version is pinned in +# .bazelversion. +common --enable_bzlmod +common --color=no + +# ICU policy (engdocs/ICU-POLICY.md): build go-mysql-server with its pure-Go +# regex backend so no target links libicu. MODULE.bazel carries the matching +# gazelle_override for github.com/dolthub/go-mysql-server. +build --@rules_go//go/config:tags=gms_pure_go + +# Keep the client PATH/env out of action keys. +build --incompatible_strict_action_env + +test --test_output=errors +# Bazel roots t.TempDir() deep under the output tree, which overflows the +# 104-byte unix-socket sun_path limit. Root the per-test tmpdir short. +# TODO: /tmp/bbt is shared by every checkout and user on a host (the per-target +# subdirectory is keyed only by target), so concurrent runs can collide and a +# second user can hit EACCES. Replace with a per-run path before CI relies on it. +test --test_tmpdir=/tmp/bbt +test --sandbox_writable_path=/tmp/bbt +# Test actions do not inherit HOME by default; CI overrides with a scratch HOME. +test --test_env=HOME +test --test_env=BD_DISABLE_METRICS=1 +test --test_env=BD_DISABLE_EVENT_FLUSH=1 +test --test_env=BEADS_TEST_IGNORE_REPO_CONFIG=1 +test --test_env=GIT_CONFIG_NOSYSTEM=1 + +# PR-core parity: the same test *selection* as scripts/ci/pr-core.sh (race, +# -short, skips, tag filters). The test environment is not yet isolated the way +# pr-core's is (HOME, git/XDG/Dolt config); that is follow-up work. +test:prcore --@rules_go//go/config:race +test:prcore --test_arg=-test.short +test:prcore --test_arg=-test.skip=^TestEmbedded +test:prcore --test_env=BEADS_TEST_SKIP=dolt +test:prcore --test_tag_filters=-requires-docker,-embedded,-manual + +test:ci --config=prcore +test:ci --keep_going --test_summary=terse + +# Remote execution against any REAPI-compatible service. Only generic tuning +# lives here; the executor endpoint and TLS credentials are never committed. +# Developers put them in a gitignored user.bazelrc or .bazelrc.local; CI writes +# a generated rc outside the workspace and passes it with --bazelrc. +build:remote-exec --jobs=64 +build:remote-exec --remote_download_minimal +build:remote-exec --remote_timeout=600 +build:remote-exec --remote_retries=3 + +try-import %workspace%/.bazelrc.local +try-import %workspace%/user.bazelrc diff --git a/.bazelversion b/.bazelversion new file mode 100644 index 000000000..deeb3d66e --- /dev/null +++ b/.bazelversion @@ -0,0 +1 @@ +9.2.0 diff --git a/.gitignore b/.gitignore index c5d2e31b2..a4c9b2468 100644 --- a/.gitignore +++ b/.gitignore @@ -255,3 +255,9 @@ tmp/build/cli-docs/where.md tmp/build/cli-docs/worktree.md tmp/docs/CLI_REFERENCE.md *.gate.lock* + +# Bazel: output symlinks and machine-local rc files (remote executor endpoint, +# TLS credentials). Never commit these. +/bazel-* +/.bazelrc.local +/user.bazelrc diff --git a/BUILD.bazel b/BUILD.bazel new file mode 100644 index 000000000..deb4928ae --- /dev/null +++ b/BUILD.bazel @@ -0,0 +1,83 @@ +load("@gazelle//:def.bzl", "gazelle") +load("@rules_go//go:def.bzl", "go_library", "go_test") + +# gazelle:prefix github.com/steveyegge/beads +# gazelle:build_tags gms_pure_go +gazelle(name = "gazelle") + +exports_files([ + "go.mod", + "go.sum", +]) + +# Inputs of the Bazel policy tests in //scripts (bazel_policy_test.go), so they +# run under `bazel test` as well as `go test`. +filegroup( + name = "bazel_policy_files", + srcs = [ + ".bazelrc", + ".bazelversion", + ".gitignore", + "BUILD.bazel", + "MODULE.bazel", + "go.mod", + ], + visibility = ["//scripts:__pkg__"], +) + +go_library( + name = "beads", + srcs = [ + "beads.go", + "beads_cgo.go", + "beads_nocgo.go", + "claim.go", + ], + importpath = "github.com/steveyegge/beads", + visibility = ["//visibility:public"], + deps = [ + "//internal/beads", + "//internal/configfile", + "//internal/doltserver", + "//internal/storage", + "//internal/storage/backends", + "//internal/storage/dolt", + "//internal/storage/domain", + "//internal/storage/embeddeddolt", + "//internal/storage/schema", + "//internal/types", + "//internal/workspacegate", + ], +) + +go_test( + name = "beads_test", + srcs = [ + "beads_gated_test.go", + "beads_test.go", + "claim_roundtrip_test.go", + "claim_test.go", + "errors_test.go", + "export_dependency_add_options_test.go", + "issue_lifecycle_external_test.go", + "issue_roles_external_test.go", + "open_backend_selection_test.go", + "open_nocgo_test.go", + "query_interfaces_cgo_test.go", + "query_interfaces_test.go", + ], + embed = [":beads"], + deps = [ + "//internal/hooks", + "//internal/storage", + "//internal/storage/backends", + "//internal/storage/dolt", + "//internal/storage/domain", + "//internal/storage/embeddeddolt", + "//internal/telemetry", + "//internal/testutil", + "//internal/types", + "//internal/workspacegate", + "//issueops", + ], +) diff --git a/MODULE.bazel b/MODULE.bazel new file mode 100644 index 000000000..07024e105 --- /dev/null +++ b/MODULE.bazel @@ -0,0 +1,44 @@ +module( + name = "beads", + version = "0.0.0", +) + +bazel_dep(name = "rules_go", version = "0.63.0") +bazel_dep(name = "gazelle", version = "0.53.0") + +go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk") +go_sdk.download( + name = "go_sdk", + version = "1.26.7", +) +use_repo(go_sdk, "go_sdk") + +go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps") +go_deps.from_file(go_mod = "//:go.mod") + +# beads builds go-mysql-server with its stdlib-regex backend (ICU policy): +# gazelle must see gms_pure_go as satisfied so it selects regex_pure.go and +# drops the go-icu-regex (libicu, cgo) edge entirely. +go_deps.gazelle_override( + directives = [ + "gazelle:build_tags gms_pure_go", + "gazelle:exclude internal/regex/regex_cgo.go", + ], + path = "github.com/dolthub/go-mysql-server", +) +go_deps.module_override( + patch_strip = 1, + patches = ["//third_party/patches:eventsapi_schema_build.patch"], + path = "github.com/dolthub/eventsapi_schema", +) +go_deps.module_override( + patch_strip = 1, + patches = ["//third_party/patches:flatbuffers_v23_importpath.patch"], + path = "github.com/dolthub/flatbuffers/v23", +) +go_deps.module_override( + patch_strip = 1, + patches = ["//third_party/patches:dolt_go_serial.patch"], + path = "github.com/dolthub/dolt/go", +) +use_repo(go_deps, "com_github_anthropics_anthropic_sdk_go", "com_github_burntsushi_toml", "com_github_cenkalti_backoff_v4", "com_github_charmbracelet_x_ansi", "com_github_data_dog_go_sqlmock", "com_github_dolthub_dolt_go", "com_github_dolthub_driver_v2", "com_github_dolthub_eventkit", "com_github_dolthub_go_mysql_server", "com_github_go_sql_driver_mysql", "com_github_google_uuid", "com_github_gowebpki_jcs", "com_github_invopop_jsonschema", "com_github_johanneskaufmann_html_to_markdown_v2", "com_github_mattn_go_sqlite3", "com_github_microcosm_cc_bluemonday", "com_github_oapi_codegen_oapi_codegen_v2", "com_github_olebedev_when", "com_github_spf13_cobra", "com_github_spf13_pflag", "com_github_spf13_viper", "com_github_stretchr_testify", "com_github_subosito_gotenv", "com_github_testcontainers_testcontainers_go", "com_github_testcontainers_testcontainers_go_modules_dolt", "com_github_yuin_goldmark", "in_gopkg_yaml_v3", "io_opentelemetry_go_otel", "io_opentelemetry_go_otel_exporters_otlp_otlpmetric_otlpmetrichttp", "io_opentelemetry_go_otel_exporters_stdout_stdoutmetric", "io_opentelemetry_go_otel_exporters_stdout_stdouttrace", "io_opentelemetry_go_otel_metric", "io_opentelemetry_go_otel_sdk", "io_opentelemetry_go_otel_sdk_metric", "io_opentelemetry_go_otel_trace", "io_rsc_script", "land_charm_glamour_v2", "land_charm_huh_v2", "land_charm_lipgloss_v2", "org_golang_x_mod", "org_golang_x_net", "org_golang_x_sync", "org_golang_x_sys", "org_golang_x_term") diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock new file mode 100644 index 000000000..4f5bca374 --- /dev/null +++ b/MODULE.bazel.lock @@ -0,0 +1,798 @@ +{ + "lockFileVersion": 28, + "registryFileHashes": { + "https://bcr.bazel.build/bazel_registry.json": "8a28e4aff06ee60aed2a8c281907fb8bcbf3b753c91fb5a5c57da3215d5b3497", + "https://bcr.bazel.build/modules/abseil-cpp/20210324.2/MODULE.bazel": "7cd0312e064fde87c8d1cd79ba06c876bd23630c83466e9500321be55c96ace2", + "https://bcr.bazel.build/modules/abseil-cpp/20211102.0/MODULE.bazel": "70390338f7a5106231d20620712f7cccb659cd0e9d073d1991c038eb9fc57589", + "https://bcr.bazel.build/modules/abseil-cpp/20230125.1/MODULE.bazel": "89047429cb0207707b2dface14ba7f8df85273d484c2572755be4bab7ce9c3a0", + "https://bcr.bazel.build/modules/abseil-cpp/20230802.0.bcr.1/MODULE.bazel": "1c8cec495288dccd14fdae6e3f95f772c1c91857047a098fad772034264cc8cb", + "https://bcr.bazel.build/modules/abseil-cpp/20230802.0/MODULE.bazel": "d253ae36a8bd9ee3c5955384096ccb6baf16a1b1e93e858370da0a3b94f77c16", + "https://bcr.bazel.build/modules/abseil-cpp/20230802.1/MODULE.bazel": "fa92e2eb41a04df73cdabeec37107316f7e5272650f81d6cc096418fe647b915", + "https://bcr.bazel.build/modules/abseil-cpp/20240116.1/MODULE.bazel": "37bcdb4440fbb61df6a1c296ae01b327f19e9bb521f9b8e26ec854b6f97309ed", + "https://bcr.bazel.build/modules/abseil-cpp/20240116.2/MODULE.bazel": "73939767a4686cd9a520d16af5ab440071ed75cec1a876bf2fcfaf1f71987a16", + "https://bcr.bazel.build/modules/abseil-cpp/20250127.1/MODULE.bazel": "c4a89e7ceb9bf1e25cf84a9f830ff6b817b72874088bf5141b314726e46a57c1", + "https://bcr.bazel.build/modules/abseil-cpp/20250512.1/MODULE.bazel": "d209fdb6f36ffaf61c509fcc81b19e81b411a999a934a032e10cd009a0226215", + "https://bcr.bazel.build/modules/abseil-cpp/20250814.1/MODULE.bazel": "51f2312901470cdab0dbdf3b88c40cd21c62a7ed58a3de45b365ddc5b11bcab2", + "https://bcr.bazel.build/modules/abseil-cpp/20250814.1/source.json": "cea3901d7e299da7320700abbaafe57a65d039f10d0d7ea601c4a66938ea4b0c", + "https://bcr.bazel.build/modules/apple_support/1.11.1/MODULE.bazel": "1843d7cd8a58369a444fc6000e7304425fba600ff641592161d9f15b179fb896", + "https://bcr.bazel.build/modules/apple_support/1.15.1/MODULE.bazel": "a0556fefca0b1bb2de8567b8827518f94db6a6e7e7d632b4c48dc5f865bc7c85", + "https://bcr.bazel.build/modules/apple_support/1.21.0/MODULE.bazel": "ac1824ed5edf17dee2fdd4927ada30c9f8c3b520be1b5fd02a5da15bc10bff3e", + "https://bcr.bazel.build/modules/apple_support/1.21.1/MODULE.bazel": "5809fa3efab15d1f3c3c635af6974044bac8a4919c62238cce06acee8a8c11f1", + "https://bcr.bazel.build/modules/apple_support/1.24.2/MODULE.bazel": "0e62471818affb9f0b26f128831d5c40b074d32e6dda5a0d3852847215a41ca4", + "https://bcr.bazel.build/modules/apple_support/1.24.2/source.json": "2c22c9827093250406c5568da6c54e6fdf0ef06238def3d99c71b12feb057a8d", + "https://bcr.bazel.build/modules/bazel_features/1.1.0/MODULE.bazel": "cfd42ff3b815a5f39554d97182657f8c4b9719568eb7fded2b9135f084bf760b", + "https://bcr.bazel.build/modules/bazel_features/1.1.1/MODULE.bazel": "27b8c79ef57efe08efccbd9dd6ef70d61b4798320b8d3c134fd571f78963dbcd", + "https://bcr.bazel.build/modules/bazel_features/1.10.0/MODULE.bazel": "f75e8807570484a99be90abcd52b5e1f390362c258bcb73106f4544957a48101", + "https://bcr.bazel.build/modules/bazel_features/1.11.0/MODULE.bazel": "f9382337dd5a474c3b7d334c2f83e50b6eaedc284253334cf823044a26de03e8", + "https://bcr.bazel.build/modules/bazel_features/1.15.0/MODULE.bazel": "d38ff6e517149dc509406aca0db3ad1efdd890a85e049585b7234d04238e2a4d", + "https://bcr.bazel.build/modules/bazel_features/1.17.0/MODULE.bazel": "039de32d21b816b47bd42c778e0454217e9c9caac4a3cf8e15c7231ee3ddee4d", + "https://bcr.bazel.build/modules/bazel_features/1.18.0/MODULE.bazel": "1be0ae2557ab3a72a57aeb31b29be347bcdc5d2b1eb1e70f39e3851a7e97041a", + "https://bcr.bazel.build/modules/bazel_features/1.19.0/MODULE.bazel": "59adcdf28230d220f0067b1f435b8537dd033bfff8db21335ef9217919c7fb58", + "https://bcr.bazel.build/modules/bazel_features/1.21.0/MODULE.bazel": "675642261665d8eea09989aa3b8afb5c37627f1be178382c320d1b46afba5e3b", + "https://bcr.bazel.build/modules/bazel_features/1.23.0/MODULE.bazel": "fd1ac84bc4e97a5a0816b7fd7d4d4f6d837b0047cf4cbd81652d616af3a6591a", + "https://bcr.bazel.build/modules/bazel_features/1.27.0/MODULE.bazel": "621eeee06c4458a9121d1f104efb80f39d34deff4984e778359c60eaf1a8cb65", + "https://bcr.bazel.build/modules/bazel_features/1.28.0/MODULE.bazel": "4b4200e6cbf8fa335b2c3f43e1d6ef3e240319c33d43d60cc0fbd4b87ece299d", + "https://bcr.bazel.build/modules/bazel_features/1.3.0/MODULE.bazel": "cdcafe83ec318cda34e02948e81d790aab8df7a929cec6f6969f13a489ccecd9", + "https://bcr.bazel.build/modules/bazel_features/1.30.0/MODULE.bazel": "a14b62d05969a293b80257e72e597c2da7f717e1e69fa8b339703ed6731bec87", + "https://bcr.bazel.build/modules/bazel_features/1.33.0/MODULE.bazel": "8b8dc9d2a4c88609409c3191165bccec0e4cb044cd7a72ccbe826583303459f6", + "https://bcr.bazel.build/modules/bazel_features/1.36.0/MODULE.bazel": "596cb62090b039caf1cad1d52a8bc35cf188ca9a4e279a828005e7ee49a1bec3", + "https://bcr.bazel.build/modules/bazel_features/1.4.1/MODULE.bazel": "e45b6bb2350aff3e442ae1111c555e27eac1d915e77775f6fdc4b351b758b5d7", + "https://bcr.bazel.build/modules/bazel_features/1.42.1/MODULE.bazel": "275a59b5406ff18c01739860aa70ad7ccb3cfb474579411decca11c93b951080", + "https://bcr.bazel.build/modules/bazel_features/1.42.1/source.json": "fcd4396b2df85f64f2b3bb436ad870793ecf39180f1d796f913cc9276d355309", + "https://bcr.bazel.build/modules/bazel_features/1.9.1/MODULE.bazel": "8f679097876a9b609ad1f60249c49d68bfab783dd9be012faf9d82547b14815a", + "https://bcr.bazel.build/modules/bazel_skylib/1.0.3/MODULE.bazel": "bcb0fd896384802d1ad283b4e4eb4d718eebd8cb820b0a2c3a347fb971afd9d8", + "https://bcr.bazel.build/modules/bazel_skylib/1.1.1/MODULE.bazel": "1add3e7d93ff2e6998f9e118022c84d163917d912f5afafb3058e3d2f1545b5e", + "https://bcr.bazel.build/modules/bazel_skylib/1.2.0/MODULE.bazel": "44fe84260e454ed94ad326352a698422dbe372b21a1ac9f3eab76eb531223686", + "https://bcr.bazel.build/modules/bazel_skylib/1.2.1/MODULE.bazel": "f35baf9da0efe45fa3da1696ae906eea3d615ad41e2e3def4aeb4e8bc0ef9a7a", + "https://bcr.bazel.build/modules/bazel_skylib/1.3.0/MODULE.bazel": "20228b92868bf5cfc41bda7afc8a8ba2a543201851de39d990ec957b513579c5", + "https://bcr.bazel.build/modules/bazel_skylib/1.4.1/MODULE.bazel": "a0dcb779424be33100dcae821e9e27e4f2901d9dfd5333efe5ac6a8d7ab75e1d", + "https://bcr.bazel.build/modules/bazel_skylib/1.4.2/MODULE.bazel": "3bd40978e7a1fac911d5989e6b09d8f64921865a45822d8b09e815eaa726a651", + "https://bcr.bazel.build/modules/bazel_skylib/1.5.0/MODULE.bazel": "32880f5e2945ce6a03d1fbd588e9198c0a959bb42297b2cfaf1685b7bc32e138", + "https://bcr.bazel.build/modules/bazel_skylib/1.6.1/MODULE.bazel": "8fdee2dbaace6c252131c00e1de4b165dc65af02ea278476187765e1a617b917", + "https://bcr.bazel.build/modules/bazel_skylib/1.7.0/MODULE.bazel": "0db596f4563de7938de764cc8deeabec291f55e8ec15299718b93c4423e9796d", + "https://bcr.bazel.build/modules/bazel_skylib/1.7.1/MODULE.bazel": "3120d80c5861aa616222ec015332e5f8d3171e062e3e804a2a0253e1be26e59b", + "https://bcr.bazel.build/modules/bazel_skylib/1.8.1/MODULE.bazel": "88ade7293becda963e0e3ea33e7d54d3425127e0a326e0d17da085a5f1f03ff6", + "https://bcr.bazel.build/modules/bazel_skylib/1.8.2/MODULE.bazel": "69ad6927098316848b34a9142bcc975e018ba27f08c4ff403f50c1b6e646ca67", + "https://bcr.bazel.build/modules/bazel_skylib/1.8.2/source.json": "34a3c8bcf233b835eb74be9d628899bb32999d3e0eadef1947a0a562a2b16ffb", + "https://bcr.bazel.build/modules/buildozer/8.5.1/MODULE.bazel": "a35d9561b3fc5b18797c330793e99e3b834a473d5fbd3d7d7634aafc9bdb6f8f", + "https://bcr.bazel.build/modules/buildozer/8.5.1/source.json": "e3386e6ff4529f2442800dee47ad28d3e6487f36a1f75ae39ae56c70f0cd2fbd", + "https://bcr.bazel.build/modules/gazelle/0.32.0/MODULE.bazel": "b499f58a5d0d3537f3cf5b76d8ada18242f64ec474d8391247438bf04f58c7b8", + "https://bcr.bazel.build/modules/gazelle/0.33.0/MODULE.bazel": "a13a0f279b462b784fb8dd52a4074526c4a2afe70e114c7d09066097a46b3350", + "https://bcr.bazel.build/modules/gazelle/0.34.0/MODULE.bazel": "abdd8ce4d70978933209db92e436deb3a8b737859e9354fb5fd11fb5c2004c8a", + "https://bcr.bazel.build/modules/gazelle/0.36.0/MODULE.bazel": "e375d5d6e9a6ca59b0cb38b0540bc9a05b6aa926d322f2de268ad267a2ee74c0", + "https://bcr.bazel.build/modules/gazelle/0.51.3/MODULE.bazel": "618a729142f66de1e2cb776d026413763be5b80d5e3d29ffb9d3d90c5defde90", + "https://bcr.bazel.build/modules/gazelle/0.53.0/MODULE.bazel": "76158efbaf12e35ae17af02f4a715bc6e7b3b410c693d34f422922ff4a56a925", + "https://bcr.bazel.build/modules/gazelle/0.53.0/source.json": "1f5a4dd0399e5a20e0daeaa3ba1f42391a1b909bc3d337f7a62d3216ddbdfad0", + "https://bcr.bazel.build/modules/google_benchmark/1.8.2/MODULE.bazel": "a70cf1bba851000ba93b58ae2f6d76490a9feb74192e57ab8e8ff13c34ec50cb", + "https://bcr.bazel.build/modules/googletest/1.11.0/MODULE.bazel": "3a83f095183f66345ca86aa13c58b59f9f94a2f81999c093d4eeaa2d262d12f4", + "https://bcr.bazel.build/modules/googletest/1.14.0.bcr.1/MODULE.bazel": "22c31a561553727960057361aa33bf20fb2e98584bc4fec007906e27053f80c6", + "https://bcr.bazel.build/modules/googletest/1.14.0/MODULE.bazel": "cfbcbf3e6eac06ef9d85900f64424708cc08687d1b527f0ef65aa7517af8118f", + "https://bcr.bazel.build/modules/googletest/1.15.2/MODULE.bazel": "6de1edc1d26cafb0ea1a6ab3f4d4192d91a312fd2d360b63adaa213cd00b2108", + "https://bcr.bazel.build/modules/googletest/1.17.0/MODULE.bazel": "dbec758171594a705933a29fcf69293d2468c49ec1f2ebca65c36f504d72df46", + "https://bcr.bazel.build/modules/googletest/1.17.0/source.json": "38e4454b25fc30f15439c0378e57909ab1fd0a443158aa35aec685da727cd713", + "https://bcr.bazel.build/modules/jsoncpp/1.9.5/MODULE.bazel": "31271aedc59e815656f5736f282bb7509a97c7ecb43e927ac1a37966e0578075", + "https://bcr.bazel.build/modules/jsoncpp/1.9.6/MODULE.bazel": "2f8d20d3b7d54143213c4dfc3d98225c42de7d666011528dc8fe91591e2e17b0", + "https://bcr.bazel.build/modules/jsoncpp/1.9.6/source.json": "a04756d367a2126c3541682864ecec52f92cdee80a35735a3cb249ce015ca000", + "https://bcr.bazel.build/modules/libpfm/4.11.0/MODULE.bazel": "45061ff025b301940f1e30d2c16bea596c25b176c8b6b3087e92615adbd52902", + "https://bcr.bazel.build/modules/nlohmann_json/3.6.1/MODULE.bazel": "6f7b417dcc794d9add9e556673ad25cb3ba835224290f4f848f8e2db1e1fca74", + "https://bcr.bazel.build/modules/nlohmann_json/3.6.1/source.json": "f448c6e8963fdfa7eb831457df83ad63d3d6355018f6574fb017e8169deb43a9", + "https://bcr.bazel.build/modules/package_metadata/0.0.3/MODULE.bazel": "77890552ecea9e284b5424c9de827a58099348763a4359e975c359a83d4faa83", + "https://bcr.bazel.build/modules/package_metadata/0.0.5/MODULE.bazel": "ef4f9439e3270fdd6b9fd4dbc3d2f29d13888e44c529a1b243f7a31dfbc2e8e4", + "https://bcr.bazel.build/modules/package_metadata/0.0.5/source.json": "2326db2f6592578177751c3e1f74786b79382cd6008834c9d01ec865b9126a85", + "https://bcr.bazel.build/modules/platforms/0.0.10/MODULE.bazel": "8cb8efaf200bdeb2150d93e162c40f388529a25852b332cec879373771e48ed5", + "https://bcr.bazel.build/modules/platforms/0.0.11/MODULE.bazel": "0daefc49732e227caa8bfa834d65dc52e8cc18a2faf80df25e8caea151a9413f", + "https://bcr.bazel.build/modules/platforms/0.0.4/MODULE.bazel": "9b328e31ee156f53f3c416a64f8491f7eb731742655a47c9eec4703a71644aee", + "https://bcr.bazel.build/modules/platforms/0.0.5/MODULE.bazel": "5733b54ea419d5eaf7997054bb55f6a1d0b5ff8aedf0176fef9eea44f3acda37", + "https://bcr.bazel.build/modules/platforms/0.0.6/MODULE.bazel": "ad6eeef431dc52aefd2d77ed20a4b353f8ebf0f4ecdd26a807d2da5aa8cd0615", + "https://bcr.bazel.build/modules/platforms/0.0.7/MODULE.bazel": "72fd4a0ede9ee5c021f6a8dd92b503e089f46c227ba2813ff183b71616034814", + "https://bcr.bazel.build/modules/platforms/0.0.8/MODULE.bazel": "9f142c03e348f6d263719f5074b21ef3adf0b139ee4c5133e2aa35664da9eb2d", + "https://bcr.bazel.build/modules/platforms/0.0.9/MODULE.bazel": "4a87a60c927b56ddd67db50c89acaa62f4ce2a1d2149ccb63ffd871d5ce29ebc", + "https://bcr.bazel.build/modules/platforms/1.0.0/MODULE.bazel": "f05feb42b48f1b3c225e4ccf351f367be0371411a803198ec34a389fb22aa580", + "https://bcr.bazel.build/modules/platforms/1.1.0/MODULE.bazel": "1c0c09f5bdcf4b3f924720d2478a3711cb39f4977019ca5988685e5b7e18b3d2", + "https://bcr.bazel.build/modules/platforms/1.1.0/source.json": "fcf351c47596c939140ab0d333dfdd08ed1ea6ce33c2fe70c12493a301cf1344", + "https://bcr.bazel.build/modules/protobuf/21.7/MODULE.bazel": "a5a29bb89544f9b97edce05642fac225a808b5b7be74038ea3640fae2f8e66a7", + "https://bcr.bazel.build/modules/protobuf/27.0/MODULE.bazel": "7873b60be88844a0a1d8f80b9d5d20cfbd8495a689b8763e76c6372998d3f64c", + "https://bcr.bazel.build/modules/protobuf/27.1/MODULE.bazel": "703a7b614728bb06647f965264967a8ef1c39e09e8f167b3ca0bb1fd80449c0d", + "https://bcr.bazel.build/modules/protobuf/29.0-rc2.bcr.1/MODULE.bazel": "52f4126f63a2f0bbf36b99c2a87648f08467a4eaf92ba726bc7d6a500bbf770c", + "https://bcr.bazel.build/modules/protobuf/29.0-rc2/MODULE.bazel": "6241d35983510143049943fc0d57937937122baf1b287862f9dc8590fc4c37df", + "https://bcr.bazel.build/modules/protobuf/29.0-rc3/MODULE.bazel": "33c2dfa286578573afc55a7acaea3cada4122b9631007c594bf0729f41c8de92", + "https://bcr.bazel.build/modules/protobuf/29.0/MODULE.bazel": "319dc8bf4c679ff87e71b1ccfb5a6e90a6dbc4693501d471f48662ac46d04e4e", + "https://bcr.bazel.build/modules/protobuf/29.1/MODULE.bazel": "557c3457560ff49e122ed76c0bc3397a64af9574691cb8201b4e46d4ab2ecb95", + "https://bcr.bazel.build/modules/protobuf/3.19.0/MODULE.bazel": "6b5fbb433f760a99a22b18b6850ed5784ef0e9928a72668b66e4d7ccd47db9b0", + "https://bcr.bazel.build/modules/protobuf/3.19.2/MODULE.bazel": "532ffe5f2186b69fdde039efe6df13ba726ff338c6bc82275ad433013fa10573", + "https://bcr.bazel.build/modules/protobuf/3.19.6/MODULE.bazel": "9233edc5e1f2ee276a60de3eaa47ac4132302ef9643238f23128fea53ea12858", + "https://bcr.bazel.build/modules/protobuf/32.1/MODULE.bazel": "89cd2866a9cb07fee9ff74c41ceace11554f32e0d849de4e23ac55515cfada4d", + "https://bcr.bazel.build/modules/protobuf/33.4/MODULE.bazel": "114775b816b38b6d0ca620450d6b02550c60ceedfdc8d9a229833b34a223dc42", + "https://bcr.bazel.build/modules/protobuf/33.4/source.json": "555f8686b4c7d6b5ba731fbea13bf656b4bfd9a7ff629c1d9d3f6e1d6155de79", + "https://bcr.bazel.build/modules/pybind11_bazel/2.11.1/MODULE.bazel": "88af1c246226d87e65be78ed49ecd1e6f5e98648558c14ce99176da041dc378e", + "https://bcr.bazel.build/modules/pybind11_bazel/2.12.0/MODULE.bazel": "e6f4c20442eaa7c90d7190d8dc539d0ab422f95c65a57cc59562170c58ae3d34", + "https://bcr.bazel.build/modules/pybind11_bazel/2.12.0/source.json": "6900fdc8a9e95866b8c0d4ad4aba4d4236317b5c1cd04c502df3f0d33afed680", + "https://bcr.bazel.build/modules/re2/2023-09-01/MODULE.bazel": "cb3d511531b16cfc78a225a9e2136007a48cf8a677e4264baeab57fe78a80206", + "https://bcr.bazel.build/modules/re2/2024-07-02.bcr.1/MODULE.bazel": "b4963dda9b31080be1905ef085ecd7dd6cd47c05c79b9cdf83ade83ab2ab271a", + "https://bcr.bazel.build/modules/re2/2024-07-02.bcr.1/source.json": "2ff292be6ef3340325ce8a045ecc326e92cbfab47c7cbab4bd85d28971b97ac4", + "https://bcr.bazel.build/modules/re2/2024-07-02/MODULE.bazel": "0eadc4395959969297cbcf31a249ff457f2f1d456228c67719480205aa306daa", + "https://bcr.bazel.build/modules/rules_android/0.1.1/MODULE.bazel": "48809ab0091b07ad0182defb787c4c5328bd3a278938415c00a7b69b50c4d3a8", + "https://bcr.bazel.build/modules/rules_android/0.1.1/source.json": "e6986b41626ee10bdc864937ffb6d6bf275bb5b9c65120e6137d56e6331f089e", + "https://bcr.bazel.build/modules/rules_apple/3.16.0/MODULE.bazel": "0d1caf0b8375942ce98ea944be754a18874041e4e0459401d925577624d3a54a", + "https://bcr.bazel.build/modules/rules_apple/4.1.0/MODULE.bazel": "76e10fd4a48038d3fc7c5dc6e63b7063bbf5304a2e3bd42edda6ec660eebea68", + "https://bcr.bazel.build/modules/rules_apple/4.1.0/source.json": "8ee81e1708756f81b343a5eb2b2f0b953f1d25c4ab3d4a68dc02754872e80715", + "https://bcr.bazel.build/modules/rules_cc/0.0.1/MODULE.bazel": "cb2aa0747f84c6c3a78dad4e2049c154f08ab9d166b1273835a8174940365647", + "https://bcr.bazel.build/modules/rules_cc/0.0.10/MODULE.bazel": "ec1705118f7eaedd6e118508d3d26deba2a4e76476ada7e0e3965211be012002", + "https://bcr.bazel.build/modules/rules_cc/0.0.13/MODULE.bazel": "0e8529ed7b323dad0775ff924d2ae5af7640b23553dfcd4d34344c7e7a867191", + "https://bcr.bazel.build/modules/rules_cc/0.0.15/MODULE.bazel": "6704c35f7b4a72502ee81f61bf88706b54f06b3cbe5558ac17e2e14666cd5dcc", + "https://bcr.bazel.build/modules/rules_cc/0.0.16/MODULE.bazel": "7661303b8fc1b4d7f532e54e9d6565771fea666fbdf839e0a86affcd02defe87", + "https://bcr.bazel.build/modules/rules_cc/0.0.17/MODULE.bazel": "2ae1d8f4238ec67d7185d8861cb0a2cdf4bc608697c331b95bf990e69b62e64a", + "https://bcr.bazel.build/modules/rules_cc/0.0.2/MODULE.bazel": "6915987c90970493ab97393024c156ea8fb9f3bea953b2f3ec05c34f19b5695c", + "https://bcr.bazel.build/modules/rules_cc/0.0.6/MODULE.bazel": "abf360251023dfe3efcef65ab9d56beefa8394d4176dd29529750e1c57eaa33f", + "https://bcr.bazel.build/modules/rules_cc/0.0.8/MODULE.bazel": "964c85c82cfeb6f3855e6a07054fdb159aced38e99a5eecf7bce9d53990afa3e", + "https://bcr.bazel.build/modules/rules_cc/0.0.9/MODULE.bazel": "836e76439f354b89afe6a911a7adf59a6b2518fafb174483ad78a2a2fde7b1c5", + "https://bcr.bazel.build/modules/rules_cc/0.1.1/MODULE.bazel": "2f0222a6f229f0bf44cd711dc13c858dad98c62d52bd51d8fc3a764a83125513", + "https://bcr.bazel.build/modules/rules_cc/0.1.2/MODULE.bazel": "557ddc3a96858ec0d465a87c0a931054d7dcfd6583af2c7ed3baf494407fd8d0", + "https://bcr.bazel.build/modules/rules_cc/0.1.5/MODULE.bazel": "88dfc9361e8b5ae1008ac38f7cdfd45ad738e4fa676a3ad67d19204f045a1fd8", + "https://bcr.bazel.build/modules/rules_cc/0.2.0/MODULE.bazel": "b5c17f90458caae90d2ccd114c81970062946f49f355610ed89bebf954f5783c", + "https://bcr.bazel.build/modules/rules_cc/0.2.13/MODULE.bazel": "eecdd666eda6be16a8d9dc15e44b5c75133405e820f620a234acc4b1fdc5aa37", + "https://bcr.bazel.build/modules/rules_cc/0.2.17/MODULE.bazel": "1849602c86cb60da8613d2de887f9566a6d354a6df6d7009f9d04a14402f9a84", + "https://bcr.bazel.build/modules/rules_cc/0.2.17/source.json": "3832f45d145354049137c0090df04629d9c2b5493dc5c2bf46f1834040133a07", + "https://bcr.bazel.build/modules/rules_cc/0.2.8/MODULE.bazel": "f1df20f0bf22c28192a794f29b501ee2018fa37a3862a1a2132ae2940a23a642", + "https://bcr.bazel.build/modules/rules_foreign_cc/0.9.0/MODULE.bazel": "c9e8c682bf75b0e7c704166d79b599f93b72cfca5ad7477df596947891feeef6", + "https://bcr.bazel.build/modules/rules_fuzzing/0.5.2/MODULE.bazel": "40c97d1144356f52905566c55811f13b299453a14ac7769dfba2ac38192337a8", + "https://bcr.bazel.build/modules/rules_go/0.41.0/MODULE.bazel": "55861d8e8bb0e62cbd2896f60ff303f62ffcb0eddb74ecb0e5c0cbe36fc292c8", + "https://bcr.bazel.build/modules/rules_go/0.42.0/MODULE.bazel": "8cfa875b9aa8c6fce2b2e5925e73c1388173ea3c32a0db4d2b4804b453c14270", + "https://bcr.bazel.build/modules/rules_go/0.46.0/MODULE.bazel": "3477df8bdcc49e698b9d25f734c4f3a9f5931ff34ee48a2c662be168f5f2d3fd", + "https://bcr.bazel.build/modules/rules_go/0.59.0/MODULE.bazel": "b7e43e7414a3139a7547d1b4909b29085fbe5182b6c58cbe1ed4c6272815aeae", + "https://bcr.bazel.build/modules/rules_go/0.63.0/MODULE.bazel": "a2079e783a5d2715a90e6e2970ec8ffd717a487ff2aecb5f553e3975c5294a21", + "https://bcr.bazel.build/modules/rules_go/0.63.0/source.json": "5bf37b45c440ac03abad0cbfa8b8b8dd89cc4e82bc8305f468b8436fa58bae78", + "https://bcr.bazel.build/modules/rules_java/4.0.0/MODULE.bazel": "5a78a7ae82cd1a33cef56dc578c7d2a46ed0dca12643ee45edbb8417899e6f74", + "https://bcr.bazel.build/modules/rules_java/5.3.5/MODULE.bazel": "a4ec4f2db570171e3e5eb753276ee4b389bae16b96207e9d3230895c99644b86", + "https://bcr.bazel.build/modules/rules_java/6.5.2/MODULE.bazel": "1d440d262d0e08453fa0c4d8f699ba81609ed0e9a9a0f02cd10b3e7942e61e31", + "https://bcr.bazel.build/modules/rules_java/7.10.0/MODULE.bazel": "530c3beb3067e870561739f1144329a21c851ff771cd752a49e06e3dc9c2e71a", + "https://bcr.bazel.build/modules/rules_java/7.12.2/MODULE.bazel": "579c505165ee757a4280ef83cda0150eea193eed3bef50b1004ba88b99da6de6", + "https://bcr.bazel.build/modules/rules_java/7.2.0/MODULE.bazel": "06c0334c9be61e6cef2c8c84a7800cef502063269a5af25ceb100b192453d4ab", + "https://bcr.bazel.build/modules/rules_java/7.6.1/MODULE.bazel": "2f14b7e8a1aa2f67ae92bc69d1ec0fa8d9f827c4e17ff5e5f02e91caa3b2d0fe", + "https://bcr.bazel.build/modules/rules_java/8.3.2/MODULE.bazel": "7336d5511ad5af0b8615fdc7477535a2e4e723a357b6713af439fe8cf0195017", + "https://bcr.bazel.build/modules/rules_java/8.5.1/MODULE.bazel": "d8a9e38cc5228881f7055a6079f6f7821a073df3744d441978e7a43e20226939", + "https://bcr.bazel.build/modules/rules_java/8.6.1/MODULE.bazel": "f4808e2ab5b0197f094cabce9f4b006a27766beb6a9975931da07099560ca9c2", + "https://bcr.bazel.build/modules/rules_java/9.1.0/MODULE.bazel": "ee63f27e36a3fada80342869361182f120a9819c74320e8e65b1e04ba0cd7a9d", + "https://bcr.bazel.build/modules/rules_java/9.1.0/source.json": "da589573c1dee2c9ac4a568b301269a2e8191110ff0345c1a959fa7ea6c4dfd6", + "https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/MODULE.bazel": "a56b85e418c83eb1839819f0b515c431010160383306d13ec21959ac412d2fe7", + "https://bcr.bazel.build/modules/rules_jvm_external/5.1/MODULE.bazel": "33f6f999e03183f7d088c9be518a63467dfd0be94a11d0055fe2d210f89aa909", + "https://bcr.bazel.build/modules/rules_jvm_external/5.2/MODULE.bazel": "d9351ba35217ad0de03816ef3ed63f89d411349353077348a45348b096615036", + "https://bcr.bazel.build/modules/rules_jvm_external/6.3/MODULE.bazel": "c998e060b85f71e00de5ec552019347c8bca255062c990ac02d051bb80a38df0", + "https://bcr.bazel.build/modules/rules_jvm_external/6.7/MODULE.bazel": "e717beabc4d091ecb2c803c2d341b88590e9116b8bf7947915eeb33aab4f96dd", + "https://bcr.bazel.build/modules/rules_jvm_external/6.7/source.json": "5426f412d0a7fc6b611643376c7e4a82dec991491b9ce5cb1cfdd25fe2e92be4", + "https://bcr.bazel.build/modules/rules_kotlin/1.9.6/MODULE.bazel": "d269a01a18ee74d0335450b10f62c9ed81f2321d7958a2934e44272fe82dcef3", + "https://bcr.bazel.build/modules/rules_kotlin/1.9.6/source.json": "2faa4794364282db7c06600b7e5e34867a564ae91bda7cae7c29c64e9466b7d5", + "https://bcr.bazel.build/modules/rules_license/0.0.3/MODULE.bazel": "627e9ab0247f7d1e05736b59dbb1b6871373de5ad31c3011880b4133cafd4bd0", + "https://bcr.bazel.build/modules/rules_license/0.0.7/MODULE.bazel": "088fbeb0b6a419005b89cf93fe62d9517c0a2b8bb56af3244af65ecfe37e7d5d", + "https://bcr.bazel.build/modules/rules_license/1.0.0/MODULE.bazel": "a7fda60eefdf3d8c827262ba499957e4df06f659330bbe6cdbdb975b768bb65c", + "https://bcr.bazel.build/modules/rules_license/1.0.0/source.json": "a52c89e54cc311196e478f8382df91c15f7a2bfdf4c6cd0e2675cc2ff0b56efb", + "https://bcr.bazel.build/modules/rules_pkg/0.7.0/MODULE.bazel": "df99f03fc7934a4737122518bb87e667e62d780b610910f0447665a7e2be62dc", + "https://bcr.bazel.build/modules/rules_pkg/1.0.1/MODULE.bazel": "5b1df97dbc29623bccdf2b0dcd0f5cb08e2f2c9050aab1092fd39a41e82686ff", + "https://bcr.bazel.build/modules/rules_pkg/1.0.1/source.json": "bd82e5d7b9ce2d31e380dd9f50c111d678c3bdaca190cb76b0e1c71b05e1ba8a", + "https://bcr.bazel.build/modules/rules_proto/4.0.0/MODULE.bazel": "a7a7b6ce9bee418c1a760b3d84f83a299ad6952f9903c67f19e4edd964894e06", + "https://bcr.bazel.build/modules/rules_proto/5.3.0-21.7/MODULE.bazel": "e8dff86b0971688790ae75528fe1813f71809b5afd57facb44dad9e8eca631b7", + "https://bcr.bazel.build/modules/rules_proto/6.0.0-rc1/MODULE.bazel": "1e5b502e2e1a9e825eef74476a5a1ee524a92297085015a052510b09a1a09483", + "https://bcr.bazel.build/modules/rules_proto/6.0.2/MODULE.bazel": "ce916b775a62b90b61888052a416ccdda405212b6aaeb39522f7dc53431a5e73", + "https://bcr.bazel.build/modules/rules_proto/7.0.2/MODULE.bazel": "bf81793bd6d2ad89a37a40693e56c61b0ee30f7a7fdbaf3eabbf5f39de47dea2", + "https://bcr.bazel.build/modules/rules_proto/7.1.0/MODULE.bazel": "002d62d9108f75bb807cd56245d45648f38275cb3a99dcd45dfb864c5d74cb96", + "https://bcr.bazel.build/modules/rules_proto/7.1.0/source.json": "39f89066c12c24097854e8f57ab8558929f9c8d474d34b2c00ac04630ad8940e", + "https://bcr.bazel.build/modules/rules_python/0.10.2/MODULE.bazel": "cc82bc96f2997baa545ab3ce73f196d040ffb8756fd2d66125a530031cd90e5f", + "https://bcr.bazel.build/modules/rules_python/0.23.1/MODULE.bazel": "49ffccf0511cb8414de28321f5fcf2a31312b47c40cc21577144b7447f2bf300", + "https://bcr.bazel.build/modules/rules_python/0.25.0/MODULE.bazel": "72f1506841c920a1afec76975b35312410eea3aa7b63267436bfb1dd91d2d382", + "https://bcr.bazel.build/modules/rules_python/0.28.0/MODULE.bazel": "cba2573d870babc976664a912539b320cbaa7114cd3e8f053c720171cde331ed", + "https://bcr.bazel.build/modules/rules_python/0.31.0/MODULE.bazel": "93a43dc47ee570e6ec9f5779b2e64c1476a6ce921c48cc9a1678a91dd5f8fd58", + "https://bcr.bazel.build/modules/rules_python/0.33.2/MODULE.bazel": "3e036c4ad8d804a4dad897d333d8dce200d943df4827cb849840055be8d2e937", + "https://bcr.bazel.build/modules/rules_python/0.4.0/MODULE.bazel": "9208ee05fd48bf09ac60ed269791cf17fb343db56c8226a720fbb1cdf467166c", + "https://bcr.bazel.build/modules/rules_python/1.3.0/MODULE.bazel": "8361d57eafb67c09b75bf4bbe6be360e1b8f4f18118ab48037f2bd50aa2ccb13", + "https://bcr.bazel.build/modules/rules_python/1.4.1/MODULE.bazel": "8991ad45bdc25018301d6b7e1d3626afc3c8af8aaf4bc04f23d0b99c938b73a6", + "https://bcr.bazel.build/modules/rules_python/1.6.0/MODULE.bazel": "7e04ad8f8d5bea40451cf80b1bd8262552aa73f841415d20db96b7241bd027d8", + "https://bcr.bazel.build/modules/rules_python/1.7.0/MODULE.bazel": "d01f995ecd137abf30238ad9ce97f8fc3ac57289c8b24bd0bf53324d937a14f8", + "https://bcr.bazel.build/modules/rules_python/1.7.0/source.json": "028a084b65dcf8f4dc4f82f8778dbe65df133f234b316828a82e060d81bdce32", + "https://bcr.bazel.build/modules/rules_shell/0.2.0/MODULE.bazel": "fda8a652ab3c7d8fee214de05e7a9916d8b28082234e8d2c0094505c5268ed3c", + "https://bcr.bazel.build/modules/rules_shell/0.3.0/MODULE.bazel": "de4402cd12f4cc8fda2354fce179fdb068c0b9ca1ec2d2b17b3e21b24c1a937b", + "https://bcr.bazel.build/modules/rules_shell/0.6.1/MODULE.bazel": "72e76b0eea4e81611ef5452aa82b3da34caca0c8b7b5c0c9584338aa93bae26b", + "https://bcr.bazel.build/modules/rules_shell/0.6.1/source.json": "20ec05cd5e592055e214b2da8ccb283c7f2a421ea0dc2acbf1aa792e11c03d0c", + "https://bcr.bazel.build/modules/rules_swift/1.16.0/MODULE.bazel": "4a09f199545a60d09895e8281362b1ff3bb08bbde69c6fc87aff5b92fcc916ca", + "https://bcr.bazel.build/modules/rules_swift/2.1.1/MODULE.bazel": "494900a80f944fc7aa61500c2073d9729dff0b764f0e89b824eb746959bc1046", + "https://bcr.bazel.build/modules/rules_swift/2.4.0/MODULE.bazel": "1639617eb1ede28d774d967a738b4a68b0accb40650beadb57c21846beab5efd", + "https://bcr.bazel.build/modules/rules_swift/3.1.2/MODULE.bazel": "72c8f5cf9d26427cee6c76c8e3853eb46ce6b0412a081b2b6db6e8ad56267400", + "https://bcr.bazel.build/modules/rules_swift/3.1.2/source.json": "e85761f3098a6faf40b8187695e3de6d97944e98abd0d8ce579cb2daf6319a66", + "https://bcr.bazel.build/modules/stardoc/0.5.1/MODULE.bazel": "1a05d92974d0c122f5ccf09291442580317cdd859f07a8655f1db9a60374f9f8", + "https://bcr.bazel.build/modules/stardoc/0.5.3/MODULE.bazel": "c7f6948dae6999bf0db32c1858ae345f112cacf98f174c7a8bb707e41b974f1c", + "https://bcr.bazel.build/modules/stardoc/0.7.0/MODULE.bazel": "05e3d6d30c099b6770e97da986c53bd31844d7f13d41412480ea265ac9e8079c", + "https://bcr.bazel.build/modules/stardoc/0.7.2/MODULE.bazel": "fc152419aa2ea0f51c29583fab1e8c99ddefd5b3778421845606ee628629e0e5", + "https://bcr.bazel.build/modules/stardoc/0.7.2/source.json": "58b029e5e901d6802967754adf0a9056747e8176f017cfe3607c0851f4d42216", + "https://bcr.bazel.build/modules/swift_argument_parser/1.3.1.1/MODULE.bazel": "5e463fbfba7b1701d957555ed45097d7f984211330106ccd1352c6e0af0dcf91", + "https://bcr.bazel.build/modules/swift_argument_parser/1.3.1.2/MODULE.bazel": "75aab2373a4bbe2a1260b9bf2a1ebbdbf872d3bd36f80bff058dccd82e89422f", + "https://bcr.bazel.build/modules/swift_argument_parser/1.3.1.2/source.json": "5fba48bbe0ba48761f9e9f75f92876cafb5d07c0ce059cc7a8027416de94a05b", + "https://bcr.bazel.build/modules/upb/0.0.0-20220923-a547704/MODULE.bazel": "7298990c00040a0e2f121f6c32544bab27d4452f80d9ce51349b1a28f3005c43", + "https://bcr.bazel.build/modules/zlib/1.2.11/MODULE.bazel": "07b389abc85fdbca459b69e2ec656ae5622873af3f845e1c9d80fe179f3effa0", + "https://bcr.bazel.build/modules/zlib/1.2.12/MODULE.bazel": "3b1a8834ada2a883674be8cbd36ede1b6ec481477ada359cd2d3ddc562340b27", + "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.5/MODULE.bazel": "eec517b5bbe5492629466e11dae908d043364302283de25581e3eb944326c4ca", + "https://bcr.bazel.build/modules/zlib/1.3.1.bcr.5/source.json": "22bc55c47af97246cfc093d0acf683a7869377de362b5d1c552c2c2e16b7a806", + "https://bcr.bazel.build/modules/zlib/1.3.1/MODULE.bazel": "751c9940dcfe869f5f7274e1295422a34623555916eb98c174c1e945594bf198" + }, + "selectedYankedVersions": {}, + "moduleExtensions": { + "@@rules_kotlin+//src/main/starlark/core/repositories:bzlmod_setup.bzl%rules_kotlin_extensions": { + "general": { + "bzlTransitiveDigest": "+Kp6j204mBZ3mxlIDDR0gBoP45BZ4jYRhRAcB8sU0qc=", + "usagesDigest": "QI2z8ZUR+mqtbwsf2fLqYdJAkPOHdOV+tF2yVAUgRzw=", + "recordedInputs": [ + "REPO_MAPPING:rules_kotlin+,bazel_tools bazel_tools" + ], + "generatedRepoSpecs": { + "com_github_jetbrains_kotlin_git": { + "repoRuleId": "@@rules_kotlin+//src/main/starlark/core/repositories:compiler.bzl%kotlin_compiler_git_repository", + "attributes": { + "urls": [ + "https://github.com/JetBrains/kotlin/releases/download/v1.9.23/kotlin-compiler-1.9.23.zip" + ], + "sha256": "93137d3aab9afa9b27cb06a824c2324195c6b6f6179d8a8653f440f5bd58be88" + } + }, + "com_github_jetbrains_kotlin": { + "repoRuleId": "@@rules_kotlin+//src/main/starlark/core/repositories:compiler.bzl%kotlin_capabilities_repository", + "attributes": { + "git_repository_name": "com_github_jetbrains_kotlin_git", + "compiler_version": "1.9.23" + } + }, + "com_github_google_ksp": { + "repoRuleId": "@@rules_kotlin+//src/main/starlark/core/repositories:ksp.bzl%ksp_compiler_plugin_repository", + "attributes": { + "urls": [ + "https://github.com/google/ksp/releases/download/1.9.23-1.0.20/artifacts.zip" + ], + "sha256": "ee0618755913ef7fd6511288a232e8fad24838b9af6ea73972a76e81053c8c2d", + "strip_version": "1.9.23-1.0.20" + } + }, + "com_github_pinterest_ktlint": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_file", + "attributes": { + "sha256": "01b2e0ef893383a50dbeb13970fe7fa3be36ca3e83259e01649945b09d736985", + "urls": [ + "https://github.com/pinterest/ktlint/releases/download/1.3.0/ktlint" + ], + "executable": true + } + }, + "rules_android": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "sha256": "cd06d15dd8bb59926e4d65f9003bfc20f9da4b2519985c27e190cddc8b7a7806", + "strip_prefix": "rules_android-0.1.1", + "urls": [ + "https://github.com/bazelbuild/rules_android/archive/v0.1.1.zip" + ] + } + } + } + } + }, + "@@rules_python+//python/extensions:config.bzl%config": { + "general": { + "bzlTransitiveDigest": "dzD8Q2YmrP3fz8saWLHPmlwPLO91ImtTmP/c9JKTStM=", + "usagesDigest": "ZVSXMAGpD+xzVNPuvF1IoLBkty7TROO0+akMapt1pAg=", + "recordedInputs": [ + "REPO_MAPPING:rules_python+,bazel_tools bazel_tools", + "REPO_MAPPING:rules_python+,pypi__build rules_python++config+pypi__build", + "REPO_MAPPING:rules_python+,pypi__click rules_python++config+pypi__click", + "REPO_MAPPING:rules_python+,pypi__colorama rules_python++config+pypi__colorama", + "REPO_MAPPING:rules_python+,pypi__importlib_metadata rules_python++config+pypi__importlib_metadata", + "REPO_MAPPING:rules_python+,pypi__installer rules_python++config+pypi__installer", + "REPO_MAPPING:rules_python+,pypi__more_itertools rules_python++config+pypi__more_itertools", + "REPO_MAPPING:rules_python+,pypi__packaging rules_python++config+pypi__packaging", + "REPO_MAPPING:rules_python+,pypi__pep517 rules_python++config+pypi__pep517", + "REPO_MAPPING:rules_python+,pypi__pip rules_python++config+pypi__pip", + "REPO_MAPPING:rules_python+,pypi__pip_tools rules_python++config+pypi__pip_tools", + "REPO_MAPPING:rules_python+,pypi__pyproject_hooks rules_python++config+pypi__pyproject_hooks", + "REPO_MAPPING:rules_python+,pypi__setuptools rules_python++config+pypi__setuptools", + "REPO_MAPPING:rules_python+,pypi__tomli rules_python++config+pypi__tomli", + "REPO_MAPPING:rules_python+,pypi__wheel rules_python++config+pypi__wheel", + "REPO_MAPPING:rules_python+,pypi__zipp rules_python++config+pypi__zipp" + ], + "generatedRepoSpecs": { + "rules_python_internal": { + "repoRuleId": "@@rules_python+//python/private:internal_config_repo.bzl%internal_config_repo", + "attributes": { + "transition_setting_generators": {}, + "transition_settings": [] + } + }, + "pypi__build": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/e2/03/f3c8ba0a6b6e30d7d18c40faab90807c9bb5e9a1e3b2fe2008af624a9c97/build-1.2.1-py3-none-any.whl", + "sha256": "75e10f767a433d9a86e50d83f418e83efc18ede923ee5ff7df93b6cb0306c5d4", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__click": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/00/2e/d53fa4befbf2cfa713304affc7ca780ce4fc1fd8710527771b58311a3229/click-8.1.7-py3-none-any.whl", + "sha256": "ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__colorama": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", + "sha256": "4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__importlib_metadata": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/2d/0a/679461c511447ffaf176567d5c496d1de27cbe34a87df6677d7171b2fbd4/importlib_metadata-7.1.0-py3-none-any.whl", + "sha256": "30962b96c0c223483ed6cc7280e7f0199feb01a0e40cfae4d4450fc6fab1f570", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__installer": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/e5/ca/1172b6638d52f2d6caa2dd262ec4c811ba59eee96d54a7701930726bce18/installer-0.7.0-py3-none-any.whl", + "sha256": "05d1933f0a5ba7d8d6296bb6d5018e7c94fa473ceb10cf198a92ccea19c27b53", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__more_itertools": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/50/e2/8e10e465ee3987bb7c9ab69efb91d867d93959095f4807db102d07995d94/more_itertools-10.2.0-py3-none-any.whl", + "sha256": "686b06abe565edfab151cb8fd385a05651e1fdf8f0a14191e4439283421f8684", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__packaging": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/49/df/1fceb2f8900f8639e278b056416d49134fb8d84c5942ffaa01ad34782422/packaging-24.0-py3-none-any.whl", + "sha256": "2ddfb553fdf02fb784c234c7ba6ccc288296ceabec964ad2eae3777778130bc5", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__pep517": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/25/6e/ca4a5434eb0e502210f591b97537d322546e4833dcb4d470a48c375c5540/pep517-0.13.1-py3-none-any.whl", + "sha256": "31b206f67165b3536dd577c5c3f1518e8fbaf38cbc57efff8369a392feff1721", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__pip": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/8a/6a/19e9fe04fca059ccf770861c7d5721ab4c2aebc539889e97c7977528a53b/pip-24.0-py3-none-any.whl", + "sha256": "ba0d021a166865d2265246961bec0152ff124de910c5cc39f1156ce3fa7c69dc", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__pip_tools": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/0d/dc/38f4ce065e92c66f058ea7a368a9c5de4e702272b479c0992059f7693941/pip_tools-7.4.1-py3-none-any.whl", + "sha256": "4c690e5fbae2f21e87843e89c26191f0d9454f362d8acdbd695716493ec8b3a9", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__pyproject_hooks": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/ae/f3/431b9d5fe7d14af7a32340792ef43b8a714e7726f1d7b69cc4e8e7a3f1d7/pyproject_hooks-1.1.0-py3-none-any.whl", + "sha256": "7ceeefe9aec63a1064c18d939bdc3adf2d8aa1988a510afec15151578b232aa2", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__setuptools": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/90/99/158ad0609729111163fc1f674a5a42f2605371a4cf036d0441070e2f7455/setuptools-78.1.1-py3-none-any.whl", + "sha256": "c3a9c4211ff4c309edb8b8c4f1cbfa7ae324c4ba9f91ff254e3d305b9fd54561", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__tomli": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/97/75/10a9ebee3fd790d20926a90a2547f0bf78f371b2f13aa822c759680ca7b9/tomli-2.0.1-py3-none-any.whl", + "sha256": "939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__wheel": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/7d/cd/d7460c9a869b16c3dd4e1e403cce337df165368c71d6af229a74699622ce/wheel-0.43.0-py3-none-any.whl", + "sha256": "55c570405f142630c6b9f72fe09d9b67cf1477fcf543ae5b8dcb1f5b7377da81", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + }, + "pypi__zipp": { + "repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive", + "attributes": { + "url": "https://files.pythonhosted.org/packages/da/55/a03fd7240714916507e1fcf7ae355bd9d9ed2e6db492595f1a67f61681be/zipp-3.18.2-py3-none-any.whl", + "sha256": "dce197b859eb796242b0622af1b8beb0a722d52aa2f57133ead08edd5bf5374e", + "type": "zip", + "build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n" + } + } + } + } + }, + "@@rules_python+//python/uv:uv.bzl%uv": { + "general": { + "bzlTransitiveDigest": "ijW9KS7qsIY+yBVvJ+Nr1mzwQox09j13DnE3iIwaeTM=", + "usagesDigest": "H8dQoNZcoqP+Mu0tHZTi4KHATzvNkM5ePuEqoQdklIU=", + "recordedInputs": [ + "REPO_MAPPING:rules_python+,bazel_tools bazel_tools", + "REPO_MAPPING:rules_python+,platforms platforms" + ], + "generatedRepoSpecs": { + "uv": { + "repoRuleId": "@@rules_python+//python/uv/private:uv_toolchains_repo.bzl%uv_toolchains_repo", + "attributes": { + "toolchain_type": "'@@rules_python+//python/uv:uv_toolchain_type'", + "toolchain_names": [ + "none" + ], + "toolchain_implementations": { + "none": "'@@rules_python+//python:none'" + }, + "toolchain_compatible_with": { + "none": [ + "@platforms//:incompatible" + ] + }, + "toolchain_target_settings": {} + } + } + } + } + } + }, + "facts": { + "@@rules_go+//go:extensions.bzl%go_sdk": { + "1.25.0": { + "aix_ppc64": [ + "go1.25.0.aix-ppc64.tar.gz", + "e5234a7dac67bc86c528fe9752fc9d63557918627707a733ab4cac1a6faed2d4" + ], + "darwin_amd64": [ + "go1.25.0.darwin-amd64.tar.gz", + "5bd60e823037062c2307c71e8111809865116714d6f6b410597cf5075dfd80ef" + ], + "darwin_arm64": [ + "go1.25.0.darwin-arm64.tar.gz", + "544932844156d8172f7a28f77f2ac9c15a23046698b6243f633b0a0b00c0749c" + ], + "dragonfly_amd64": [ + "go1.25.0.dragonfly-amd64.tar.gz", + "5ed3cf9a810a1483822538674f1336c06b51aa1b94d6d545a1a0319a48177120" + ], + "freebsd_386": [ + "go1.25.0.freebsd-386.tar.gz", + "abea5d5c6697e6b5c224731f2158fe87c602996a2a233ac0c4730cd57bf8374e" + ], + "freebsd_amd64": [ + "go1.25.0.freebsd-amd64.tar.gz", + "86e6fe0a29698d7601c4442052dac48bd58d532c51cccb8f1917df648138730b" + ], + "freebsd_arm": [ + "go1.25.0.freebsd-arm.tar.gz", + "d90b78e41921f72f30e8bbc81d9dec2cff7ff384a33d8d8debb24053e4336bfe" + ], + "freebsd_arm64": [ + "go1.25.0.freebsd-arm64.tar.gz", + "451d0da1affd886bfb291b7c63a6018527b269505db21ce6e14724f22ab0662e" + ], + "freebsd_riscv64": [ + "go1.25.0.freebsd-riscv64.tar.gz", + "7b565f76bd8bda46549eeaaefe0e53b251e644c230577290c0f66b1ecdb3cdbe" + ], + "illumos_amd64": [ + "go1.25.0.illumos-amd64.tar.gz", + "b1e1fdaab1ad25aa1c08d7a36c97d45d74b98b89c3f78c6d2145f77face54a2c" + ], + "linux_386": [ + "go1.25.0.linux-386.tar.gz", + "8c602dd9d99bc9453b3995d20ce4baf382cc50855900a0ece5de9929df4a993a" + ], + "linux_amd64": [ + "go1.25.0.linux-amd64.tar.gz", + "2852af0cb20a13139b3448992e69b868e50ed0f8a1e5940ee1de9e19a123b613" + ], + "linux_arm64": [ + "go1.25.0.linux-arm64.tar.gz", + "05de75d6994a2783699815ee553bd5a9327d8b79991de36e38b66862782f54ae" + ], + "linux_armv6l": [ + "go1.25.0.linux-armv6l.tar.gz", + "a5a8f8198fcf00e1e485b8ecef9ee020778bf32a408a4e8873371bfce458cd09" + ], + "linux_loong64": [ + "go1.25.0.linux-loong64.tar.gz", + "cab86b1cf761b1cb3bac86a8877cfc92e7b036fc0d3084123d77013d61432afc" + ], + "linux_mips": [ + "go1.25.0.linux-mips.tar.gz", + "d66b6fb74c3d91b9829dc95ec10ca1f047ef5e89332152f92e136cf0e2da5be1" + ], + "linux_mips64": [ + "go1.25.0.linux-mips64.tar.gz", + "4082e4381a8661bc2a839ff94ba3daf4f6cde20f8fb771b5b3d4762dc84198a2" + ], + "linux_mips64le": [ + "go1.25.0.linux-mips64le.tar.gz", + "70002c299ec7f7175ac2ef673b1b347eecfa54ae11f34416a6053c17f855afcc" + ], + "linux_mipsle": [ + "go1.25.0.linux-mipsle.tar.gz", + "b00a3a39eff099f6df9f1c7355bf28e4589d0586f42d7d4a394efb763d145a73" + ], + "linux_ppc64": [ + "go1.25.0.linux-ppc64.tar.gz", + "df166f33bd98160662560a72ff0b4ba731f969a80f088922bddcf566a88c1ec1" + ], + "linux_ppc64le": [ + "go1.25.0.linux-ppc64le.tar.gz", + "0f18a89e7576cf2c5fa0b487a1635d9bcbf843df5f110e9982c64df52a983ad0" + ], + "linux_riscv64": [ + "go1.25.0.linux-riscv64.tar.gz", + "c018ff74a2c48d55c8ca9b07c8e24163558ffec8bea08b326d6336905d956b67" + ], + "linux_s390x": [ + "go1.25.0.linux-s390x.tar.gz", + "34e5a2e19f2292fbaf8783e3a241e6e49689276aef6510a8060ea5ef54eee408" + ], + "netbsd_386": [ + "go1.25.0.netbsd-386.tar.gz", + "f8586cdb7aa855657609a5c5f6dbf523efa00c2bbd7c76d3936bec80aa6c0aba" + ], + "netbsd_amd64": [ + "go1.25.0.netbsd-amd64.tar.gz", + "ae8dc1469385b86a157a423bb56304ba45730de8a897615874f57dd096db2c2a" + ], + "netbsd_arm": [ + "go1.25.0.netbsd-arm.tar.gz", + "1ff7e4cc764425fc9dd6825eaee79d02b3c7cafffbb3691687c8d672ade76cb7" + ], + "netbsd_arm64": [ + "go1.25.0.netbsd-arm64.tar.gz", + "e1b310739f26724216aa6d7d7208c4031f9ff54c9b5b9a796ddc8bebcb4a5f16" + ], + "openbsd_386": [ + "go1.25.0.openbsd-386.tar.gz", + "4802a9b20e533da91adb84aab42e94aa56cfe3e5475d0550bed3385b182e69d8" + ], + "openbsd_amd64": [ + "go1.25.0.openbsd-amd64.tar.gz", + "c016cd984bebe317b19a4f297c4f50def120dc9788490540c89f28e42f1dabe1" + ], + "openbsd_arm": [ + "go1.25.0.openbsd-arm.tar.gz", + "a1e31d0bf22172ddde42edf5ec811ef81be43433df0948ece52fecb247ccfd8d" + ], + "openbsd_arm64": [ + "go1.25.0.openbsd-arm64.tar.gz", + "343ea8edd8c218196e15a859c6072d0dd3246fbbb168481ab665eb4c4140458d" + ], + "openbsd_ppc64": [ + "go1.25.0.openbsd-ppc64.tar.gz", + "694c14da1bcaeb5e3332d49bdc2b6d155067648f8fe1540c5de8f3cf8e157154" + ], + "openbsd_riscv64": [ + "go1.25.0.openbsd-riscv64.tar.gz", + "aa510ad25cf54c06cd9c70b6d80ded69cb20188ac6e1735655eef29ff7e7885f" + ], + "plan9_386": [ + "go1.25.0.plan9-386.tar.gz", + "46f8cef02086cf04bf186c5912776b56535178d4cb319cd19c9fdbdd29231986" + ], + "plan9_amd64": [ + "go1.25.0.plan9-amd64.tar.gz", + "29b34391d84095e44608a228f63f2f88113a37b74a79781353ec043dfbcb427b" + ], + "plan9_arm": [ + "go1.25.0.plan9-arm.tar.gz", + "0a047107d13ebe7943aaa6d54b1d7bbd2e45e68ce449b52915a818da715799c2" + ], + "solaris_amd64": [ + "go1.25.0.solaris-amd64.tar.gz", + "9977f9e4351984364a3b2b78f8b88bfd1d339812356d5237678514594b7d3611" + ], + "windows_386": [ + "go1.25.0.windows-386.zip", + "df9f39db82a803af0db639e3613a36681ab7a42866b1384b3f3a1045663961a7" + ], + "windows_amd64": [ + "go1.25.0.windows-amd64.zip", + "89efb4f9b30812eee083cc1770fdd2913c14d301064f6454851428f9707d190b" + ], + "windows_arm64": [ + "go1.25.0.windows-arm64.zip", + "27bab004c72b3d7bd05a69b6ec0fc54a309b4b78cc569dd963d8b3ec28bfdb8c" + ] + }, + "1.26.7": { + "aix_ppc64": [ + "go1.26.7.aix-ppc64.tar.gz", + "e5aed98bc83f569a374dbfd79d632b058e5130192fbd4c4ee0d4f6e3d9c101bb" + ], + "darwin_amd64": [ + "go1.26.7.darwin-amd64.tar.gz", + "92e8b34bff3c89ab16404c595669ac8cb004cc2f676dcbd1f5b87a6b8def3b47" + ], + "darwin_arm64": [ + "go1.26.7.darwin-arm64.tar.gz", + "020a1e8224811be75163e920bc77e0926a1390a6aeea19bdcf23f74b9d749f6d" + ], + "dragonfly_amd64": [ + "go1.26.7.dragonfly-amd64.tar.gz", + "d980dc9ecc48de09b2fa1765886abb8c7b0ad738bf8cc483b76019facc2df4d1" + ], + "freebsd_386": [ + "go1.26.7.freebsd-386.tar.gz", + "7eecfa4d6c126bcdedb8e16583ec672857e607659c672c60a9d645f8957da117" + ], + "freebsd_amd64": [ + "go1.26.7.freebsd-amd64.tar.gz", + "2ad37146fa8449907716b494dd268aeae6f79592b875915525c28c8c337ad32a" + ], + "freebsd_arm": [ + "go1.26.7.freebsd-arm.tar.gz", + "bc56379ed419cd93cf7002dcb95f554b3e3a2bd58d804182f8873e313a870b70" + ], + "freebsd_arm64": [ + "go1.26.7.freebsd-arm64.tar.gz", + "23d425a3a51876df8bf050f080b1ae50340048def689fbcc44c939fa23485ce0" + ], + "illumos_amd64": [ + "go1.26.7.illumos-amd64.tar.gz", + "be51df2411786e1fa6325461e509224a94c5e8d001da8e4548d9e028a53a3c22" + ], + "linux_386": [ + "go1.26.7.linux-386.tar.gz", + "5b6fad4a7fe8fa230c935625b67450305be95e2f4f976b731623f76b88fc4821" + ], + "linux_amd64": [ + "go1.26.7.linux-amd64.tar.gz", + "ffb5f8de10c62550dfddab66b36b57030721e0a44a3218e9e1181d7b59f121ca" + ], + "linux_arm64": [ + "go1.26.7.linux-arm64.tar.gz", + "5a4ec883379d51ee9ce1040d5e87f8d35e20387574dd8c947feb01eabc3c1b37" + ], + "linux_armv6l": [ + "go1.26.7.linux-armv6l.tar.gz", + "6a41557335d1d9fa9bfc7439cedcfd0e4df2fc83d916175b5f3eae4685f5fe3f" + ], + "linux_loong64": [ + "go1.26.7.linux-loong64.tar.gz", + "89b5e92446e719719e23db447a41860d7d573252bab0704c9acb09ad97e9eca1" + ], + "linux_mips": [ + "go1.26.7.linux-mips.tar.gz", + "fbdbf78b04494843fde47b15150e12adb7e2c0e2289eacbc18e6629a99604620" + ], + "linux_mips64": [ + "go1.26.7.linux-mips64.tar.gz", + "93b1360a29f4a71dbb6995f149b9312f67f5ce52197fea0042e9c9423809a496" + ], + "linux_mips64le": [ + "go1.26.7.linux-mips64le.tar.gz", + "402dd2bd57fb4c982ef0eccbb4f7209ae98a753856e99baf962f1ac54493d65d" + ], + "linux_mipsle": [ + "go1.26.7.linux-mipsle.tar.gz", + "967da58e88c45c401593a8552be9beedaa989a3484a3105850d2beb6ca9ed698" + ], + "linux_ppc64": [ + "go1.26.7.linux-ppc64.tar.gz", + "8feee58b3fa8d270343519d10d66736150e627d39aee937e6e889ba5445c8be9" + ], + "linux_ppc64le": [ + "go1.26.7.linux-ppc64le.tar.gz", + "22d3b362d557175fd16b79651cab0cad64f8aaaedca745f66d16f44d56bc5de1" + ], + "linux_riscv64": [ + "go1.26.7.linux-riscv64.tar.gz", + "21e1dc0e2f7dd9f80e0e94613fc324f1f99403b99997f9d8c5f80f8132fc642b" + ], + "linux_s390x": [ + "go1.26.7.linux-s390x.tar.gz", + "bc3308e05e9397958ad4aac453e3dc4565ba6d548e9ace0a9b4b165feb6382f2" + ], + "netbsd_386": [ + "go1.26.7.netbsd-386.tar.gz", + "c0a28bd30d8c07966cf7bc43fc6936866fb1a0e84ab4e983d4e8ca15edc1a4d1" + ], + "netbsd_amd64": [ + "go1.26.7.netbsd-amd64.tar.gz", + "dff0b16d129f5e70f3bb38ed98d467404b5b130c7c8b3fe6b074601855f2bcd5" + ], + "netbsd_arm": [ + "go1.26.7.netbsd-arm.tar.gz", + "36d15f8c5c5a5a048251b39ce67ed5a7ae2d072f1aa5c301cbde110670e824b2" + ], + "netbsd_arm64": [ + "go1.26.7.netbsd-arm64.tar.gz", + "b75802b366e5b60aa6cfded871f0a72abadf297c5a68c523c5857822a5b92d34" + ], + "openbsd_386": [ + "go1.26.7.openbsd-386.tar.gz", + "c26201688339b2a10bf980be2d64adfd3a383b31a164377b0123ad78bde6979c" + ], + "openbsd_amd64": [ + "go1.26.7.openbsd-amd64.tar.gz", + "562de088b844764029f59ff52e82218711a4b585ab7ae175b88eff53e051a8df" + ], + "openbsd_arm": [ + "go1.26.7.openbsd-arm.tar.gz", + "646e19cd3449aec767bf75622d368b02c73d529a5478a25f2a7e21148b1a4cb6" + ], + "openbsd_arm64": [ + "go1.26.7.openbsd-arm64.tar.gz", + "2045303632e112290e939dfd4678401109f612f7913f459e2d7d079e750723f5" + ], + "openbsd_ppc64": [ + "go1.26.7.openbsd-ppc64.tar.gz", + "23e89de68225dc41dd981601602e67fab0c4ca87af8f70a25131c06a301f9000" + ], + "openbsd_riscv64": [ + "go1.26.7.openbsd-riscv64.tar.gz", + "c0de2c6c353a582ca7682ed5a550056a8b5d59649260da4d1e327cf96684c822" + ], + "plan9_386": [ + "go1.26.7.plan9-386.tar.gz", + "14ae7414a2ea05d26e1fc499d9b372c7f8f17726c49a5222fa9063b0f752a22c" + ], + "plan9_amd64": [ + "go1.26.7.plan9-amd64.tar.gz", + "f9459b8137bdb81621d4e0cdba4c849a617c89c11a3088083ad3a8c97467c6a5" + ], + "plan9_arm": [ + "go1.26.7.plan9-arm.tar.gz", + "4f444bd2e0f8a08ba8799131dd3531bea8723bf96b8ffa0e0948936a3c4aa8f0" + ], + "solaris_amd64": [ + "go1.26.7.solaris-amd64.tar.gz", + "04b5b280e0e0de1b91d7da5e34801dbf75e5621615f80cfd9935091d673f1238" + ], + "windows_386": [ + "go1.26.7.windows-386.zip", + "59cf0b9814c41c960d70df3cd5360fda0793e5d2230737d58e009392181fb636" + ], + "windows_amd64": [ + "go1.26.7.windows-amd64.zip", + "f4f534a486e4bc3387fa18f08208f2f854b7aaea8a08f2a2d829a914a05abb11" + ], + "windows_arm64": [ + "go1.26.7.windows-arm64.zip", + "6f1b08de9e2dd94f69c52e524ab6834737275253291e8fd7f1c12ed4eceeda89" + ] + } + } + }, + "factsVersions": {} +} diff --git a/Makefile b/Makefile index 6ea33d12d..c70c10c0c 100644 --- a/Makefile +++ b/Makefile @@ -46,6 +46,7 @@ endif .PHONY: all build doctor-build test test-icu-path test-full-cgo test-regression test-upgrade test-cross-version test-migration corpus-regen githooks-regen bench bench-quick clean clean-test-tmp install install-force help check-up-to-date fmt fmt-check check-testing-short .PHONY: ci-pr-core ci-pr-policy ci-pr-lint ci-complexity ci-complexity-diff ci-complexity-check ci-package-mcp ci-package-npm .PHONY: api-gen api-check +.PHONY: bazel-sync # Default target all: build @@ -408,6 +409,14 @@ diagrams-excalidraw: docs-dev: ./mint.sh dev +# Bazel (side-by-side with the Go toolchain; `go build`/`go test` do not need +# it). Regenerate BUILD.bazel files with gazelle and refresh the MODULE.bazel +# use_repo list + MODULE.bazel.lock. Run after changing Go imports or go.mod. +BAZEL ?= bazel +bazel-sync: + $(BAZEL) run //:gazelle + $(BAZEL) mod tidy + # Ensure -short is not used as an implicit CI tier boundary. check-testing-short: @./scripts/check-testing-short.sh @@ -456,6 +465,7 @@ help: @echo " make check-docs - Validate docs against CLI flags" @echo " make api-gen - Regenerate HTTP API types from the OpenAPI spec" @echo " make api-check - OpenAPI drift gate (regenerate, diff-or-fail, spec tests)" + @echo " make bazel-sync - Regenerate Bazel BUILD files and tidy MODULE.bazel (gazelle + mod tidy)" @echo " make clean - Remove build artifacts and profile files" @echo " make clean-test-tmp - Sweep orphaned cmd/bd test temp dirs from \$$TMPDIR" @echo " make help - Show this help message" diff --git a/backend/BUILD.bazel b/backend/BUILD.bazel new file mode 100644 index 000000000..210fd61ae --- /dev/null +++ b/backend/BUILD.bazel @@ -0,0 +1,30 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "backend", + srcs = [ + "backend.go", + "errors.go", + "types.go", + ], + importpath = "github.com/steveyegge/beads/backend", + visibility = ["//visibility:public"], + deps = [ + "//internal/storage", + "//internal/storage/backends", + "//internal/types", + ], +) + +go_test( + name = "backend_test", + srcs = [ + "completeness_test.go", + "errors_test.go", + ], + deps = [ + ":backend", + "//backend/conformance", + "//internal/storage", + ], +) diff --git a/backend/conformance/BUILD.bazel b/backend/conformance/BUILD.bazel new file mode 100644 index 000000000..d2dcfa9d6 --- /dev/null +++ b/backend/conformance/BUILD.bazel @@ -0,0 +1,90 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "conformance", + srcs = [ + "audit.go", + "audit_config_metadata_slots_repomtime.go", + "audit_dependencies_readiness.go", + "audit_issue-lifecycle.go", + "audit_labels-comments-events.go", + "audit_molecule_wisp_batch_iter.go", + "audit_search-counts-stats.go", + "batch_apply_contract.go", + "batch_closer_contract.go", + "batch_creator_contract.go", + "blocked_state.go", + "blocking_annotator_contract.go", + "bootstrapper_contract.go", + "claim.go", + "claimer_contract.go", + "commenter_contract.go", + "conformance.go", + "counter_contract.go", + "cross_record_invariant_contract.go", + "cycle_detector_contract.go", + "deleter_contract.go", + "dependency_editor_contract.go", + "dualwrite_history_contract.go", + "edge_reader_contract.go", + "expected_revision_contract.go", + "graph_counter_contract.go", + "history_matching.go", + "importer_contract.go", + "issue_operations_contract.go", + "issue_operations_staging.go", + "journal_contract.go", + "lifecycle_close_reopen_contract.go", + "lifecycle_create_contract.go", + "lifecycle_update_contract.go", + "memories_contract.go", + "metadata_cas_contract.go", + "portable.go", + "querier_contract.go", + "reader_contract.go", + "ready_claimer_contract.go", + "ready_counter_contract.go", + "reclaim_scope.go", + "relations_contract.go", + "releaser_contract.go", + "retention_epoch_contract.go", + "role_bundle.go", + "role_bundle_cases.go", + "search_paging.go", + "stats_reporter_contract.go", + "sweeper_contract.go", + "transaction_parity.go", + "tree_walker_contract.go", + "version_reconciler_contract.go", + "workspaceconfig_contract.go", + ], + importpath = "github.com/steveyegge/beads/backend/conformance", + visibility = ["//visibility:public"], + deps = [ + "//internal/storage", + "//internal/storage/issueops", + "//internal/storage/kvkeys", + "//internal/storage/sqlbuild", + "//internal/types", + "//issueops", + "//journalops", + "//memoryops", + ], +) + +go_test( + name = "conformance_test", + srcs = [ + "role_bundle_test.go", + "role_coverage_gate_test.go", + "role_coverage_scan_test.go", + "versioned_history_wiring_test.go", + ], + embed = [":conformance"], + deps = [ + "//internal/storage", + "//issueops", + "//journalops", + "//memoryops", + ], +) diff --git a/beadserrors/BUILD.bazel b/beadserrors/BUILD.bazel new file mode 100644 index 000000000..0198fb8e4 --- /dev/null +++ b/beadserrors/BUILD.bazel @@ -0,0 +1,8 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "beadserrors", + srcs = ["errors.go"], + importpath = "github.com/steveyegge/beads/beadserrors", + visibility = ["//visibility:public"], +) diff --git a/cmd/bd/BUILD.bazel b/cmd/bd/BUILD.bazel new file mode 100644 index 000000000..cdffb53d5 --- /dev/null +++ b/cmd/bd/BUILD.bazel @@ -0,0 +1,1191 @@ +load("@rules_go//go:def.bzl", "go_binary", "go_library", "go_test") + +go_library( + name = "bd_lib", + srcs = [ + "admin.go", + "ado.go", + "agent_hook.go", + "assign.go", + "audit.go", + "auto_import_upgrade.go", + "backend_support.go", + "backup.go", + "backup_auto.go", + "backup_dolt.go", + "backup_export.go", + "backup_proxied_server.go", + "backup_restore.go", + "batch.go", + "batch_proxied_server.go", + "bootstrap.go", + "branch.go", + "capability_registry.go", + "children.go", + "cleanup.go", + "close.go", + "close_direct.go", + "close_proxied_server.go", + "closed_delete_candidates.go", + "codex_hook.go", + "command_telemetry.go", + "comment.go", + "comments.go", + "comments_proxied_server.go", + "compact.go", + "compact_dolt.go", + "compact_dolt_proxied_server.go", + "compact_proxied_server.go", + "completions.go", + "config.go", + "config_apply.go", + "config_drift.go", + "config_drift_unix.go", + "config_drift_windows.go", + "config_proxied_server.go", + "config_show.go", + "config_side_effects.go", + "conflicts.go", + "context.go", + "context_cmd.go", + "context_proxied_server.go", + "cook.go", + "count.go", + "count_proxied_server.go", + "create.go", + "create_atomic.go", + "create_deps.go", + "create_form.go", + "create_input.go", + "create_proxied_server.go", + "cursor_hook.go", + "database_name.go", + "db_proxy_child.go", + "defer.go", + "defer_proxied_server.go", + "delete.go", + "delete_proxied_server.go", + "dep.go", + "dep_cycles.go", + "dep_proxied_server.go", + "dep_relation.go", + "dep_tree.go", + "detect_pollution.go", + "diff.go", + "direct_mode.go", + "doctor.go", + "doctor_agent.go", + "doctor_artifacts.go", + "doctor_conventions.go", + "doctor_fix.go", + "doctor_health.go", + "doctor_orchestrator_guard.go", + "doctor_pollution.go", + "doctor_validate.go", + "dolt.go", + "dolt_autocommit.go", + "dolt_autocommit_config.go", + "dolt_autopush.go", + "dolt_clean_databases.go", + "dolt_clean_databases_proxied_server.go", + "dolt_local_only.go", + "dolt_proxied_lifecycle.go", + "dolt_remote_adopt.go", + "dolt_remote_guard.go", + "dolt_remote_proxied_server.go", + "dolt_remote_reset_data.go", + "duplicate.go", + "duplicates.go", + "duplicates_proxied_server.go", + "edit.go", + "edit_proxied_server.go", + "epic.go", + "epic_proxied_server.go", + "errors.go", + "events.go", + "events_journal.go", + "export.go", + "export_auto.go", + "export_obsidian.go", + "export_source.go", + "federation.go", + "federation_nocgo.go", + "feedback.go", + "find_duplicates.go", + "find_duplicates_proxied_server.go", + "flags.go", + "flatten.go", + "formula.go", + "formula_schema.go", + "fs_adapters.go", + "gate.go", + "gate_discover.go", + "gate_proxied_server.go", + "gc.go", + "gc_proxied_server.go", + "gc_prune.go", + "git_test_helpers.go", + "github.go", + "gitlab.go", + "graph.go", + "graph_apply.go", + "graph_export.go", + "graph_proxied_server.go", + "graph_visual.go", + "heartbeat.go", + "heartbeat_proxied_server.go", + "help_all.go", + "help_supplements.go", + "history.go", + "history_proxied_server.go", + "hooks.go", + "human.go", + "human_proxied_server.go", + "import.go", + "import_path.go", + "import_proxied_server.go", + "import_shared.go", + "info.go", + "info_proxied_server.go", + "init.go", + "init_agent.go", + "init_contributor.go", + "init_git_hooks.go", + "init_guard.go", + "init_policy.go", + "init_proxied_server.go", + "init_safety.go", + "init_safety_help.go", + "init_stealth.go", + "init_team.go", + "init_templates.go", + "issueops_adapter.go", + "jira.go", + "kv.go", + "kv_proxied_server.go", + "label.go", + "label_proxied_server.go", + "label_whitespace_warn.go", + "last_touched.go", + "legacy_sqlite_reader.go", + "legacy_upgrade_guard.go", + "linear.go", + "link.go", + "link_proxied_server.go", + "lint.go", + "lint_proxied_server.go", + "list.go", + "list_format.go", + "list_input.go", + "list_output.go", + "list_proxied_server.go", + "list_roles.go", + "list_show_filter_modes.go", + "list_tree.go", + "list_tree_deps.go", + "mail.go", + "main.go", + "main_errors.go", + "main_help.go", + "markdown.go", + "max_rows.go", + "memory.go", + "merge_slot.go", + "metadata_flag.go", + "metrics.go", + "migrate.go", + "migrate_dolt_mode.go", + "migrate_hooks.go", + "migrate_hooks_apply.go", + "migrate_issues.go", + "migrate_personal.go", + "mol.go", + "mol_bond.go", + "mol_burn.go", + "mol_current.go", + "mol_distill.go", + "mol_last_activity.go", + "mol_port.go", + "mol_progress.go", + "mol_proxied_server.go", + "mol_ready_gated.go", + "mol_seed.go", + "mol_show.go", + "mol_squash.go", + "mol_stale.go", + "mutate_proxied_server.go", + "nocow_linux.go", + "nocow_other.go", + "note.go", + "notion.go", + "onboard.go", + "orphans.go", + "orphans_proxied_server.go", + "output.go", + "ping.go", + "ping_proxied_server.go", + "pour.go", + "preflight.go", + "prime.go", + "prime_divergence.go", + "prime_proxied_server.go", + "priority.go", + "promote.go", + "promote_proxied_server.go", + "prompt.go", + "provenance.go", + "proxied_maintenance.go", + "proxied_server.go", + "proxy_capability.go", + "proxy_topology.go", + "prune.go", + "purge.go", + "purge_proxied_server.go", + "query.go", + "query_proxied_server.go", + "quick.go", + "quick_proxied_server.go", + "quickstart.go", + "ready.go", + "ready_input.go", + "ready_proxied_server.go", + "reclaim.go", + "recompute_blocked.go", + "recompute_blocked_proxied_server.go", + "relate.go", + "relate_proxied_server.go", + "remote_migrate_gate.go", + "rename.go", + "rename_prefix.go", + "reopen.go", + "reopen_proxied_server.go", + "repo.go", + "reset.go", + "restore.go", + "routed.go", + "routing_read.go", + "rules.go", + "sandbox_unix.go", + "sandbox_windows.go", + "schema.go", + "schema_skew.go", + "search.go", + "search_proxied_server.go", + "send_metrics.go", + "serve.go", + "setup.go", + "ship.go", + "show.go", + "show_children.go", + "show_display.go", + "show_format.go", + "show_proxied_server.go", + "show_refs.go", + "show_thread.go", + "show_unit_helpers.go", + "sql.go", + "sql_proxied_server.go", + "stale.go", + "stale_proxied_server.go", + "state.go", + "status.go", + "status_proxied_server.go", + "statuses.go", + "statuses_proxied_server.go", + "storage_chain.go", + "store_factory.go", + "store_factory_nocgo.go", + "store_reopen.go", + "swarm.go", + "swarm_proxied_server.go", + "sync.go", + "sync_flags.go", + "sync_git.go", + "sync_push_pull.go", + "sync_remote.go", + "tag.go", + "telemetry_redact.go", + "template.go", + "test_guard_helpers.go", + "thanks.go", + "tips.go", + "todo.go", + "todo_proxied_server.go", + "tracker_store.go", + "types.go", + "types_proxied_server.go", + "unclaim.go", + "unclaim_proxied_server.go", + "undefer.go", + "uow_factory.go", + "update.go", + "update_description_guard.go", + "update_input.go", + "update_proxied_server.go", + "upgrade.go", + "vc.go", + "version.go", + "version_proxied_server.go", + "version_tracking.go", + "where.go", + "wisp.go", + "wisp_proxied_server.go", + "workspace_gate.go", + "worktree.go", + "worktree_cmd.go", + "worktree_remove_cmd.go", + "worktree_remove_git.go", + ], + embedsrcs = ["help_supplements/create_graph_plan.md"], + importpath = "github.com/steveyegge/beads/cmd/bd", + visibility = ["//visibility:private"], + deps = [ + "//:beads", + "//cmd/bd/doctor", + "//cmd/bd/doctor/fix", + "//cmd/bd/setup", + "//internal/ado", + "//internal/atomicfile", + "//internal/audit", + "//internal/beads", + "//internal/compact", + "//internal/config", + "//internal/configfile", + "//internal/debug", + "//internal/doltremote", + "//internal/doltserver", + "//internal/doltversion", + "//internal/eventsjournal", + "//internal/formula", + "//internal/git", + "//internal/githooksenv", + "//internal/github", + "//internal/gitlab", + "//internal/hooks", + "//internal/httpapi", + "//internal/jira", + "//internal/linear", + "//internal/lockfile", + "//internal/memoryapi", + "//internal/metrics", + "//internal/migration", + "//internal/migration/legacysqlite", + "//internal/molecules", + "//internal/notion", + "//internal/query", + "//internal/recipes", + "//internal/remotecache", + "//internal/routing", + "//internal/storage", + "//internal/storage/backends", + "//internal/storage/contextinfo", + "//internal/storage/dberrors", + "//internal/storage/dbproxy/proxy", + "//internal/storage/dbproxy/server", + "//internal/storage/dbproxy/util", + "//internal/storage/dolt", + "//internal/storage/doltutil", + "//internal/storage/domain", + "//internal/storage/domain/db", + "//internal/storage/embeddeddolt", + "//internal/storage/externaldeps", + "//internal/storage/fs", + "//internal/storage/git", + "//internal/storage/issueops", + "//internal/storage/kvkeys", + "//internal/storage/schema", + "//internal/storage/uow", + "//internal/storage/versioncontrolops", + "//internal/telemetry", + "//internal/templates/agents", + "//internal/timeparsing", + "//internal/tracker", + "//internal/types", + "//internal/ui", + "//internal/uimd", + "//internal/utils", + "//internal/validation", + "//internal/workapi", + "//internal/workspacegate", + "//internal/worktreeremove", + "//issueops", + "//memoryops", + "@com_github_anthropics_anthropic_sdk_go//:anthropic-sdk-go", + "@com_github_anthropics_anthropic_sdk_go//option", + "@com_github_burntsushi_toml//:toml", + "@com_github_charmbracelet_x_ansi//:ansi", + "@com_github_dolthub_dolt_go//libraries/doltcore/servercfg", + "@com_github_dolthub_dolt_go//libraries/utils/filesys", + "@com_github_go_sql_driver_mysql//:mysql", + "@com_github_invopop_jsonschema//:jsonschema", + "@com_github_spf13_cobra//:cobra", + "@com_github_spf13_pflag//:pflag", + "@com_github_spf13_viper//:viper", + "@com_github_subosito_gotenv//:gotenv", + "@in_gopkg_yaml_v3//:yaml_v3", + "@io_opentelemetry_go_otel//attribute", + "@io_opentelemetry_go_otel//codes", + "@io_opentelemetry_go_otel_trace//:trace", + "@land_charm_huh_v2//:huh", + "@land_charm_lipgloss_v2//:lipgloss", + "@org_golang_x_mod//semver", + "@org_golang_x_term//:term", + ] + select({ + "@rules_go//go/platform:android": [ + "@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_binary( + name = "bd", + embed = [":bd_lib"], + visibility = ["//visibility:public"], +) + +go_test( + name = "bd_test", + srcs = [ + "aaa_stdio_baseline_test.go", + "actor_test.go", + "ado_test.go", + "assign_fence_embedded_test.go", + "assign_fence_proxied_test.go", + "auto_import_upgrade_test.go", + "auto_import_upgrade_unit_test.go", + "autocommit_embedded_test.go", + "backend_registry_contract_test.go", + "backup_auto_test.go", + "backup_dolt_test.go", + "backup_embedded_test.go", + "backup_export_failure_test.go", + "backup_proxied_external_integration_test.go", + "backup_proxied_local_integration_test.go", + "backup_proxied_policy_test.go", + "backup_restore_test.go", + "backup_status_test.go", + "backup_test.go", + "batch_embedded_test.go", + "batch_parity_test.go", + "batch_test.go", + "blocked_embedded_test.go", + "blocked_proxied_integration_test.go", + "bootstrap_backend_guard_test.go", + "bootstrap_embedded_test.go", + "bootstrap_guard_test.go", + "bootstrap_noninteractive_test.go", + "bootstrap_registered_backend_test.go", + "bootstrap_test.go", + "bootstrap_worktree_test.go", + "branch_embedded_test.go", + "capability_registry_history_test.go", + "capability_registry_test.go", + "capability_registry_transform_test.go", + "cascade_parity_proxied_integration_test.go", + "children_embedded_test.go", + "children_test.go", + "claim_pools_embedded_test.go", + "close_embedded_test.go", + "close_gate_test.go", + "close_last_touched_test.go", + "close_proxied_integration_test.go", + "close_reason_file_test.go", + "close_routing_test.go", + "codex_hook_test.go", + "command_telemetry_test.go", + "comment_promote_embedded_test.go", + "comment_proxied_integration_test.go", + "comment_test.go", + "comments_cli_embedded_test.go", + "comments_test.go", + "compact_embedded_test.go", + "compact_gc_flag_test.go", + "compact_test.go", + "compact_tier2_embedded_test.go", + "completions_test.go", + "config_apply_test.go", + "config_drift_test.go", + "config_drift_windows_test.go", + "config_embedded_test.go", + "config_get_backup_enabled_embedded_test.go", + "config_get_backup_enabled_test.go", + "config_guard_test.go", + "config_isolation_regression_test.go", + "config_list_test.go", + "config_nodb_embedded_test.go", + "config_proxied_integration_test.go", + "config_setmany_test.go", + "config_show_kv_exclusion_test.go", + "config_show_test.go", + "config_side_effects_test.go", + "config_test.go", + "config_validate_key_test.go", + "config_worktree_test.go", + "conflicts_conclude_integration_test.go", + "conflicts_conclude_test.go", + "conflicts_test.go", + "context_binding_integration_test.go", + "context_binding_test.go", + "context_cmd_test.go", + "context_embedded_test.go", + "context_identity_test.go", + "context_proxied_integration_test.go", + "context_test.go", + "contributor_embedded_test.go", + "cook_qnt_test.go", + "cook_test.go", + "count_embedded_test.go", + "count_filter_test.go", + "count_proxied_integration_test.go", + "cpu_profile_test.go", + "create_atomic_test.go", + "create_deps_atomic_test.go", + "create_deps_test.go", + "create_dispatch_test.go", + "create_embedded_test.go", + "create_external_ref_test.go", + "create_form_test.go", + "create_input_test.go", + "create_labels_test.go", + "create_markdown_batch_test.go", + "create_notes_test.go", + "create_prefix_test.go", + "create_proxied_external_integration_test.go", + "create_proxied_integration_test.go", + "create_proxied_server_test.go", + "create_proxy_unrouted_embedded_test.go", + "create_repo_no_cwd_beads_embedded_test.go", + "create_repo_remote_url_preprun_test.go", + "create_routing_test.go", + "create_test.go", + "create_timestamp_precision_embedded_test.go", + "critical_paths_test.go", + "cross_mode_parity_harness_test.go", + "cursor_hook_test.go", + "database_name_test.go", + "db_proxy_child_test.go", + "defer_embedded_test.go", + "defer_proxied_integration_test.go", + "defer_wake_embedded_test.go", + "defer_wake_proxied_integration_test.go", + "delete_embedded_test.go", + "delete_input_test.go", + "delete_proxied_integration_test.go", + "delete_proxied_server_output_test.go", + "dep_batch_test.go", + "dep_bulk_role_test.go", + "dep_cycles_test.go", + "dep_edge_reader_test.go", + "dep_embedded_test.go", + "dep_list_cross_db_test.go", + "dep_proxied_integration_test.go", + "dep_relation_test.go", + "dep_test.go", + "dep_warning_test.go", + "dependency_hierarchy_embedded_test.go", + "dependency_hierarchy_test.go", + "diff_embedded_test.go", + "directory_flag_test.go", + "doctor_backend_guard_test.go", + "doctor_context_test.go", + "doctor_conventions_test.go", + "doctor_embedded_test.go", + "doctor_fix_order_test.go", + "doctor_fix_pending_migrations_test.go", + "doctor_health_smoke_test.go", + "doctor_health_test.go", + "doctor_init_diagnostics_cgo_test.go", + "doctor_max_rows_test.go", + "doctor_migrate_fix_test.go", + "doctor_mutation_gate_test.go", + "doctor_orchestrator_guard_test.go", + "doctor_repair_test.go", + "doctor_test.go", + "doctor_validate_test.go", + "dolt_autocommit_server_test.go", + "dolt_autocommit_test.go", + "dolt_autopush_test.go", + "dolt_clean_databases_purge_proxied_integration_test.go", + "dolt_clean_databases_purge_test.go", + "dolt_clean_databases_quote_test.go", + "dolt_embedded_test.go", + "dolt_help_auth_test.go", + "dolt_lifecycle_proxied_server_test.go", + "dolt_local_only_embedded_test.go", + "dolt_local_only_test.go", + "dolt_proxied_lifecycle_test.go", + "dolt_remote_add_test.go", + "dolt_remote_adopt_test.go", + "dolt_remote_json_test.go", + "dolt_remote_origin_guard_test.go", + "dolt_remote_remove_proxied_integration_test.go", + "dolt_remote_reset_data_embedded_test.go", + "dolt_remote_reset_data_test.go", + "dolt_stop_test.go", + "dolt_test.go", + "dolt_worktree_remote_test.go", + "duplicate_embedded_test.go", + "duplicates_embedded_test.go", + "duplicates_proxied_integration_test.go", + "duplicates_test.go", + "envfile_test.go", + "epic_embedded_test.go", + "epic_proxied_integration_test.go", + "epic_test.go", + "errors_test.go", + "events_autoprune_e2e_test.go", + "events_autoprune_proxied_test.go", + "events_delete_actor_e2e_test.go", + "events_golden_test.go", + "events_http_e2e_test.go", + "events_journal_activation_e2e_test.go", + "events_journal_construction_test.go", + "events_proxied_server_test.go", + "events_truncation_cli_test.go", + "events_watch_http_e2e_test.go", + "explicit_db_nodb_test.go", + "export_auto_max_rows_gate_test.go", + "export_auto_missing_store_test.go", + "export_auto_test.go", + "export_auto_wedge_heal_test.go", + "export_embedded_test.go", + "export_exclude_owner_test.go", + "export_max_rows_gate_test.go", + "export_proxied_integration_test.go", + "export_source_wisp_subset_test.go", + "export_test.go", + "external_ref_test.go", + "federation_embedded_test.go", + "feedback_test.go", + "field_mutation_proxied_integration_test.go", + "find_duplicates_embedded_test.go", + "find_duplicates_test.go", + "flags_test.go", + "flatten_embedded_test.go", + "formula_fixture_proxied_test.go", + "formula_help_test.go", + "formula_primitives_test.go", + "formula_schema_test.go", + "gate_check_proxied_integration_test.go", + "gate_discover_test.go", + "gate_embedded_test.go", + "gate_frontdoor_parity_integration_test.go", + "gate_lifecycle_proxied_integration_test.go", + "gate_routing_test.go", + "gate_test.go", + "gc_embedded_test.go", + "gc_prune_test.go", + "git_repo_template_test.go", + "gitlab_test.go", + "global_identity_integration_test.go", + "gomodcache_rehome_test.go", + "graph_apply_execution_test.go", + "graph_apply_execution_unit_test.go", + "graph_apply_test.go", + "graph_embedded_test.go", + "graph_export_test.go", + "graph_proxied_integration_test.go", + "graph_test.go", + "graph_visual_test.go", + "heartbeat_proxied_integration_test.go", + "help_all_test.go", + "helpers_test.go", + "history_embedded_test.go", + "history_full_hash_test.go", + "history_proxied_integration_test.go", + "history_remote_frontdoor_matrix_test.go", + "hooks_embedded_test.go", + "hooks_exec_composition_test.go", + "hooks_export_staged_deletion_test.go", + "hooks_export_worktree_test.go", + "hooks_guard_test.go", + "hooks_husky_test.go", + "hooks_marker_skip_test.go", + "hooks_post_merge_import_test.go", + "hooks_timeout_process_test.go", + "hooks_worktree_test.go", + "human_embedded_test.go", + "human_proxied_integration_test.go", + "human_test.go", + "identity_preview_gate_cgo_test.go", + "identity_preview_gate_test.go", + "identity_preview_refusal_test.go", + "import_chunking_embedded_test.go", + "import_chunking_test.go", + "import_embedded_test.go", + "import_from_jsonl_test.go", + "import_global_prefix_isolation_test.go", + "import_orphan_embedded_test.go", + "import_promoted_wisp_embedded_test.go", + "import_proxied_integration_test.go", + "import_shared_unit_test.go", + "import_sync_prefix_test.go", + "info_embedded_test.go", + "info_kv_exclusion_test.go", + "info_proxied_integration_test.go", + "info_test.go", + "init_commit_test.go", + "init_embedded_test.go", + "init_gateway_test.go", + "init_guard_test.go", + "init_hooks_test.go", + "init_metrics_test.go", + "init_mode_inherit_test.go", + "init_noninteractive_test.go", + "init_permissions_test.go", + "init_policy_test.go", + "init_proxied_if_missing_test.go", + "init_proxied_server_test.go", + "init_registered_backend_test.go", + "init_remote_test.go", + "init_safety_test.go", + "init_server_flags_test.go", + "init_stealth_test.go", + "init_team_server_test.go", + "init_test.go", + "init_worktree_test.go", + "jira_max_rows_gate_test.go", + "jira_test.go", + "kv_embedded_test.go", + "kv_proxied_integration_test.go", + "kv_test.go", + "label_embedded_test.go", + "label_list_all_test.go", + "label_normalization_test.go", + "label_proxied_integration_test.go", + "label_test.go", + "label_whitespace_warn_test.go", + "last_touched_guard_test.go", + "last_touched_test.go", + "legacy_upgrade_guard_config_yaml_test.go", + "legacy_upgrade_guard_e2e_test.go", + "legacy_upgrade_guard_test.go", + "legacy_upgrade_guard_witness_test.go", + "linear_test.go", + "lint_embedded_test.go", + "lint_stale_proxied_integration_test.go", + "list_embedded_test.go", + "list_footer_counts_test.go", + "list_format_json_test.go", + "list_helpers_test.go", + "list_limit_policy_test.go", + "list_output_test.go", + "list_proxied_integration_test.go", + "list_proxied_watch_max_rows_test.go", + "list_ready_brief_test.go", + "list_roles_test.go", + "list_skip_labels_test.go", + "list_test.go", + "list_tree_deps_test.go", + "list_wisp_type_reachability_test.go", + "lite_filter_spy_test.go", + "main_config_debug_test.go", + "main_errors_test.go", + "main_test.go", + "maintenance_commands_proxied_integration_test.go", + "markdown_test.go", + "max_rows_test.go", + "memory_embedded_test.go", + "memory_proxied_integration_test.go", + "memory_pure_test.go", + "messaging_test.go", + "metadata_edits_test.go", + "metadata_filter_test.go", + "metadata_flag_test.go", + "metadata_ready_test.go", + "metadataless_server_workspace_test.go", + "metrics_test.go", + "migrate_dolt_mode_test.go", + "migrate_embedded_test.go", + "migrate_force_test.go", + "migrate_hooks_apply_test.go", + "migrate_hooks_test.go", + "migrate_issues_max_rows_gate_test.go", + "migrate_personal_test.go", + "migrate_repo_id_notice_test.go", + "migrate_schema_identity_order_test.go", + "migrate_test.go", + "migration_freeze_gate_test.go", + "mol_bond_compound_label_test.go", + "mol_bond_gwn_test.go", + "mol_bond_proxied_integration_test.go", + "mol_bond_test.go", + "mol_burn_proxied_integration_test.go", + "mol_current_proxied_integration_test.go", + "mol_distill_proxied_integration_test.go", + "mol_distill_test.go", + "mol_embedded_test.go", + "mol_frontdoor_managed_local_integration_test.go", + "mol_frontdoor_parity_integration_test.go", + "mol_last_activity_proxied_integration_test.go", + "mol_progress_proxied_integration_test.go", + "mol_ready_gated_flag_test.go", + "mol_ready_gated_proxied_integration_test.go", + "mol_ready_gated_test.go", + "mol_show_proxied_integration_test.go", + "mol_squash_embedded_test.go", + "mol_squash_proxied_integration_test.go", + "mol_stale_proxied_integration_test.go", + "mol_test.go", + "mol_wisp_proxied_var_validation_test.go", + "no_color_test.go", + "nocow_linux_test.go", + "nocow_test.go", + "note_test.go", + "notion_store_test.go", + "notion_test.go", + "onboard_embedded_test.go", + "onboard_test.go", + "orphans_embedded_test.go", + "orphans_proxied_integration_test.go", + "orphans_test.go", + "output_test.go", + "pour_proxied_integration_test.go", + "pour_wisp_var_validation_test.go", + "preflight_test.go", + "prime_divergence_test.go", + "prime_embedded_test.go", + "prime_gemini_hook_test.go", + "prime_memory_caps_test.go", + "prime_proxied_integration_test.go", + "prime_test.go", + "promote_embedded_test.go", + "promote_proxied_integration_test.go", + "prompt_test.go", + "provenance_test.go", + "proxied_direct_only_refusal_frontdoor_test.go", + "proxied_integration_helpers_test.go", + "proxied_local_dolt_lifecycle_test.go", + "proxied_local_helpers_test.go", + "proxied_local_identity_lifecycle_linux_test.go", + "proxied_local_lifecycle_linux_test.go", + "proxied_local_listener_policy_linux_test.go", + "proxied_lookup_failure_test.go", + "proxied_outage_reconnect_integration_test.go", + "proxied_server_test.go", + "proxied_shared_harness_test.go", + "proxied_workflow_refusal_frontdoor_test.go", + "proxy_capability_test.go", + "prune_embedded_test.go", + "prune_proxied_integration_test.go", + "purge_embedded_test.go", + "purge_test.go", + "query_embedded_test.go", + "query_limit_policy_test.go", + "query_proxied_integration_test.go", + "quick_embedded_test.go", + "quick_todo_proxied_integration_test.go", + "quickstart_embedded_test.go", + "race_detector_off_test.go", + "race_detector_on_test.go", + "readonly_policy_test.go", + "readonly_test.go", + "ready_embedded_test.go", + "ready_input_test.go", + "ready_max_rows_proxied_test.go", + "ready_max_rows_test.go", + "ready_proxied_integration_test.go", + "ready_role_request_test.go", + "ready_test.go", + "ready_wisp_proxied_integration_test.go", + "reclaim_test.go", + "recompute_blocked_proxied_integration_test.go", + "registered_backend_workspace_paths_test.go", + "relate_proxied_integration_test.go", + "relate_test.go", + "relational_proxied_integration_test.go", + "remote_migrate_gate_test.go", + "remote_sync_open_test.go", + "removed_backend_heal_embedded_test.go", + "rename_prefix_embedded_test.go", + "rename_prefix_repair_test.go", + "rename_prefix_rewrite_test.go", + "rename_prefix_test.go", + "rename_prefix_worktree_test.go", + "reopen_embedded_test.go", + "reopen_proxied_integration_test.go", + "reopen_test.go", + "repair_deps_test.go", + "reset_global_guard_test.go", + "reset_hook_ownership_test.go", + "reset_worktree_test.go", + "resolve_dolt_server_connection_test.go", + "restore_embedded_test.go", + "restore_test.go", + "root_context_lifecycle_test.go", + "routed_test.go", + "routing_notice_test.go", + "routing_read_test.go", + "rules_test.go", + "sandbox_test.go", + "schema_skew_test.go", + "schema_test.go", + "search_embedded_test.go", + "search_proxied_integration_test.go", + "search_test.go", + "serve_batch_close_proxied_integration_test.go", + "serve_claim_next_proxied_integration_test.go", + "serve_claim_proxied_integration_test.go", + "serve_close_proxied_integration_test.go", + "serve_comment_proxied_integration_test.go", + "serve_config_write_proxied_integration_test.go", + "serve_count_proxied_integration_test.go", + "serve_create_proxied_integration_test.go", + "serve_delete_proxied_integration_test.go", + "serve_dependencies_proxied_integration_test.go", + "serve_edge_counts_proxied_integration_test.go", + "serve_inprocess_test.go", + "serve_list_sort_proxied_integration_test.go", + "serve_proxied_integration_test.go", + "serve_read_revision_proxied_integration_test.go", + "serve_reads_parity_integration_test.go", + "serve_registered_backend_test.go", + "serve_related_proxied_integration_test.go", + "serve_release_proxied_integration_test.go", + "serve_server_mode_integration_test.go", + "serve_source_test.go", + "serve_store_identity_test.go", + "serve_test.go", + "serve_update_proxied_integration_test.go", + "set_state_proxied_integration_test.go", + "setup_embedded_test.go", + "setup_test.go", + "shared_migrate_consent_test.go", + "shared_server_cfgnil_test.go", + "shared_server_cleanup_test.go", + "shared_server_integration_test.go", + "shared_store_migrate_gate_test.go", + "ship_embedded_test.go", + "show_brief_deps_test.go", + "show_current_test.go", + "show_details_json_test.go", + "show_embedded_test.go", + "show_format_metadata_test.go", + "show_not_found_hint_test.go", + "show_proxied_integration_test.go", + "show_proxied_reader_test.go", + "show_unit_helpers_test.go", + "show_watch_test.go", + "simple_helpers_test.go", + "skip_store_annotation_test.go", + "sql_multistatement_proxied_integration_test.go", + "sql_multistatement_test.go", + "sql_proxied_integration_test.go", + "sql_test.go", + "stale_embedded_test.go", + "stale_test.go", + "state_embedded_test.go", + "state_proxied_integration_test.go", + "state_test.go", + "status_embedded_test.go", + "status_proxied_integration_test.go", + "status_test.go", + "statuses_types_proxied_integration_test.go", + "stdio_race_guard_test.go", + "storage_chain_test.go", + "storage_class_embedded_test.go", + "storage_class_proxied_integration_test.go", + "storage_class_pure_test.go", + "store_factory_nocgo_test.go", + "store_factory_test.go", + "store_reopen_embedded_resolution_test.go", + "store_reopen_test.go", + "store_selection_failloud_nocgo_test.go", + "store_selection_failloud_test.go", + "store_selection_removed_backend_test.go", + "suite_temp_test.go", + "supersede_embedded_test.go", + "swarm_embedded_test.go", + "swarm_proxied_integration_test.go", + "swarm_ready_fronts_test.go", + "sync_git_test.go", + "sync_is_scoped_test.go", + "sync_issues_flag_test.go", + "sync_parent_flag_test.go", + "sync_push_pull_test.go", + "sync_remote_fixture_test.go", + "sync_remote_test.go", + "sync_test.go", + "telemetry_scrub_test.go", + "template_test.go", + "test_dolt_server_cgo_test.go", + "test_helpers_pure_test.go", + "test_helpers_test.go", + "test_repo_beads_guard_darwin_test.go", + "test_repo_beads_guard_test.go", + "test_wait_helper_test.go", + "thread_test.go", + "tips_example_test.go", + "tips_test.go", + "todo_embedded_test.go", + "tracker_frontdoor_proxy_test.go", + "tracker_proxy_uow_conformance_integration_test.go", + "types_embedded_test.go", + "unclaim_conditional_embedded_test.go", + "unclaim_conditional_parity_test.go", + "unclaim_embedded_test.go", + "unclaim_proxied_integration_test.go", + "unclaim_test.go", + "undefer_embedded_test.go", + "uninstall_config_test.go", + "uow_factory_server_mode_test.go", + "uow_factory_test.go", + "update_claim_proxied_test.go", + "update_close_policy_proxied_integration_test.go", + "update_close_policy_test.go", + "update_conditional_embedded_test.go", + "update_conditional_proxied_test.go", + "update_description_guard_test.go", + "update_embedded_test.go", + "update_lifecycle_test.go", + "update_metadata_test.go", + "update_multi_id_exit_test.go", + "update_notes_warning_test.go", + "update_proxied_integration_test.go", + "update_proxied_server_test.go", + "update_stray_positional_test.go", + "user_config_path_windows_test.go", + "utils_unit_test.go", + "vc_embedded_test.go", + "vc_recompute_test.go", + "vc_test.go", + "verbosity_quiet_embedded_test.go", + "version_embedded_test.go", + "version_test.go", + "version_tracking_test.go", + "where_cgo_test.go", + "where_embedded_test.go", + "where_test.go", + "wisp_gc_active_embedded_test.go", + "wisp_gc_purge_closed_embedded_test.go", + "wisp_proxied_integration_test.go", + "wisp_test.go", + "workspace_gate_test.go", + "workspace_identity_test.go", + "worktree_cmd_test.go", + "worktree_permissions_test.go", + "worktree_remove_cmd_test.go", + "worktree_remove_git_test.go", + "worktree_remove_git_windows_test.go", + "worktree_remove_test.go", + "worktree_remove_windows_test.go", + "worktree_test.go", + "write_verbs_parity_test.go", + "zz_stdio_leak_guard_test.go", + ], + data = glob(["testdata/**"]), + embed = [":bd_lib"], + deps = [ + "//:beads", + "//cmd/bd/doctor", + "//internal/ado", + "//internal/beads", + "//internal/config", + "//internal/configfile", + "//internal/debug", + "//internal/doltremote", + "//internal/doltserver", + "//internal/eventsjournal", + "//internal/formula", + "//internal/git", + "//internal/hooks", + "//internal/httpapi", + "//internal/linear", + "//internal/metrics", + "//internal/migration", + "//internal/molecules", + "//internal/notion", + "//internal/procid", + "//internal/recipes", + "//internal/routing", + "//internal/storage", + "//internal/storage/backends", + "//internal/storage/contextinfo", + "//internal/storage/dbproxy/pidfile", + "//internal/storage/dbproxy/proxy", + "//internal/storage/dbproxy/server", + "//internal/storage/dbproxy/util", + "//internal/storage/depid", + "//internal/storage/dolt", + "//internal/storage/doltutil", + "//internal/storage/domain", + "//internal/storage/embeddeddolt", + "//internal/storage/externaldeps", + "//internal/storage/issueops", + "//internal/storage/journalscan", + "//internal/storage/kvkeys", + "//internal/storage/schema", + "//internal/storage/uow", + "//internal/storage/versioncontrolops", + "//internal/telemetry", + "//internal/testutil", + "//internal/tracker", + "//internal/types", + "//internal/ui", + "//internal/uimd", + "//internal/utils", + "//internal/workapi", + "//internal/workspacegate", + "//internal/worktreeremove", + "//issueops", + "//memoryops", + "@com_github_charmbracelet_x_ansi//:ansi", + "@com_github_data_dog_go_sqlmock//:go-sqlmock", + "@com_github_dolthub_dolt_go//libraries/doltcore/servercfg", + "@com_github_dolthub_dolt_go//libraries/utils/filesys", + "@com_github_dolthub_dolt_go//store/blobstore", + "@com_github_go_sql_driver_mysql//:mysql", + "@com_github_spf13_cobra//:cobra", + "@com_github_spf13_pflag//:pflag", + "@com_github_stretchr_testify//assert", + "@com_github_stretchr_testify//require", + "@land_charm_lipgloss_v2//:lipgloss", + "@org_golang_x_sync//errgroup", + "@org_golang_x_term//:term", + ] + select({ + "@rules_go//go/platform:aix": [ + "//internal/tracker/conformance", + ], + "@rules_go//go/platform:android": [ + "//internal/tracker/conformance", + ], + "@rules_go//go/platform:darwin": [ + "//internal/tracker/conformance", + ], + "@rules_go//go/platform:dragonfly": [ + "//internal/tracker/conformance", + ], + "@rules_go//go/platform:freebsd": [ + "//internal/tracker/conformance", + ], + "@rules_go//go/platform:illumos": [ + "//internal/tracker/conformance", + ], + "@rules_go//go/platform:ios": [ + "//internal/tracker/conformance", + ], + "@rules_go//go/platform:linux": [ + "//internal/tracker/conformance", + ], + "@rules_go//go/platform:netbsd": [ + "//internal/tracker/conformance", + ], + "@rules_go//go/platform:openbsd": [ + "//internal/tracker/conformance", + ], + "@rules_go//go/platform:solaris": [ + "//internal/tracker/conformance", + ], + "@rules_go//go/platform:windows": [ + "@org_golang_x_sys//windows", + ], + "//conditions:default": [], + }), +) diff --git a/cmd/bd/doctor/BUILD.bazel b/cmd/bd/doctor/BUILD.bazel new file mode 100644 index 000000000..29f3ad144 --- /dev/null +++ b/cmd/bd/doctor/BUILD.bazel @@ -0,0 +1,164 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "doctor", + srcs = [ + "agent.go", + "artifacts.go", + "backend.go", + "blocked.go", + "circuit.go", + "claude.go", + "clone_local_fks.go", + "config_values.go", + "cross_table.go", + "cursor.go", + "database.go", + "deep.go", + "dep_keys.go", + "dependency_sql.go", + "dolt.go", + "federation.go", + "fresh_clone_server.go", + "git.go", + "gitignore.go", + "hooks_migration.go", + "installation.go", + "integrity.go", + "kv.go", + "label_whitespace.go", + "legacy.go", + "locks.go", + "maintenance.go", + "managed_handoff.go", + "migration.go", + "migration_skew.go", + "migration_validation.go", + "multirepo.go", + "nocow.go", + "nocow_linux.go", + "nocow_other.go", + "perf.go", + "perf_dolt.go", + "quick.go", + "remotes.go", + "role.go", + "server.go", + "shared_store.go", + "suppress.go", + "tracked_runtime.go", + "types.go", + "validation.go", + "version.go", + ], + importpath = "github.com/steveyegge/beads/cmd/bd/doctor", + visibility = ["//visibility:public"], + deps = [ + "//cmd/bd/doctor/fix", + "//cmd/bd/setup", + "//internal/beads", + "//internal/config", + "//internal/configfile", + "//internal/doltremote", + "//internal/doltserver", + "//internal/git", + "//internal/storage", + "//internal/storage/dberrors", + "//internal/storage/dolt", + "//internal/storage/doltutil", + "//internal/storage/embeddeddolt", + "//internal/storage/issueops", + "//internal/storage/kvkeys", + "//internal/storage/schema", + "//internal/types", + "//internal/utils", + "@com_github_go_sql_driver_mysql//:mysql", + "@com_github_spf13_viper//:viper", + "@in_gopkg_yaml_v3//:yaml_v3", + ] + select({ + "@rules_go//go/platform:android": [ + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:linux": [ + "@org_golang_x_sys//unix", + ], + "//conditions:default": [], + }), +) + +go_test( + name = "doctor_test", + srcs = [ + "agent_test.go", + "artifacts_test.go", + "bare_parent_fallback_test.go", + "claude_test.go", + "config_values_test.go", + "cursor_test.go", + "database_test.go", + "deep_test.go", + "dependency_sql_test.go", + "doctor_worktree_test.go", + "dolt_e2e_test.go", + "dolt_phantom_test.go", + "dolt_test.go", + "federation_test.go", + "fresh_clone_server_test.go", + "git_hygiene_test.go", + "git_repo_template_test.go", + "git_test.go", + "git_test_helpers_test.go", + "gitignore_test.go", + "hooks_migration_test.go", + "hooks_path_test.go", + "installation_test.go", + "integrity_cycles_db_test.go", + "integrity_cycles_mock_test.go", + "integrity_cycles_test.go", + "integrity_path_cgo_test.go", + "integrity_test.go", + "legacy_test.go", + "locks_test.go", + "maintenance_cgo_test.go", + "maintenance_test.go", + "managed_handoff_test.go", + "migration_hooks_test.go", + "migration_skew_dolt_test.go", + "migration_skew_embedded_test.go", + "migration_skew_test.go", + "migration_test.go", + "migration_validation_test.go", + "multirepo_test.go", + "nocow_test.go", + "perf_dolt_test.go", + "quick_test.go", + "role_test.go", + "server_backend_test.go", + "server_test.go", + "shared_store_test.go", + "suite_temp_test.go", + "suppress_test.go", + "test_helpers_test.go", + "testmain_nocgo_test.go", + "tracked_runtime_test.go", + "types_test.go", + "validation_test.go", + "version_test.go", + ], + embed = [":doctor"], + deps = [ + "//internal/beads", + "//internal/configfile", + "//internal/doltserver", + "//internal/git", + "//internal/storage/dolt", + "//internal/storage/doltutil", + "//internal/storage/embeddeddolt", + "//internal/storage/issueops", + "//internal/testutil", + "//internal/types", + "//internal/utils", + "@com_github_data_dog_go_sqlmock//:go-sqlmock", + "@com_github_go_sql_driver_mysql//:mysql", + ], +) diff --git a/cmd/bd/doctor/fix/BUILD.bazel b/cmd/bd/doctor/fix/BUILD.bazel new file mode 100644 index 000000000..9d7c15dc8 --- /dev/null +++ b/cmd/bd/doctor/fix/BUILD.bazel @@ -0,0 +1,97 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "fix", + srcs = [ + "artifacts.go", + "blocked.go", + "clone_local_fks.go", + "common.go", + "config_values.go", + "database_config.go", + "database_integrity.go", + "dep_keys.go", + "dependency_sql.go", + "dolt_format.go", + "fs.go", + "hooks.go", + "label_whitespace.go", + "locks.go", + "maintenance.go", + "metadata.go", + "metadata_json.go", + "migrate.go", + "permissions.go", + "remotes.go", + "repo_fingerprint.go", + "store.go", + "untracked.go", + "validation.go", + ], + importpath = "github.com/steveyegge/beads/cmd/bd/doctor/fix", + visibility = ["//visibility:public"], + deps = [ + "//internal/beads", + "//internal/configfile", + "//internal/doltserver", + "//internal/eventsjournal", + "//internal/storage", + "//internal/storage/depid", + "//internal/storage/dolt", + "//internal/storage/doltutil", + "//internal/storage/issueops", + "//internal/types", + "//internal/utils", + "@com_github_burntsushi_toml//:toml", + "@com_github_go_sql_driver_mysql//:mysql", + "@in_gopkg_yaml_v3//:yaml_v3", + ], +) + +go_test( + name = "fix_test", + srcs = [ + "artifacts_test.go", + "clone_local_fks_cgo_test.go", + "common_test.go", + "database_config_test.go", + "database_integrity_test.go", + "dep_keys_test.go", + "dependency_sql_test.go", + "e2e_test.go", + "fix_edge_cases_test.go", + "fix_test.go", + "fs_test.go", + "git_repo_template_test.go", + "hooks_test.go", + "journal_cgo_test.go", + "label_whitespace_test.go", + "locks_test.go", + "maintenance_cgo_test.go", + "maintenance_test.go", + "metadata_dolt_test.go", + "metadata_probe_test.go", + "metadata_test.go", + "migrate_import_test.go", + "remotes_test.go", + "repo_fingerprint_test.go", + "suite_temp_test.go", + "symlink_test.go", + "testmain_cgo_test.go", + "testmain_nocgo_test.go", + "validation_test.go", + ], + embed = [":fix"], + deps = [ + "//internal/configfile", + "//internal/doltserver", + "//internal/storage/depid", + "//internal/storage/dolt", + "//internal/storage/doltutil", + "//internal/storage/issueops", + "//internal/testutil", + "//internal/types", + "@com_github_data_dog_go_sqlmock//:go-sqlmock", + "@com_github_go_sql_driver_mysql//:mysql", + ], +) diff --git a/cmd/bd/protocol/BUILD.bazel b/cmd/bd/protocol/BUILD.bazel new file mode 100644 index 000000000..321f32fab --- /dev/null +++ b/cmd/bd/protocol/BUILD.bazel @@ -0,0 +1,49 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "protocol", + srcs = ["corpus.go"], + importpath = "github.com/steveyegge/beads/cmd/bd/protocol", + visibility = ["//visibility:public"], +) + +go_test( + name = "protocol_test", + srcs = [ + "assignee_test.go", + "blocked_status_test.go", + "blocked_test.go", + "blocking_semantics_test.go", + "canonicalize_test.go", + "child_id_test.go", + "children_test.go", + "close_guard_test.go", + "comments_test.go", + "corpus_test.go", + "defer_test.go", + "dep_identity_test.go", + "errors_contract_test.go", + "exit_codes_init_test.go", + "exit_codes_test.go", + "helpers_test.go", + "input_validation_test.go", + "interchange_test.go", + "json_contract_test.go", + "lease_claim_test.go", + "lifecycle_test.go", + "memory_contract_test.go", + "preservation_test.go", + "ready_front_test.go", + "roundtrip_test.go", + "stale_test.go", + "status_validation_test.go", + "versioning_contract_test.go", + "wp4_helpers_test.go", + ], + data = glob(["testdata/**"]), + embed = [":protocol"], + deps = [ + "//internal/storage/schema", + "//internal/testutil", + ], +) diff --git a/cmd/bd/setup/BUILD.bazel b/cmd/bd/setup/BUILD.bazel new file mode 100644 index 000000000..9d195a79a --- /dev/null +++ b/cmd/bd/setup/BUILD.bazel @@ -0,0 +1,56 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "setup", + srcs = [ + "agent_skill.go", + "agents.go", + "aider.go", + "claude.go", + "codex.go", + "constants.go", + "cursor.go", + "exit.go", + "factory.go", + "gemini.go", + "hooks_json.go", + "junie.go", + "mux.go", + "opencode.go", + "setup_test_helpers.go", + "utils.go", + ], + importpath = "github.com/steveyegge/beads/cmd/bd/setup", + visibility = ["//visibility:public"], + deps = [ + "//internal/config", + "//internal/recipes", + "//internal/templates", + "//internal/templates/agents", + "//internal/utils", + ], +) + +go_test( + name = "setup_test", + srcs = [ + "agents_marker_test.go", + "aider_test.go", + "claude_test.go", + "codex_test.go", + "cursor_test.go", + "factory_test.go", + "gemini_test.go", + "junie_test.go", + "mux_test.go", + "opencode_test.go", + "plugin_layout_test.go", + "utils_test.go", + ], + embed = [":setup"], + deps = [ + "//internal/templates", + "//internal/templates/agents", + "@in_gopkg_yaml_v3//:yaml_v3", + ], +) diff --git a/format/BUILD.bazel b/format/BUILD.bazel new file mode 100644 index 000000000..3f6bc1da5 --- /dev/null +++ b/format/BUILD.bazel @@ -0,0 +1,19 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "format", + srcs = ["format.go"], + importpath = "github.com/steveyegge/beads/format", + visibility = ["//visibility:public"], + deps = [ + "//internal/types", + "//internal/ui", + ], +) + +go_test( + name = "format_test", + srcs = ["format_test.go"], + embed = [":format"], + deps = ["//internal/types"], +) diff --git a/internal/ado/BUILD.bazel b/internal/ado/BUILD.bazel new file mode 100644 index 000000000..bdfc59ce1 --- /dev/null +++ b/internal/ado/BUILD.bazel @@ -0,0 +1,51 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "ado", + srcs = [ + "bootstrap.go", + "client.go", + "fieldmapper.go", + "links.go", + "mapping.go", + "reconcile.go", + "richtext.go", + "statetransition.go", + "tracker.go", + "types.go", + ], + importpath = "github.com/steveyegge/beads/internal/ado", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/config", + "//internal/storage", + "//internal/tracker", + "//internal/types", + "@com_github_johanneskaufmann_html_to_markdown_v2//:html-to-markdown", + "@com_github_microcosm_cc_bluemonday//:bluemonday", + "@com_github_yuin_goldmark//:goldmark", + "@com_github_yuin_goldmark//renderer/html", + ], +) + +go_test( + name = "ado_test", + srcs = [ + "bootstrap_test.go", + "client_test.go", + "links_test.go", + "mapping_test.go", + "reconcile_test.go", + "richtext_test.go", + "statetransition_test.go", + "tracker_test.go", + "types_test.go", + ], + embed = [":ado"], + deps = [ + "//internal/config", + "//internal/storage", + "//internal/tracker", + "//internal/types", + ], +) diff --git a/internal/atomicfile/BUILD.bazel b/internal/atomicfile/BUILD.bazel new file mode 100644 index 000000000..bc13a8982 --- /dev/null +++ b/internal/atomicfile/BUILD.bazel @@ -0,0 +1,14 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "atomicfile", + srcs = ["atomicfile.go"], + importpath = "github.com/steveyegge/beads/internal/atomicfile", + visibility = ["//:__subpackages__"], +) + +go_test( + name = "atomicfile_test", + srcs = ["atomicfile_test.go"], + embed = [":atomicfile"], +) diff --git a/internal/audit/BUILD.bazel b/internal/audit/BUILD.bazel new file mode 100644 index 000000000..7173c27c1 --- /dev/null +++ b/internal/audit/BUILD.bazel @@ -0,0 +1,21 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "audit", + srcs = ["audit.go"], + importpath = "github.com/steveyegge/beads/internal/audit", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/beads", + "//internal/config", + ], +) + +go_test( + name = "audit_test", + srcs = [ + "audit_test.go", + "concurrency_test.go", + ], + embed = [":audit"], +) diff --git a/internal/beads/BUILD.bazel b/internal/beads/BUILD.bazel new file mode 100644 index 000000000..94bdfadff --- /dev/null +++ b/internal/beads/BUILD.bazel @@ -0,0 +1,43 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "beads", + srcs = [ + "beads.go", + "context.go", + "fingerprint.go", + ], + importpath = "github.com/steveyegge/beads/internal/beads", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/configfile", + "//internal/git", + "//internal/storage", + "//internal/storage/backends", + "//internal/utils", + ], +) + +go_test( + name = "beads_test", + srcs = [ + "beads_coverage_test.go", + "beads_inherited_artifacts_test.go", + "beads_test.go", + "context_test.go", + "cwd_priority_test.go", + "fingerprint_test.go", + "sqlite_database_path_test.go", + "suite_temp_test.go", + "testmain_default_test.go", + "testmain_test.go", + ], + embed = [":beads"], + deps = [ + "//internal/configfile", + "//internal/doltserver", + "//internal/git", + "//internal/testutil", + "//internal/utils", + ], +) diff --git a/internal/compact/BUILD.bazel b/internal/compact/BUILD.bazel new file mode 100644 index 000000000..4eeae10e3 --- /dev/null +++ b/internal/compact/BUILD.bazel @@ -0,0 +1,39 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "compact", + srcs = [ + "compactor.go", + "git.go", + "haiku.go", + ], + importpath = "github.com/steveyegge/beads/internal/compact", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/audit", + "//internal/beads", + "//internal/config", + "//internal/telemetry", + "//internal/types", + "@com_github_anthropics_anthropic_sdk_go//:anthropic-sdk-go", + "@com_github_anthropics_anthropic_sdk_go//option", + "@io_opentelemetry_go_otel//attribute", + "@io_opentelemetry_go_otel//codes", + "@io_opentelemetry_go_otel_metric//:metric", + ], +) + +go_test( + name = "compact_test", + srcs = [ + "compactor_unit_test.go", + "git_test.go", + "haiku_test.go", + ], + embed = [":compact"], + deps = [ + "//internal/config", + "//internal/types", + "@com_github_anthropics_anthropic_sdk_go//:anthropic-sdk-go", + ], +) diff --git a/internal/config/BUILD.bazel b/internal/config/BUILD.bazel new file mode 100644 index 000000000..4ac0fd486 --- /dev/null +++ b/internal/config/BUILD.bazel @@ -0,0 +1,65 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "config", + srcs = [ + "agent_profile.go", + "config.go", + "permissions.go", + "permissions_open_linux.go", + "permissions_open_nonlinux.go", + "permissions_windows.go", + "repos.go", + "sync.go", + "user_config_path.go", + "yaml_config.go", + ], + importpath = "github.com/steveyegge/beads/internal/config", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/debug", + "@com_github_spf13_viper//:viper", + "@in_gopkg_yaml_v3//:yaml_v3", + ] + select({ + "@rules_go//go/platform:android": [ + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:linux": [ + "@org_golang_x_sys//unix", + ], + "//conditions:default": [], + }), +) + +go_test( + name = "config_test", + srcs = [ + "agents_file_test.go", + "config_test.go", + "permissions_linux_test.go", + "permissions_test.go", + "repos_test.go", + "sync_test.go", + "testmain_test.go", + "user_config_path_test.go", + "user_config_path_windows_test.go", + "worktree_config_test.go", + "yaml_config_test.go", + "yaml_nested_roundtrip_test.go", + "yaml_unset_newline_test.go", + ], + embed = [":config"], + deps = [ + "//internal/git", + "@com_github_spf13_viper//:viper", + "@in_gopkg_yaml_v3//:yaml_v3", + ] + select({ + "@rules_go//go/platform:android": [ + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:linux": [ + "@org_golang_x_sys//unix", + ], + "//conditions:default": [], + }), +) diff --git a/internal/configfile/BUILD.bazel b/internal/configfile/BUILD.bazel new file mode 100644 index 000000000..fdfb88536 --- /dev/null +++ b/internal/configfile/BUILD.bazel @@ -0,0 +1,34 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "configfile", + srcs = [ + "backend_messages.go", + "central_config.go", + "configfile.go", + "credentials.go", + "credentials_unix.go", + "credentials_windows.go", + "external_dolt_config.go", + "proxied_server_client_info.go", + ], + importpath = "github.com/steveyegge/beads/internal/configfile", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/config", + "//internal/storage/backendnames", + ], +) + +go_test( + name = "configfile_test", + srcs = [ + "backend_messages_test.go", + "central_config_test.go", + "configfile_test.go", + "credentials_test.go", + "external_dolt_config_test.go", + ], + embed = [":configfile"], + deps = ["//internal/config"], +) diff --git a/internal/creds/BUILD.bazel b/internal/creds/BUILD.bazel new file mode 100644 index 000000000..f0fb4c241 --- /dev/null +++ b/internal/creds/BUILD.bazel @@ -0,0 +1,20 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "creds", + srcs = [ + "command.go", + "creds.go", + ], + importpath = "github.com/steveyegge/beads/internal/creds", + visibility = ["//:__subpackages__"], +) + +go_test( + name = "creds_test", + srcs = [ + "command_test.go", + "creds_test.go", + ], + embed = [":creds"], +) diff --git a/internal/debug/BUILD.bazel b/internal/debug/BUILD.bazel new file mode 100644 index 000000000..27accb99b --- /dev/null +++ b/internal/debug/BUILD.bazel @@ -0,0 +1,14 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "debug", + srcs = ["debug.go"], + importpath = "github.com/steveyegge/beads/internal/debug", + visibility = ["//:__subpackages__"], +) + +go_test( + name = "debug_test", + srcs = ["debug_test.go"], + embed = [":debug"], +) diff --git a/internal/doltremote/BUILD.bazel b/internal/doltremote/BUILD.bazel new file mode 100644 index 000000000..541e39c79 --- /dev/null +++ b/internal/doltremote/BUILD.bazel @@ -0,0 +1,8 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "doltremote", + srcs = ["remote.go"], + importpath = "github.com/steveyegge/beads/internal/doltremote", + visibility = ["//:__subpackages__"], +) diff --git a/internal/doltserver/BUILD.bazel b/internal/doltserver/BUILD.bazel new file mode 100644 index 000000000..70e9302ab --- /dev/null +++ b/internal/doltserver/BUILD.bazel @@ -0,0 +1,83 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "doltserver", + srcs = [ + "doltserver.go", + "doltserver_unix.go", + "doltserver_windows.go", + "gc_config.go", + "logrotate.go", + "manifest_recovery.go", + "physical_root.go", + "probe.go", + "procattr_linux.go", + "procattr_other_unix.go", + "servermode.go", + "sweep.go", + "sweep_darwin.go", + "sweep_linux.go", + "sweep_other.go", + "sweep_reap_unix.go", + "sweep_suite.go", + "sweep_suite_other.go", + "sweep_suite_unix.go", + ], + importpath = "github.com/steveyegge/beads/internal/doltserver", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/config", + "//internal/configfile", + "//internal/debug", + "//internal/fdhygiene", + "//internal/githooksenv", + "//internal/gittraceenv", + "//internal/lockfile", + "//internal/storage/doltutil", + "@com_github_dolthub_dolt_go//libraries/doltcore/servercfg", + "@com_github_dolthub_dolt_go//libraries/utils/filesys", + "@com_github_go_sql_driver_mysql//:mysql", + "@in_gopkg_yaml_v3//:yaml_v3", + ] + select({ + "@rules_go//go/platform:windows": [ + "@org_golang_x_sys//windows", + ], + "//conditions:default": [], + }), +) + +go_test( + name = "doltserver_test", + srcs = [ + "configport_test.go", + "doltserver_test.go", + "doltserver_unix_test.go", + "doltserver_windows_test.go", + "gc_config_test.go", + "logrotate_test.go", + "managed_server_proof_test.go", + "manifest_recovery_test.go", + "physical_root_test.go", + "portsource_invariant_test.go", + "portsources_test.go", + "probe_test.go", + "procattr_linux_test.go", + "sweep_darwin_test.go", + "sweep_reap_unix_test.go", + "sweep_suite_linux_test.go", + "sweep_suite_test.go", + "sweep_test.go", + ], + embed = [":doltserver"], + deps = [ + "//internal/config", + "//internal/configfile", + "//internal/githooksenv", + "@com_github_dolthub_dolt_go//libraries/doltcore/servercfg", + ] + select({ + "@rules_go//go/platform:windows": [ + "@org_golang_x_sys//windows", + ], + "//conditions:default": [], + }), +) diff --git a/internal/doltversion/BUILD.bazel b/internal/doltversion/BUILD.bazel new file mode 100644 index 000000000..d54009bb1 --- /dev/null +++ b/internal/doltversion/BUILD.bazel @@ -0,0 +1,28 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "doltversion", + srcs = [ + "cache.go", + "errors.go", + "policy.go", + "probe.go", + "resolve.go", + "version.go", + ], + importpath = "github.com/steveyegge/beads/internal/doltversion", + visibility = ["//:__subpackages__"], +) + +go_test( + name = "doltversion_test", + srcs = [ + "cache_test.go", + "policy_test.go", + "probe_test.go", + "resolve_test.go", + "stubs_test.go", + "version_test.go", + ], + embed = [":doltversion"], +) diff --git a/internal/eventsjournal/BUILD.bazel b/internal/eventsjournal/BUILD.bazel new file mode 100644 index 000000000..aef6f700d --- /dev/null +++ b/internal/eventsjournal/BUILD.bazel @@ -0,0 +1,31 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "eventsjournal", + srcs = [ + "activation.go", + "autoprune.go", + "record.go", + ], + importpath = "github.com/steveyegge/beads/internal/eventsjournal", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/config", + "//internal/storage", + "//internal/storage/issueops", + ], +) + +go_test( + name = "eventsjournal_test", + srcs = [ + "activation_test.go", + "autoprune_test.go", + ], + embed = [":eventsjournal"], + deps = [ + "//internal/storage", + "//internal/storage/issueops", + "@com_github_data_dog_go_sqlmock//:go-sqlmock", + ], +) diff --git a/internal/fdhygiene/BUILD.bazel b/internal/fdhygiene/BUILD.bazel new file mode 100644 index 000000000..cc99908e4 --- /dev/null +++ b/internal/fdhygiene/BUILD.bazel @@ -0,0 +1,90 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "fdhygiene", + srcs = [ + "fdhygiene.go", + "fdhygiene_unix.go", + "fdhygiene_windows.go", + ], + importpath = "github.com/steveyegge/beads/internal/fdhygiene", + visibility = ["//:__subpackages__"], + deps = select({ + "@rules_go//go/platform:aix": [ + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:android": [ + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:darwin": [ + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:dragonfly": [ + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:freebsd": [ + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:illumos": [ + "@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:netbsd": [ + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:openbsd": [ + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:solaris": [ + "@org_golang_x_sys//unix", + ], + "//conditions:default": [], + }), +) + +go_test( + name = "fdhygiene_test", + srcs = ["fdhygiene_unix_test.go"], + embed = [":fdhygiene"], + deps = select({ + "@rules_go//go/platform:aix": [ + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:android": [ + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:darwin": [ + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:dragonfly": [ + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:freebsd": [ + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:illumos": [ + "@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:netbsd": [ + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:openbsd": [ + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:solaris": [ + "@org_golang_x_sys//unix", + ], + "//conditions:default": [], + }), +) diff --git a/internal/formula/BUILD.bazel b/internal/formula/BUILD.bazel new file mode 100644 index 000000000..e052a3e30 --- /dev/null +++ b/internal/formula/BUILD.bazel @@ -0,0 +1,47 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "formula", + srcs = [ + "advice.go", + "condition.go", + "controlflow.go", + "expand.go", + "parser.go", + "range.go", + "schema.go", + "schema_gen.go", + "stepcondition.go", + "types.go", + ], + importpath = "github.com/steveyegge/beads/internal/formula", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/beads", + "//internal/git", + "@com_github_burntsushi_toml//:toml", + ], +) + +go_test( + name = "formula_test", + srcs = [ + "advice_test.go", + "condition_test.go", + "controlflow_test.go", + "expand_test.go", + "intent_test.go", + "parser_test.go", + "range_test.go", + "schema_gen_test.go", + "schema_test.go", + "stepcondition_test.go", + ], + embed = [":formula"], + deps = [ + "//internal/beads", + "//internal/formula/schemagen", + "//internal/git", + "//internal/testutil", + ], +) diff --git a/internal/formula/cmd/schemagen/BUILD.bazel b/internal/formula/cmd/schemagen/BUILD.bazel new file mode 100644 index 000000000..66dd67e53 --- /dev/null +++ b/internal/formula/cmd/schemagen/BUILD.bazel @@ -0,0 +1,15 @@ +load("@rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "schemagen_lib", + srcs = ["main.go"], + importpath = "github.com/steveyegge/beads/internal/formula/cmd/schemagen", + visibility = ["//visibility:private"], + deps = ["//internal/formula/schemagen"], +) + +go_binary( + name = "schemagen", + embed = [":schemagen_lib"], + visibility = ["//:__subpackages__"], +) diff --git a/internal/formula/schemagen/BUILD.bazel b/internal/formula/schemagen/BUILD.bazel new file mode 100644 index 000000000..947eb12bc --- /dev/null +++ b/internal/formula/schemagen/BUILD.bazel @@ -0,0 +1,8 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "schemagen", + srcs = ["schemagen.go"], + importpath = "github.com/steveyegge/beads/internal/formula/schemagen", + visibility = ["//:__subpackages__"], +) diff --git a/internal/git/BUILD.bazel b/internal/git/BUILD.bazel new file mode 100644 index 000000000..0d991c222 --- /dev/null +++ b/internal/git/BUILD.bazel @@ -0,0 +1,17 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "git", + srcs = ["gitdir.go"], + importpath = "github.com/steveyegge/beads/internal/git", + visibility = ["//:__subpackages__"], +) + +go_test( + name = "git_test", + srcs = [ + "gitdir_test.go", + "jujutsu_test.go", + ], + embed = [":git"], +) diff --git a/internal/githooksenv/BUILD.bazel b/internal/githooksenv/BUILD.bazel new file mode 100644 index 000000000..0b524a8fe --- /dev/null +++ b/internal/githooksenv/BUILD.bazel @@ -0,0 +1,14 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "githooksenv", + srcs = ["githooksenv.go"], + importpath = "github.com/steveyegge/beads/internal/githooksenv", + visibility = ["//:__subpackages__"], +) + +go_test( + name = "githooksenv_test", + srcs = ["githooksenv_test.go"], + embed = [":githooksenv"], +) diff --git a/internal/github/BUILD.bazel b/internal/github/BUILD.bazel new file mode 100644 index 000000000..617aea69a --- /dev/null +++ b/internal/github/BUILD.bazel @@ -0,0 +1,37 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "github", + srcs = [ + "client.go", + "errors.go", + "fieldmapper.go", + "mapping.go", + "tracker.go", + "types.go", + ], + importpath = "github.com/steveyegge/beads/internal/github", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/config", + "//internal/tracker", + "//internal/types", + ], +) + +go_test( + name = "github_test", + srcs = [ + "client_ratelimit_test.go", + "mapping_test.go", + "push_dedup_test.go", + "tracker_test.go", + "types_test.go", + ], + embed = [":github"], + deps = [ + "//internal/config", + "//internal/tracker", + "//internal/types", + ], +) diff --git a/internal/gitlab/BUILD.bazel b/internal/gitlab/BUILD.bazel new file mode 100644 index 000000000..cf9434480 --- /dev/null +++ b/internal/gitlab/BUILD.bazel @@ -0,0 +1,39 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "gitlab", + srcs = [ + "client.go", + "fieldmapper.go", + "links.go", + "mapping.go", + "tracker.go", + "types.go", + ], + importpath = "github.com/steveyegge/beads/internal/gitlab", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/config", + "//internal/tracker", + "//internal/types", + ], +) + +go_test( + name = "gitlab_test", + srcs = [ + "client_test.go", + "links_test.go", + "mapping_test.go", + "tracker_state_test.go", + "tracker_test.go", + "types_test.go", + ], + embed = [":gitlab"], + deps = [ + "//internal/config", + "//internal/storage", + "//internal/tracker", + "//internal/types", + ], +) diff --git a/internal/gittraceenv/BUILD.bazel b/internal/gittraceenv/BUILD.bazel new file mode 100644 index 000000000..7592cb3ae --- /dev/null +++ b/internal/gittraceenv/BUILD.bazel @@ -0,0 +1,14 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "gittraceenv", + srcs = ["gittraceenv.go"], + importpath = "github.com/steveyegge/beads/internal/gittraceenv", + visibility = ["//:__subpackages__"], +) + +go_test( + name = "gittraceenv_test", + srcs = ["gittraceenv_test.go"], + embed = [":gittraceenv"], +) diff --git a/internal/hooks/BUILD.bazel b/internal/hooks/BUILD.bazel new file mode 100644 index 000000000..004745f8f --- /dev/null +++ b/internal/hooks/BUILD.bazel @@ -0,0 +1,215 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "hooks", + srcs = [ + "hooks.go", + "hooks_otel.go", + "hooks_unix.go", + "hooks_wasm.go", + "hooks_windows.go", + ], + importpath = "github.com/steveyegge/beads/internal/hooks", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/types", + "@io_opentelemetry_go_otel//attribute", + "@io_opentelemetry_go_otel_trace//:trace", + ] + select({ + "@rules_go//go/platform:aix_ppc64": [ + "@io_opentelemetry_go_otel//:otel", + "@io_opentelemetry_go_otel//codes", + ], + "@rules_go//go/platform:android_386": [ + "@io_opentelemetry_go_otel//:otel", + "@io_opentelemetry_go_otel//codes", + ], + "@rules_go//go/platform:android_amd64": [ + "@io_opentelemetry_go_otel//:otel", + "@io_opentelemetry_go_otel//codes", + ], + "@rules_go//go/platform:android_arm": [ + "@io_opentelemetry_go_otel//:otel", + "@io_opentelemetry_go_otel//codes", + ], + "@rules_go//go/platform:android_arm64": [ + "@io_opentelemetry_go_otel//:otel", + "@io_opentelemetry_go_otel//codes", + ], + "@rules_go//go/platform:darwin_386": [ + "@io_opentelemetry_go_otel//:otel", + "@io_opentelemetry_go_otel//codes", + ], + "@rules_go//go/platform:darwin_amd64": [ + "@io_opentelemetry_go_otel//:otel", + "@io_opentelemetry_go_otel//codes", + ], + "@rules_go//go/platform:darwin_arm": [ + "@io_opentelemetry_go_otel//:otel", + "@io_opentelemetry_go_otel//codes", + ], + "@rules_go//go/platform:darwin_arm64": [ + "@io_opentelemetry_go_otel//:otel", + "@io_opentelemetry_go_otel//codes", + ], + "@rules_go//go/platform:dragonfly_amd64": [ + "@io_opentelemetry_go_otel//:otel", + "@io_opentelemetry_go_otel//codes", + ], + "@rules_go//go/platform:freebsd_386": [ + "@io_opentelemetry_go_otel//:otel", + "@io_opentelemetry_go_otel//codes", + ], + "@rules_go//go/platform:freebsd_amd64": [ + "@io_opentelemetry_go_otel//:otel", + "@io_opentelemetry_go_otel//codes", + ], + "@rules_go//go/platform:freebsd_arm": [ + "@io_opentelemetry_go_otel//:otel", + "@io_opentelemetry_go_otel//codes", + ], + "@rules_go//go/platform:freebsd_arm64": [ + "@io_opentelemetry_go_otel//:otel", + "@io_opentelemetry_go_otel//codes", + ], + "@rules_go//go/platform:illumos_amd64": [ + "@io_opentelemetry_go_otel//:otel", + "@io_opentelemetry_go_otel//codes", + ], + "@rules_go//go/platform:ios_amd64": [ + "@io_opentelemetry_go_otel//:otel", + "@io_opentelemetry_go_otel//codes", + ], + "@rules_go//go/platform:ios_arm64": [ + "@io_opentelemetry_go_otel//:otel", + "@io_opentelemetry_go_otel//codes", + ], + "@rules_go//go/platform:js_wasm": [ + "@io_opentelemetry_go_otel//:otel", + "@io_opentelemetry_go_otel//codes", + ], + "@rules_go//go/platform:linux_386": [ + "@io_opentelemetry_go_otel//:otel", + "@io_opentelemetry_go_otel//codes", + ], + "@rules_go//go/platform:linux_amd64": [ + "@io_opentelemetry_go_otel//:otel", + "@io_opentelemetry_go_otel//codes", + ], + "@rules_go//go/platform:linux_arm": [ + "@io_opentelemetry_go_otel//:otel", + "@io_opentelemetry_go_otel//codes", + ], + "@rules_go//go/platform:linux_arm64": [ + "@io_opentelemetry_go_otel//:otel", + "@io_opentelemetry_go_otel//codes", + ], + "@rules_go//go/platform:linux_mips": [ + "@io_opentelemetry_go_otel//:otel", + "@io_opentelemetry_go_otel//codes", + ], + "@rules_go//go/platform:linux_mips64": [ + "@io_opentelemetry_go_otel//:otel", + "@io_opentelemetry_go_otel//codes", + ], + "@rules_go//go/platform:linux_mips64le": [ + "@io_opentelemetry_go_otel//:otel", + "@io_opentelemetry_go_otel//codes", + ], + "@rules_go//go/platform:linux_mipsle": [ + "@io_opentelemetry_go_otel//:otel", + "@io_opentelemetry_go_otel//codes", + ], + "@rules_go//go/platform:linux_ppc64": [ + "@io_opentelemetry_go_otel//:otel", + "@io_opentelemetry_go_otel//codes", + ], + "@rules_go//go/platform:linux_ppc64le": [ + "@io_opentelemetry_go_otel//:otel", + "@io_opentelemetry_go_otel//codes", + ], + "@rules_go//go/platform:linux_riscv64": [ + "@io_opentelemetry_go_otel//:otel", + "@io_opentelemetry_go_otel//codes", + ], + "@rules_go//go/platform:linux_s390x": [ + "@io_opentelemetry_go_otel//:otel", + "@io_opentelemetry_go_otel//codes", + ], + "@rules_go//go/platform:netbsd_386": [ + "@io_opentelemetry_go_otel//:otel", + "@io_opentelemetry_go_otel//codes", + ], + "@rules_go//go/platform:netbsd_amd64": [ + "@io_opentelemetry_go_otel//:otel", + "@io_opentelemetry_go_otel//codes", + ], + "@rules_go//go/platform:netbsd_arm": [ + "@io_opentelemetry_go_otel//:otel", + "@io_opentelemetry_go_otel//codes", + ], + "@rules_go//go/platform:netbsd_arm64": [ + "@io_opentelemetry_go_otel//:otel", + "@io_opentelemetry_go_otel//codes", + ], + "@rules_go//go/platform:openbsd_386": [ + "@io_opentelemetry_go_otel//:otel", + "@io_opentelemetry_go_otel//codes", + ], + "@rules_go//go/platform:openbsd_amd64": [ + "@io_opentelemetry_go_otel//:otel", + "@io_opentelemetry_go_otel//codes", + ], + "@rules_go//go/platform:openbsd_arm": [ + "@io_opentelemetry_go_otel//:otel", + "@io_opentelemetry_go_otel//codes", + ], + "@rules_go//go/platform:openbsd_arm64": [ + "@io_opentelemetry_go_otel//:otel", + "@io_opentelemetry_go_otel//codes", + ], + "@rules_go//go/platform:solaris_amd64": [ + "@io_opentelemetry_go_otel//:otel", + "@io_opentelemetry_go_otel//codes", + ], + "@rules_go//go/platform:windows_386": [ + "@io_opentelemetry_go_otel//:otel", + "@io_opentelemetry_go_otel//codes", + ], + "@rules_go//go/platform:windows_amd64": [ + "@io_opentelemetry_go_otel//:otel", + "@io_opentelemetry_go_otel//codes", + ], + "@rules_go//go/platform:windows_arm": [ + "@io_opentelemetry_go_otel//:otel", + "@io_opentelemetry_go_otel//codes", + ], + "@rules_go//go/platform:windows_arm64": [ + "@io_opentelemetry_go_otel//:otel", + "@io_opentelemetry_go_otel//codes", + ], + "//conditions:default": [], + }), +) + +go_test( + name = "hooks_test", + srcs = [ + "hooks_test.go", + "hooks_wasm_test.go", + "wait_test.go", + ], + embed = [":hooks"], + deps = [ + "//internal/types", + ] + select({ + "@rules_go//go/platform:js_wasm": [ + "@io_opentelemetry_go_otel//:otel", + "@io_opentelemetry_go_otel//attribute", + "@io_opentelemetry_go_otel//codes", + "@io_opentelemetry_go_otel_sdk//trace", + "@io_opentelemetry_go_otel_sdk//trace/tracetest", + ], + "//conditions:default": [], + }), +) diff --git a/internal/httpapi/BUILD.bazel b/internal/httpapi/BUILD.bazel new file mode 100644 index 000000000..64944bfaa --- /dev/null +++ b/internal/httpapi/BUILD.bazel @@ -0,0 +1,121 @@ +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", + "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", + ], + 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", + "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", + "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", + ], + 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", + ], +) diff --git a/internal/httpapi/apigen/BUILD.bazel b/internal/httpapi/apigen/BUILD.bazel new file mode 100644 index 000000000..fad33f8a8 --- /dev/null +++ b/internal/httpapi/apigen/BUILD.bazel @@ -0,0 +1,16 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "apigen", + srcs = [ + "doc.go", + "types.gen.go", + ], + importpath = "github.com/steveyegge/beads/internal/httpapi/apigen", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/eventsjournal", + "//internal/types", + "//issueops", + ], +) diff --git a/internal/httpapi/spec/BUILD.bazel b/internal/httpapi/spec/BUILD.bazel new file mode 100644 index 000000000..46a8bc94c --- /dev/null +++ b/internal/httpapi/spec/BUILD.bazel @@ -0,0 +1,9 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "spec", + srcs = ["embed.go"], + embedsrcs = ["openapi.v0.yaml"], + importpath = "github.com/steveyegge/beads/internal/httpapi/spec", + visibility = ["//:__subpackages__"], +) diff --git a/internal/idgen/BUILD.bazel b/internal/idgen/BUILD.bazel new file mode 100644 index 000000000..baa2d1260 --- /dev/null +++ b/internal/idgen/BUILD.bazel @@ -0,0 +1,14 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "idgen", + srcs = ["hash.go"], + importpath = "github.com/steveyegge/beads/internal/idgen", + visibility = ["//:__subpackages__"], +) + +go_test( + name = "idgen_test", + srcs = ["hash_test.go"], + embed = [":idgen"], +) diff --git a/internal/jira/BUILD.bazel b/internal/jira/BUILD.bazel new file mode 100644 index 000000000..e0045cdf2 --- /dev/null +++ b/internal/jira/BUILD.bazel @@ -0,0 +1,39 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "jira", + srcs = [ + "client.go", + "fieldmapper.go", + "refs.go", + "tracker.go", + "types.go", + ], + importpath = "github.com/steveyegge/beads/internal/jira", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/config", + "//internal/debug", + "//internal/tracker", + "//internal/types", + ], +) + +go_test( + name = "jira_test", + srcs = [ + "client_test.go", + "refs_test.go", + "retry_test.go", + "tracker_test.go", + ], + embed = [":jira"], + deps = [ + "//internal/config", + "//internal/storage", + "//internal/tracker", + "//internal/types", + "//issueops", + "//memoryops", + ], +) diff --git a/internal/linear/BUILD.bazel b/internal/linear/BUILD.bazel new file mode 100644 index 000000000..e0c952a91 --- /dev/null +++ b/internal/linear/BUILD.bazel @@ -0,0 +1,64 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "linear", + srcs = [ + "client.go", + "fieldmapper.go", + "idempotency.go", + "mapping.go", + "oauth.go", + "parent_reconcile.go", + "staleness.go", + "synclock.go", + "synclock_info_inline.go", + "synclock_info_windows.go", + "synclock_unix.go", + "synclock_wasm.go", + "synclock_windows.go", + "tracker.go", + "types.go", + ], + importpath = "github.com/steveyegge/beads/internal/linear", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/config", + "//internal/debug", + "//internal/idgen", + "//internal/lockfile", + "//internal/tracker", + "//internal/types", + ] + select({ + "@rules_go//go/platform:windows": [ + "@org_golang_x_sys//windows", + ], + "//conditions:default": [], + }), +) + +go_test( + name = "linear_test", + srcs = [ + "client_test.go", + "idempotency_test.go", + "mapping_test.go", + "oauth_test.go", + "parent_reconcile_test.go", + "staleness_test.go", + "synclock_info_windows_test.go", + "synclock_test.go", + "synclock_windows_test.go", + "tracker_test.go", + ], + embed = [":linear"], + deps = [ + "//internal/tracker", + "//internal/types", + ] + select({ + "@rules_go//go/platform:windows": [ + "//internal/lockfile", + "@org_golang_x_sys//windows", + ], + "//conditions:default": [], + }), +) diff --git a/internal/lockfile/BUILD.bazel b/internal/lockfile/BUILD.bazel new file mode 100644 index 000000000..59c9d3504 --- /dev/null +++ b/internal/lockfile/BUILD.bazel @@ -0,0 +1,61 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "lockfile", + srcs = [ + "lock.go", + "lock_shared_unix.go", + "lock_shared_wasm.go", + "lock_shared_windows.go", + "lock_unix.go", + "lock_wasm.go", + "lock_windows.go", + ], + importpath = "github.com/steveyegge/beads/internal/lockfile", + visibility = ["//:__subpackages__"], + deps = select({ + "@rules_go//go/platform:aix": [ + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:android": [ + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:darwin": [ + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:dragonfly": [ + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:freebsd": [ + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:illumos": [ + "@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:netbsd": [ + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:openbsd": [ + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:solaris": [ + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:windows": [ + "@org_golang_x_sys//windows", + ], + "//conditions:default": [], + }), +) + +go_test( + name = "lockfile_test", + srcs = ["lock_test.go"], + embed = [":lockfile"], +) diff --git a/internal/memoryapi/BUILD.bazel b/internal/memoryapi/BUILD.bazel new file mode 100644 index 000000000..bd5802a5d --- /dev/null +++ b/internal/memoryapi/BUILD.bazel @@ -0,0 +1,16 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "memoryapi", + srcs = ["memoryapi.go"], + importpath = "github.com/steveyegge/beads/internal/memoryapi", + visibility = ["//:__subpackages__"], + deps = ["//memoryops"], +) + +go_test( + name = "memoryapi_test", + srcs = ["memoryapi_test.go"], + embed = [":memoryapi"], + deps = ["//memoryops"], +) diff --git a/internal/metrics/BUILD.bazel b/internal/metrics/BUILD.bazel new file mode 100644 index 000000000..ace48feae --- /dev/null +++ b/internal/metrics/BUILD.bazel @@ -0,0 +1,36 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "metrics", + srcs = [ + "flusher.go", + "machineid.go", + "metrics.go", + "prune.go", + "spawn.go", + "userconfig.go", + ], + importpath = "github.com/steveyegge/beads/internal/metrics", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/config", + "@com_github_dolthub_eventkit//:eventkit", + "@com_github_dolthub_eventkit//transport/ga4", + "@in_gopkg_yaml_v3//:yaml_v3", + ], +) + +go_test( + name = "metrics_test", + srcs = [ + "machineid_test.go", + "metrics_test.go", + "prune_test.go", + "spawn_reap_test.go", + "spawn_test.go", + "spawn_throttle_test.go", + "userconfig_test.go", + ], + embed = [":metrics"], + deps = ["@in_gopkg_yaml_v3//:yaml_v3"], +) diff --git a/internal/migration/BUILD.bazel b/internal/migration/BUILD.bazel new file mode 100644 index 000000000..b09960e07 --- /dev/null +++ b/internal/migration/BUILD.bazel @@ -0,0 +1,14 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "migration", + srcs = ["freeze.go"], + importpath = "github.com/steveyegge/beads/internal/migration", + visibility = ["//:__subpackages__"], +) + +go_test( + name = "migration_test", + srcs = ["freeze_test.go"], + embed = [":migration"], +) diff --git a/internal/migration/legacysqlite/BUILD.bazel b/internal/migration/legacysqlite/BUILD.bazel new file mode 100644 index 000000000..b8ea518aa --- /dev/null +++ b/internal/migration/legacysqlite/BUILD.bazel @@ -0,0 +1,27 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "legacysqlite", + srcs = [ + "reader.go", + "reader_nocgo.go", + ], + importpath = "github.com/steveyegge/beads/internal/migration/legacysqlite", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/storage/issueops", + "//internal/types", + "@com_github_mattn_go_sqlite3//:go-sqlite3", + ], +) + +go_test( + name = "legacysqlite_test", + srcs = ["reader_test.go"], + embed = [":legacysqlite"], + deps = [ + "//internal/storage/issueops", + "//internal/types", + "@com_github_mattn_go_sqlite3//:go-sqlite3", + ], +) diff --git a/internal/molecules/BUILD.bazel b/internal/molecules/BUILD.bazel new file mode 100644 index 000000000..d2f31c014 --- /dev/null +++ b/internal/molecules/BUILD.bazel @@ -0,0 +1,28 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "molecules", + srcs = ["molecules.go"], + importpath = "github.com/steveyegge/beads/internal/molecules", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/debug", + "//internal/storage", + "//internal/types", + ], +) + +go_test( + name = "molecules_test", + srcs = [ + "molecules_test.go", + "testmain_test.go", + ], + embed = [":molecules"], + deps = [ + "//internal/storage", + "//internal/storage/dolt", + "//internal/testutil", + "//internal/types", + ], +) diff --git a/internal/notion/BUILD.bazel b/internal/notion/BUILD.bazel new file mode 100644 index 000000000..925e24004 --- /dev/null +++ b/internal/notion/BUILD.bazel @@ -0,0 +1,36 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "notion", + srcs = [ + "auth.go", + "client.go", + "fieldmapper.go", + "mapping.go", + "refs.go", + "tracker.go", + "types.go", + ], + importpath = "github.com/steveyegge/beads/internal/notion", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/config", + "//internal/tracker", + "//internal/types", + ], +) + +go_test( + name = "notion_test", + srcs = [ + "client_test.go", + "mapping_test.go", + "refs_test.go", + "tracker_test.go", + ], + embed = [":notion"], + deps = [ + "//internal/tracker", + "//internal/types", + ], +) diff --git a/internal/procid/BUILD.bazel b/internal/procid/BUILD.bazel new file mode 100644 index 000000000..152135fe8 --- /dev/null +++ b/internal/procid/BUILD.bazel @@ -0,0 +1,51 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "procid", + srcs = [ + "procid.go", + "procid_darwin.go", + "procid_linux.go", + "procid_unsupported.go", + "procid_windows.go", + ], + importpath = "github.com/steveyegge/beads/internal/procid", + visibility = ["//:__subpackages__"], + deps = 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 = "procid_test", + srcs = [ + "procid_linux_test.go", + "procid_test.go", + "procid_windows_test.go", + ], + embed = [":procid"], + deps = select({ + "@rules_go//go/platform:android": [ + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:linux": [ + "@org_golang_x_sys//unix", + ], + "//conditions:default": [], + }), +) diff --git a/internal/query/BUILD.bazel b/internal/query/BUILD.bazel new file mode 100644 index 000000000..acaf1e8dd --- /dev/null +++ b/internal/query/BUILD.bazel @@ -0,0 +1,28 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "query", + srcs = [ + "evaluator.go", + "lexer.go", + "parser.go", + ], + importpath = "github.com/steveyegge/beads/internal/query", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/storage", + "//internal/timeparsing", + "//internal/types", + ], +) + +go_test( + name = "query_test", + srcs = ["query_test.go"], + embed = [":query"], + deps = [ + "//internal/storage", + "//internal/timeparsing", + "//internal/types", + ], +) diff --git a/internal/recipes/BUILD.bazel b/internal/recipes/BUILD.bazel new file mode 100644 index 000000000..34a312aa7 --- /dev/null +++ b/internal/recipes/BUILD.bazel @@ -0,0 +1,22 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "recipes", + srcs = [ + "recipes.go", + "template.go", + ], + importpath = "github.com/steveyegge/beads/internal/recipes", + visibility = ["//:__subpackages__"], + deps = [ + "//plugins/beads", + "@com_github_burntsushi_toml//:toml", + ], +) + +go_test( + name = "recipes_test", + srcs = ["recipes_test.go"], + embed = [":recipes"], + deps = ["//plugins/beads"], +) diff --git a/internal/remotecache/BUILD.bazel b/internal/remotecache/BUILD.bazel new file mode 100644 index 000000000..b7c2fb877 --- /dev/null +++ b/internal/remotecache/BUILD.bazel @@ -0,0 +1,30 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "remotecache", + srcs = [ + "cache.go", + "url.go", + ], + importpath = "github.com/steveyegge/beads/internal/remotecache", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/configfile", + "//internal/debug", + "//internal/githooksenv", + "//internal/gittraceenv", + "//internal/lockfile", + "//internal/storage", + ], +) + +go_test( + name = "remotecache_test", + srcs = [ + "cache_test.go", + "doltcmd_test.go", + "url_test.go", + ], + embed = [":remotecache"], + deps = ["//internal/githooksenv"], +) diff --git a/internal/routing/BUILD.bazel b/internal/routing/BUILD.bazel new file mode 100644 index 000000000..5b24e7fcd --- /dev/null +++ b/internal/routing/BUILD.bazel @@ -0,0 +1,16 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "routing", + srcs = ["routing.go"], + importpath = "github.com/steveyegge/beads/internal/routing", + visibility = ["//:__subpackages__"], + deps = ["//internal/git"], +) + +go_test( + name = "routing_test", + srcs = ["routing_test.go"], + embed = [":routing"], + deps = ["//internal/git"], +) diff --git a/internal/storage/BUILD.bazel b/internal/storage/BUILD.bazel new file mode 100644 index 000000000..b0cc3e99c --- /dev/null +++ b/internal/storage/BUILD.bazel @@ -0,0 +1,111 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "storage", + srcs = [ + "advanced_queries.go", + "annotation_queries.go", + "batch.go", + "batch_apply.go", + "bulk_issues.go", + "child_counter_reservation.go", + "compaction.go", + "config_metadata.go", + "dependency_queries.go", + "diff_store.go", + "directory_size.go", + "errors_unsupported.go", + "event_queries.go", + "federation.go", + "history_presence.go", + "history_viewer.go", + "hook_batch_applier.go", + "hook_batch_closer.go", + "hook_batch_creator.go", + "hook_blockingannotator.go", + "hook_bootstrapper.go", + "hook_commenter.go", + "hook_counter.go", + "hook_cycle_detector.go", + "hook_decorator.go", + "hook_deleter.go", + "hook_dependency_editor.go", + "hook_edgereader.go", + "hook_graph_counter.go", + "hook_init_verifier.go", + "hook_issue_claimer.go", + "hook_issue_operations.go", + "hook_issue_reader.go", + "hook_memories.go", + "hook_metadata_cas.go", + "hook_querier.go", + "hook_ready_claimer.go", + "hook_ready_counter.go", + "hook_relations.go", + "hook_releaser.go", + "hook_stats_reporter.go", + "hook_sweeper.go", + "hook_tree_walker.go", + "hook_version_reconciler.go", + "hook_workspace_config.go", + "issue_create_dependencies.go", + "iter.go", + "merge_slot.go", + "metadata.go", + "metadata_cas.go", + "remote.go", + "storage.go", + "sync.go", + "version_control.go", + "versioned.go", + "wake_defers.go", + ], + importpath = "github.com/steveyegge/beads/internal/storage", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/hooks", + "//internal/types", + "//issueops", + "//journalops", + "//memoryops", + ], +) + +go_test( + name = "storage_test", + srcs = [ + "batch_apply_test.go", + "contract_leg_registry_test.go", + "directory_size_test.go", + "hook_batch_applier_test.go", + "hook_batch_closer_test.go", + "hook_commenter_test.go", + "hook_decorator_internal_test.go", + "hook_decorator_test.go", + "hook_dependency_editor_test.go", + "hook_issue_claimer_test.go", + "hook_issue_operations_test.go", + "hook_issue_reader_test.go", + "hook_metadata_cas_test.go", + "hook_ready_claimer_test.go", + "hook_relations_test.go", + "hook_releaser_test.go", + "hook_role_census_test.go", + "journal_facade_test.go", + "leg_contract_wiring_test.go", + "metadata_cas_test.go", + "metadata_edit_value_test.go", + "metadata_jsonpath_test.go", + "metadata_schema_test.go", + "metadata_test.go", + "role_accessor_decorator_test.go", + ], + embed = [":storage"], + deps = [ + "//internal/hooks", + "//internal/types", + "//issueops", + "//journalops", + "//memoryops", + ], +) diff --git a/internal/storage/backendnames/BUILD.bazel b/internal/storage/backendnames/BUILD.bazel new file mode 100644 index 000000000..1ba5ad004 --- /dev/null +++ b/internal/storage/backendnames/BUILD.bazel @@ -0,0 +1,8 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "backendnames", + srcs = ["backendnames.go"], + importpath = "github.com/steveyegge/beads/internal/storage/backendnames", + visibility = ["//:__subpackages__"], +) diff --git a/internal/storage/backends/BUILD.bazel b/internal/storage/backends/BUILD.bazel new file mode 100644 index 000000000..46c4a10df --- /dev/null +++ b/internal/storage/backends/BUILD.bazel @@ -0,0 +1,26 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "backends", + srcs = ["backends.go"], + importpath = "github.com/steveyegge/beads/internal/storage/backends", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/storage", + "//internal/storage/backendnames", + ], +) + +go_test( + name = "backends_test", + srcs = [ + "backends_test.go", + "classification_deregister_test.go", + "classification_test.go", + ], + deps = [ + ":backends", + "//internal/configfile", + "//internal/storage", + ], +) diff --git a/internal/storage/contextinfo/BUILD.bazel b/internal/storage/contextinfo/BUILD.bazel new file mode 100644 index 000000000..91e454b51 --- /dev/null +++ b/internal/storage/contextinfo/BUILD.bazel @@ -0,0 +1,18 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "contextinfo", + srcs = ["provider.go"], + importpath = "github.com/steveyegge/beads/internal/storage/contextinfo", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/storage/domain", + "//internal/storage/domain/fs", + ], +) + +go_test( + name = "contextinfo_test", + srcs = ["provider_test.go"], + embed = [":contextinfo"], +) diff --git a/internal/storage/dberrors/BUILD.bazel b/internal/storage/dberrors/BUILD.bazel new file mode 100644 index 000000000..598858849 --- /dev/null +++ b/internal/storage/dberrors/BUILD.bazel @@ -0,0 +1,22 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "dberrors", + srcs = [ + "errors.go", + "mergerefusal.go", + ], + importpath = "github.com/steveyegge/beads/internal/storage/dberrors", + visibility = ["//:__subpackages__"], + deps = ["@com_github_go_sql_driver_mysql//:mysql"], +) + +go_test( + name = "dberrors_test", + srcs = [ + "errors_test.go", + "mergerefusal_test.go", + ], + embed = [":dberrors"], + deps = ["@com_github_go_sql_driver_mysql//:mysql"], +) diff --git a/internal/storage/dbproxy/identity/BUILD.bazel b/internal/storage/dbproxy/identity/BUILD.bazel new file mode 100644 index 000000000..1208d9581 --- /dev/null +++ b/internal/storage/dbproxy/identity/BUILD.bazel @@ -0,0 +1,22 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "identity", + srcs = [ + "control.go", + "identity.go", + ], + importpath = "github.com/steveyegge/beads/internal/storage/dbproxy/identity", + visibility = ["//:__subpackages__"], + deps = ["//internal/atomicfile"], +) + +go_test( + name = "identity_test", + srcs = ["identity_test.go"], + embed = [":identity"], + deps = [ + "@com_github_stretchr_testify//assert", + "@com_github_stretchr_testify//require", + ], +) diff --git a/internal/storage/dbproxy/pidfile/BUILD.bazel b/internal/storage/dbproxy/pidfile/BUILD.bazel new file mode 100644 index 000000000..9d2efa95b --- /dev/null +++ b/internal/storage/dbproxy/pidfile/BUILD.bazel @@ -0,0 +1,15 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "pidfile", + srcs = ["pidfile.go"], + importpath = "github.com/steveyegge/beads/internal/storage/dbproxy/pidfile", + visibility = ["//:__subpackages__"], + deps = ["//internal/atomicfile"], +) + +go_test( + name = "pidfile_test", + srcs = ["pidfile_test.go"], + embed = [":pidfile"], +) diff --git a/internal/storage/dbproxy/proxy/BUILD.bazel b/internal/storage/dbproxy/proxy/BUILD.bazel new file mode 100644 index 000000000..1cf5600a3 --- /dev/null +++ b/internal/storage/dbproxy/proxy/BUILD.bazel @@ -0,0 +1,85 @@ +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", + ], +) diff --git a/internal/storage/dbproxy/server/BUILD.bazel b/internal/storage/dbproxy/server/BUILD.bazel new file mode 100644 index 000000000..a19f910bd --- /dev/null +++ b/internal/storage/dbproxy/server/BUILD.bazel @@ -0,0 +1,49 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "server", + srcs = [ + "doltserver.go", + "external_dolt_server.go", + "server.go", + "testserver.go", + ], + importpath = "github.com/steveyegge/beads/internal/storage/dbproxy/server", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/configfile", + "//internal/doltserver", + "//internal/procid", + "//internal/storage/dbproxy/identity", + "//internal/storage/dbproxy/pidfile", + "//internal/storage/dbproxy/util", + "//internal/storage/versioncontrolops", + "@com_github_cenkalti_backoff_v4//:backoff", + "@com_github_dolthub_dolt_go//libraries/doltcore/servercfg", + "@com_github_dolthub_dolt_go//libraries/utils/filesys", + "@com_github_go_sql_driver_mysql//:mysql", + "@org_golang_x_sync//errgroup", + ], +) + +go_test( + name = "server_test", + srcs = [ + "doltserver_test.go", + "external_dolt_server_test.go", + "testmain_test.go", + "testserver_test.go", + ], + embed = [":server"], + deps = [ + "//internal/configfile", + "//internal/doltserver", + "//internal/lockfile", + "//internal/procid", + "//internal/storage/dbproxy/pidfile", + "//internal/testutil", + "@com_github_go_sql_driver_mysql//:mysql", + "@com_github_stretchr_testify//assert", + "@com_github_stretchr_testify//require", + ], +) diff --git a/internal/storage/dbproxy/util/BUILD.bazel b/internal/storage/dbproxy/util/BUILD.bazel new file mode 100644 index 000000000..a22dc23b4 --- /dev/null +++ b/internal/storage/dbproxy/util/BUILD.bazel @@ -0,0 +1,21 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "util", + srcs = [ + "dsn.go", + "flock.go", + ], + importpath = "github.com/steveyegge/beads/internal/storage/dbproxy/util", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/lockfile", + "@com_github_go_sql_driver_mysql//:mysql", + ], +) + +go_test( + name = "util_test", + srcs = ["dsn_test.go"], + embed = [":util"], +) diff --git a/internal/storage/depid/BUILD.bazel b/internal/storage/depid/BUILD.bazel new file mode 100644 index 000000000..8e8601144 --- /dev/null +++ b/internal/storage/depid/BUILD.bazel @@ -0,0 +1,15 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "depid", + srcs = ["depid.go"], + importpath = "github.com/steveyegge/beads/internal/storage/depid", + visibility = ["//:__subpackages__"], + deps = ["@com_github_google_uuid//:uuid"], +) + +go_test( + name = "depid_test", + srcs = ["depid_test.go"], + embed = [":depid"], +) diff --git a/internal/storage/dolt/BUILD.bazel b/internal/storage/dolt/BUILD.bazel new file mode 100644 index 000000000..eec61f3f6 --- /dev/null +++ b/internal/storage/dolt/BUILD.bazel @@ -0,0 +1,354 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "dolt", + srcs = [ + "batch_applier.go", + "batch_closer.go", + "batch_creator.go", + "blockingannotator.go", + "bootstrap.go", + "bootstrapper.go", + "circuit.go", + "claim_verify.go", + "commenter.go", + "compact.go", + "config.go", + "counter.go", + "counts.go", + "credentials.go", + "cycle_detector.go", + "deleter.go", + "dependencies.go", + "dependency_editor.go", + "edgereader.go", + "ephemeral_routing.go", + "errors.go", + "events.go", + "federation.go", + "filters.go", + "gateway_credential.go", + "graph_counter.go", + "history.go", + "init_verifier.go", + "issue_claimer.go", + "issue_operations.go", + "issue_operations_tx.go", + "issue_reader.go", + "issue_scan.go", + "issues.go", + "iter_dependents.go", + "iter_issues.go", + "iter_stubs.go", + "journal_accessor.go", + "labels.go", + "memories.go", + "merge_slot.go", + "metadata_cas.go", + "metadata_schema.go", + "open.go", + "provenance.go", + "pull_report.go", + "querier.go", + "queries.go", + "ready_claimer.go", + "ready_counter.go", + "relations.go", + "releaser.go", + "rename.go", + "schema.go", + "slots.go", + "stats_reporter.go", + "store.go", + "sweeper.go", + "transaction.go", + "tree_walker.go", + "util.go", + "version_reconciler.go", + "versioned.go", + "wisps.go", + "workspace_config.go", + ], + importpath = "github.com/steveyegge/beads/internal/storage/dolt", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/config", + "//internal/configfile", + "//internal/creds", + "//internal/debug", + "//internal/doltserver", + "//internal/githooksenv", + "//internal/gittraceenv", + "//internal/idgen", + "//internal/lockfile", + "//internal/memoryapi", + "//internal/remotecache", + "//internal/storage", + "//internal/storage/dberrors", + "//internal/storage/doltutil", + "//internal/storage/domain", + "//internal/storage/issueops", + "//internal/storage/kvkeys", + "//internal/storage/memoryops", + "//internal/storage/schema", + "//internal/storage/sqlbuild", + "//internal/storage/versioncontrolops", + "//internal/types", + "//internal/workapi", + "//internal/workapi/storecounter", + "//internal/workapi/storequerier", + "//internal/workapi/storereader", + "//internal/workapi/storereadycounter", + "//internal/workapi/storestats", + "//internal/workapi/storeversionreconciler", + "//internal/workapi/storeworkspaceconfig", + "//issueops", + "//memoryops", + "@com_github_cenkalti_backoff_v4//:backoff", + "@com_github_go_sql_driver_mysql//:mysql", + "@com_github_google_uuid//:uuid", + "@io_opentelemetry_go_otel//:otel", + "@io_opentelemetry_go_otel//attribute", + "@io_opentelemetry_go_otel//codes", + "@io_opentelemetry_go_otel_metric//:metric", + "@io_opentelemetry_go_otel_trace//:trace", + ], +) + +go_test( + name = "dolt_test", + srcs = [ + "active_database_size_test.go", + "autostart_test.go", + "aux_row_id_rekey_test.go", + "batch_apply_contract_test.go", + "batch_closer_contract_test.go", + "batch_creator_contract_test.go", + "blocked_consistency_test.go", + "blocked_full_repair_test.go", + "blocked_merge_test.go", + "blocked_recompute_guard_test.go", + "blocking_annotator_contract_test.go", + "bootstrap_test.go", + "bootstrapper_contract_test.go", + "central_config_integration_test.go", + "checked_wrapper_smoke_test.go", + "circuit_test.go", + "claim_commit_boundary_test.go", + "claim_custom_status_test.go", + "claim_verify_test.go", + "claim_wrapper_smoke_test.go", + "claimer_contract_test.go", + "cli_transfer_timeout_test.go", + "close_issue_checked_test.go", + "close_policy_gate_test.go", + "commenter_contract_test.go", + "commenter_persistence_test.go", + "comments_page_test.go", + "commit_all_test.go", + "commit_dirty_wisp_test.go", + "compact_test.go", + "concurrent_test.go", + "conflicts_integration_test.go", + "conflicts_unwrap_test.go", + "conformance_test.go", + "connection_pool_test.go", + "count_include_wisps_test.go", + "counter_contract_test.go", + "counts_wisp_test.go", + "create_guard_test.go", + "create_issue_commit_test.go", + "credentials_test.go", + "cross_project_test.go", + "cross_record_invariant_contract_test.go", + "cross_upgrade_merge_test.go", + "crosstier_dep_test.go", + "custom_status_test.go", + "cycle_detector_contract_test.go", + "deleter_contract_test.go", + "demote_to_wisp_test.go", + "dependencies_conflict_test.go", + "dependencies_extended_test.go", + "dependencies_merge_test.go", + "dependencies_rename_rekey_test.go", + "dependencies_type_conflict_test.go", + "dependency_commit_boundary_test.go", + "dependency_coordination_test.go", + "dependency_editor_contract_test.go", + "dependency_editor_test.go", + "dependency_events_test.go", + "dependents_records_test.go", + "derived_id_insert_test.go", + "dolt_benchmark_purge_test.go", + "dolt_benchmark_safety_test.go", + "dolt_benchmark_test.go", + "dolt_commit_ordering_test.go", + "dolt_sql_large_script_test.go", + "dolt_test.go", + "draincall_regression_test.go", + "dualwrite_history_contract_test.go", + "edge_reader_contract_test.go", + "empty_commit_test.go", + "ephemeral_routing_test.go", + "errors_test.go", + "event_commit_boundary_test.go", + "events_since_test.go", + "events_test.go", + "expected_revision_contract_test.go", + "federation_pull_settle_test.go", + "field_length_test.go", + "filters_test.go", + "fk_cascade_merge_test.go", + "fsck_test.go", + "gateway_credential_test.go", + "gateway_session_test.go", + "generated_dependency_target_repro_test.go", + "graph_counter_contract_test.go", + "history_presence_contract_test.go", + "history_test.go", + "identity_mismatch_message_test.go", + "indeterminate_commit_test.go", + "initschema_concurrent_test.go", + "initschema_fresh_bootstrap_heal_test.go", + "initschema_gate_test.go", + "initschema_pool_poison_test.go", + "is_blocked_batch_test.go", + "is_blocked_filter_test.go", + "is_blocked_test.go", + "issue_lifecycle_test.go", + "issue_operations_behavior_test.go", + "issue_operations_claim_verify_test.go", + "issue_operations_contract_test.go", + "issue_operations_persistence_test.go", + "issue_operations_staging_test.go", + "issue_operations_test.go", + "issues_conflict_test.go", + "joiniter_spike_test.go", + "journal_accessor_test.go", + "journal_contract_test.go", + "journal_coverage_test.go", + "journal_scope_completeness_test.go", + "journal_test.go", + "keyset_search_test.go", + "labels_test.go", + "lease_migration_test.go", + "lease_test.go", + "lifecycle_close_reopen_contract_test.go", + "lifecycle_create_contract_test.go", + "lifecycle_role_hooks_test.go", + "lifecycle_update_contract_test.go", + "lock_error_test.go", + "memories_contract_test.go", + "merge_strategy_test.go", + "metadata_cas_contract_test.go", + "metadata_merge_test.go", + "metadata_schema_test.go", + "metadata_validation_test.go", + "mixed_table_lifecycle_test.go", + "open_test.go", + "port_provenance_test.go", + "portsource_propagation_test.go", + "pr4107_corruption_test.go", + "prune_remote_refs_test.go", + "public_write_circuit_test.go", + "pull_branch_tracking_test.go", + "pull_config_wedge_test.go", + "pull_conflict_test.go", + "pull_report_sql_route_test.go", + "pull_report_test.go", + "querier_contract_test.go", + "querier_over_the_old_window_test.go", + "queries_test.go", + "reader_contract_test.go", + "readonly_server_policy_test.go", + "ready_claimer_contract_test.go", + "ready_counter_contract_test.go", + "relations_contract_test.go", + "releaser_contract_test.go", + "remote_migrate_gate_test.go", + "remote_routing_test.go", + "rename_test.go", + "reopen_category_test.go", + "reopen_routing_test.go", + "reopen_staging_test.go", + "retention_epoch_contract_test.go", + "retry_test.go", + "role_fixture_kit_test.go", + "role_test_helpers_test.go", + "row_version_test.go", + "schema_cli_parity_test.go", + "schema_migration_dirty_test.go", + "schema_migrations_conflict_test.go", + "schema_parity_test.go", + "schema_skew_test.go", + "schema_version_test.go", + "search_counts_parity_test.go", + "search_parity_test.go", + "settlement_commit_boundary_test.go", + "shared_server_predicate_test.go", + "shared_store_migrate_gate_test.go", + "slot_commit_boundary_test.go", + "smart_gate_data_behind_test.go", + "smart_remote_migrate_gate_test.go", + "socket_fallback_test.go", + "stats_reporter_contract_test.go", + "store_branch_pin_test.go", + "store_unit_test.go", + "suite_leak_linux_test.go", + "suite_temp_test.go", + "sweeper_contract_test.go", + "sweeper_typed_wisp_test.go", + "testmain_helper_sentinel_test.go", + "testmain_test.go", + "transaction_borrow_test.go", + "transaction_phase_test.go", + "transaction_test.go", + "transaction_wisp_lifecycle_persistence_test.go", + "tree_walker_contract_test.go", + "tx_reads_test.go", + "update_force_close_policy_test.go", + "update_guards_test.go", + "update_same_status_test.go", + "version_commit_deferred_test.go", + "version_reconciler_contract_test.go", + "versioned_test.go", + "wisp_custom_type_tx_test.go", + "wisp_gc_test.go", + "wisp_infra_dep_test.go", + "wisp_partition_test.go", + "wisp_row_lock_heal_test.go", + "wisp_set_routing_test.go", + "wisp_set_scoped_test.go", + "wisp_validation_test.go", + "wisps_cycle_test.go", + "workspace_config_contract_test.go", + ], + embed = [":dolt"], + deps = [ + "//backend/conformance", + "//internal/config", + "//internal/configfile", + "//internal/doltserver", + "//internal/githooksenv", + "//internal/storage", + "//internal/storage/dberrors", + "//internal/storage/depid", + "//internal/storage/doltutil", + "//internal/storage/domain", + "//internal/storage/issueops", + "//internal/storage/journalscan", + "//internal/storage/rowid", + "//internal/storage/schema", + "//internal/storage/sqlbuild", + "//internal/storage/storagecontract", + "//internal/storage/versioncontrolops", + "//internal/testutil", + "//internal/types", + "//internal/utils", + "//internal/workapi", + "//issueops", + "@com_github_data_dog_go_sqlmock//:go-sqlmock", + "@com_github_go_sql_driver_mysql//:mysql", + "@com_github_google_uuid//:uuid", + ], +) diff --git a/internal/storage/doltutil/BUILD.bazel b/internal/storage/doltutil/BUILD.bazel new file mode 100644 index 000000000..65d7a28f3 --- /dev/null +++ b/internal/storage/doltutil/BUILD.bazel @@ -0,0 +1,31 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "doltutil", + srcs = [ + "close.go", + "dsn.go", + "identifier.go", + "remotes.go", + ], + importpath = "github.com/steveyegge/beads/internal/storage/doltutil", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/doltremote", + "//internal/remotecache", + "//internal/storage", + "@com_github_go_sql_driver_mysql//:mysql", + ], +) + +go_test( + name = "doltutil_test", + srcs = [ + "close_test.go", + "dsn_test.go", + "identifier_test.go", + "persisted_remotes_test.go", + "remotes_test.go", + ], + embed = [":doltutil"], +) diff --git a/internal/storage/domain/BUILD.bazel b/internal/storage/domain/BUILD.bazel new file mode 100644 index 000000000..0e01f0688 --- /dev/null +++ b/internal/storage/domain/BUILD.bazel @@ -0,0 +1,51 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "domain", + srcs = [ + "adaptive.go", + "beads.go", + "child_counter.go", + "comment.go", + "config.go", + "context.go", + "dependency.go", + "events.go", + "git.go", + "infra_types.go", + "issue.go", + "issue_delete.go", + "journal.go", + "label.go", + "raw_sql.go", + "remote.go", + ], + importpath = "github.com/steveyegge/beads/internal/storage/domain", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/config", + "//internal/configfile", + "//internal/idgen", + "//internal/storage", + "//internal/storage/dberrors", + "//internal/types", + "//internal/validation", + "//issueops", + ], +) + +go_test( + name = "domain_test", + srcs = [ + "context_published_test.go", + "context_test.go", + "infra_types_test.go", + "issue_delete_missing_table_test.go", + ], + embed = [":domain"], + deps = [ + "//internal/configfile", + "//internal/types", + "@com_github_go_sql_driver_mysql//:mysql", + ], +) diff --git a/internal/storage/domain/db/BUILD.bazel b/internal/storage/domain/db/BUILD.bazel new file mode 100644 index 000000000..1003101ce --- /dev/null +++ b/internal/storage/domain/db/BUILD.bazel @@ -0,0 +1,121 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "db", + srcs = [ + "batching.go", + "child_counter.go", + "comment.go", + "config.go", + "ddl.go", + "dependency.go", + "dolt.go", + "events.go", + "issue.go", + "issue_descendants.go", + "issue_search.go", + "issue_search_counts.go", + "journal.go", + "label.go", + "raw_sql.go", + "ready_work.go", + "ready_work_union.go", + "remote.go", + "runner.go", + ], + importpath = "github.com/steveyegge/beads/internal/storage/domain/db", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/config", + "//internal/storage", + "//internal/storage/dberrors", + "//internal/storage/depid", + "//internal/storage/domain", + "//internal/storage/issueops", + "//internal/storage/sqlbuild", + "//internal/types", + "//issueops", + ], +) + +go_test( + name = "db_test", + srcs = [ + "batching_test.go", + "child_counter_test.go", + "close_checked_usecase_test.go", + "close_test.go", + "close_usecase_test.go", + "comment_iter_test.go", + "comment_test.go", + "comment_usecase_test.go", + "config_test.go", + "delete_repo_test.go", + "dependency_event_consistency_test.go", + "dependency_extras_test.go", + "dependency_metadata_test.go", + "dependency_null_metadata_test.go", + "dependency_test.go", + "dependency_usecase_extras_test.go", + "dependency_usecase_metadata_test.go", + "dependency_usecase_test.go", + "events_test.go", + "field_length_test.go", + "is_blocked_test.go", + "issue_as_of_test.go", + "issue_cross_tier_test.go", + "issue_descendants_test.go", + "issue_force_close_policy_test.go", + "issue_mergeops_test.go", + "issue_scan_parity_test.go", + "issue_search_counts_missing_table_test.go", + "issue_search_counts_test.go", + "issue_search_missing_table_test.go", + "issue_search_table_window_test.go", + "issue_search_test.go", + "issue_search_union_window_test.go", + "issue_search_window_test.go", + "issue_test.go", + "issue_update_validation_test.go", + "issue_usecase_apply_update_test.go", + "issue_usecase_as_of_test.go", + "issue_usecase_delete_test.go", + "issue_usecase_test.go", + "journal_behavior_test.go", + "journal_completeness_test.go", + "journal_doltignore_test.go", + "journal_seq_test.go", + "label_test.go", + "label_usecase_test.go", + "normalize_update_value_test.go", + "parity_direct_test.go", + "ready_helpers_test.go", + "ready_helpers_usecase_test.go", + "ready_work_counts_test.go", + "ready_work_missing_table_test.go", + "ready_work_test.go", + "reopen_test.go", + "reopen_usecase_test.go", + "suite_test.go", + "update_same_status_test.go", + ], + embed = [":db"], + deps = [ + "//internal/storage", + "//internal/storage/dberrors", + "//internal/storage/depid", + "//internal/storage/doltutil", + "//internal/storage/domain", + "//internal/storage/issueops", + "//internal/storage/journalscan", + "//internal/storage/schema", + "//internal/testutil", + "//internal/types", + "@com_github_data_dog_go_sqlmock//:go-sqlmock", + "@com_github_go_sql_driver_mysql//:mysql", + "@com_github_google_uuid//:uuid", + "@com_github_stretchr_testify//assert", + "@com_github_stretchr_testify//require", + "@com_github_stretchr_testify//suite", + ], +) diff --git a/internal/storage/domain/fs/BUILD.bazel b/internal/storage/domain/fs/BUILD.bazel new file mode 100644 index 000000000..cee74b233 --- /dev/null +++ b/internal/storage/domain/fs/BUILD.bazel @@ -0,0 +1,40 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "fs", + srcs = [ + "beads.go", + "context.go", + ], + importpath = "github.com/steveyegge/beads/internal/storage/domain/fs", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/beads", + "//internal/config", + "//internal/configfile", + "//internal/doltserver", + "//internal/storage/domain", + "//internal/utils", + ], +) + +go_test( + name = "fs_test", + srcs = [ + "beads_test.go", + "context_test.go", + "suite_test.go", + ], + embed = [":fs"], + deps = [ + "//internal/beads", + "//internal/config", + "//internal/configfile", + "//internal/git", + "//internal/storage/backendnames", + "//internal/storage/domain", + "//internal/utils", + "@com_github_stretchr_testify//require", + "@com_github_stretchr_testify//suite", + ], +) diff --git a/internal/storage/domain/git/BUILD.bazel b/internal/storage/domain/git/BUILD.bazel new file mode 100644 index 000000000..28ba7bfa0 --- /dev/null +++ b/internal/storage/domain/git/BUILD.bazel @@ -0,0 +1,25 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "git", + srcs = ["git.go"], + importpath = "github.com/steveyegge/beads/internal/storage/domain/git", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/git", + "//internal/storage/domain", + ], +) + +go_test( + name = "git_test", + srcs = [ + "git_test.go", + "suite_test.go", + ], + embed = [":git"], + deps = [ + "//internal/storage/domain", + "@com_github_stretchr_testify//suite", + ], +) diff --git a/internal/storage/embeddeddolt/BUILD.bazel b/internal/storage/embeddeddolt/BUILD.bazel new file mode 100644 index 000000000..f6b8f77f0 --- /dev/null +++ b/internal/storage/embeddeddolt/BUILD.bazel @@ -0,0 +1,233 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "embeddeddolt", + srcs = [ + "batch_applier.go", + "batch_closer.go", + "batch_creator.go", + "blockingannotator.go", + "bootstrapper.go", + "cache.go", + "cache_cleanup.go", + "child_id.go", + "commenter.go", + "config_metadata.go", + "counter.go", + "counts.go", + "create_issue.go", + "cycle_detector.go", + "deleter.go", + "dependencies.go", + "dependency_editor.go", + "detection.go", + "edgereader.go", + "federation.go", + "get_issue.go", + "graph_counter.go", + "init_verifier.go", + "issue_claimer.go", + "issue_operations.go", + "issue_operations_tx.go", + "issue_reader.go", + "issues.go", + "iter_stubs.go", + "journal_accessor.go", + "labels.go", + "list_queries.go", + "memories.go", + "merge_slot.go", + "metadata_cas.go", + "open.go", + "open_stub.go", + "querier.go", + "queries.go", + "readonly.go", + "ready_claimer.go", + "ready_counter.go", + "relations.go", + "releaser.go", + "schema.go", + "slots.go", + "statistics.go", + "stats_reporter.go", + "store.go", + "store_stub.go", + "sweeper.go", + "transaction.go", + "tree_walker.go", + "version_control.go", + "version_reconciler.go", + "workspace_config.go", + ], + importpath = "github.com/steveyegge/beads/internal/storage/embeddeddolt", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/config", + "//internal/memoryapi", + "//internal/storage", + "//internal/storage/domain", + "//internal/storage/issueops", + "//internal/storage/memoryops", + "//internal/storage/schema", + "//internal/storage/versioncontrolops", + "//internal/types", + "//internal/utils", + "//internal/workapi", + "//internal/workapi/storecounter", + "//internal/workapi/storequerier", + "//internal/workapi/storereader", + "//internal/workapi/storereadycounter", + "//internal/workapi/storestats", + "//internal/workapi/storeversionreconciler", + "//internal/workapi/storeworkspaceconfig", + "//issueops", + "//memoryops", + "@com_github_cenkalti_backoff_v4//:backoff", + "@com_github_dolthub_driver_v2//:driver", + ], +) + +go_test( + name = "embeddeddolt_test", + srcs = [ + "active_database_size_test.go", + "batch_apply_contract_test.go", + "batch_closer_contract_test.go", + "batch_creator_contract_test.go", + "blocked_recompute_test.go", + "blocking_annotator_contract_test.go", + "bootstrapper_contract_test.go", + "cache_cleanup_test.go", + "cache_test.go", + "checked_wrapper_smoke_test.go", + "child_id_test.go", + "claim_wrapper_smoke_test.go", + "claimer_contract_test.go", + "commenter_contract_test.go", + "comments_page_test.go", + "commit_all_cgo_test.go", + "commit_all_internal_test.go", + "commit_nothing_to_commit_test.go", + "concurrency_test.go", + "conformance_test.go", + "counter_contract_test.go", + "counts_missing_table_test.go", + "counts_wisp_test.go", + "create_issue_test.go", + "cross_record_invariant_contract_test.go", + "cross_table_id_collision_test.go", + "cycle_detector_contract_test.go", + "deleter_contract_test.go", + "dependencies_test.go", + "dependency_editor_contract_test.go", + "dependency_editor_version_history_test.go", + "dependents_records_test.go", + "detection_test.go", + "dirty_tables_gate_test.go", + "dualwrite_history_contract_test.go", + "edge_reader_contract_test.go", + "events_since_test.go", + "expected_revision_contract_test.go", + "external_dependencies_test.go", + "federation_credentials_test.go", + "get_issue_test.go", + "graph_counter_contract_test.go", + "history_presence_contract_test.go", + "history_test.go", + "is_blocked_batch_test.go", + "issue_lifecycle_test.go", + "issue_operations_behavior_test.go", + "issue_operations_contract_test.go", + "issue_operations_persistence_test.go", + "issue_operations_staging_test.go", + "journal_accessor_test.go", + "journal_actor_matrix_test.go", + "journal_autoprune_test.go", + "journal_concurrency_test.go", + "journal_contract_test.go", + "journal_retention_test.go", + "journal_truncation_test.go", + "label_list_all_benchmark_test.go", + "lease_replica_test.go", + "lease_test.go", + "lenient_gate_warning_test.go", + "lifecycle_close_reopen_contract_test.go", + "lifecycle_create_contract_test.go", + "lifecycle_role_hooks_test.go", + "lifecycle_update_contract_test.go", + "memories_contract_test.go", + "merge_blockers_test.go", + "merge_strategy_test.go", + "metadata_cas_contract_test.go", + "migrate_dep_rekey_dedup_test.go", + "migrate_events_flip_test.go", + "migrate_frozen_guard_convergence_test.go", + "migrate_ignored_cursor_untrack_test.go", + "migrate_ignored_plane_shape_test.go", + "migrate_journal_shape_repair_test.go", + "migrate_repair_atomicity_test.go", + "migrate_selfheal_test.go", + "migrate_wisp_dep_forward_repair_test.go", + "new_methods_test.go", + "open_test.go", + "post_sql_commit_test.go", + "preview_readonly_test.go", + "promote_no_history_test.go", + "pull_config_wedge_test.go", + "pull_settle_test.go", + "querier_contract_test.go", + "reader_contract_test.go", + "ready_claimer_contract_test.go", + "ready_counter_contract_test.go", + "ready_total_test.go", + "ready_work_missing_table_test.go", + "reject_stale_upsert_test.go", + "relations_contract_test.go", + "releaser_contract_test.go", + "remote_migrate_gate_test.go", + "remote_peer_auth_test.go", + "remote_sync_gate_test.go", + "reopen_category_test.go", + "retention_epoch_contract_test.go", + "role_fixture_kit_test.go", + "role_test_helpers_test.go", + "schema_test.go", + "search_missing_table_test.go", + "stats_reporter_contract_test.go", + "sweeper_contract_test.go", + "test_fixture_test.go", + "test_helpers_pure_test.go", + "transaction_indeterminate_test.go", + "transaction_phase_internal_test.go", + "transaction_wisp_lifecycle_persistence_test.go", + "tree_walker_contract_test.go", + "update_mergeops_test.go", + "version_completeness_behaviour_test.go", + "version_reconciler_contract_test.go", + "workspace_config_contract_test.go", + ], + embed = [":embeddeddolt"], + deps = [ + "//:beads", + "//backend/conformance", + "//internal/debug", + "//internal/eventsjournal", + "//internal/hooks", + "//internal/storage", + "//internal/storage/dberrors", + "//internal/storage/depid", + "//internal/storage/domain/db", + "//internal/storage/externaldeps", + "//internal/storage/issueops", + "//internal/storage/schema", + "//internal/storage/storagecontract", + "//internal/storage/versioncontrolops", + "//internal/types", + "//internal/workapi", + "//issueops", + "@com_github_data_dog_go_sqlmock//:go-sqlmock", + "@com_github_google_uuid//:uuid", + "@org_golang_x_sync//errgroup", + ], +) diff --git a/internal/storage/embeddeddolt/cmd/BUILD.bazel b/internal/storage/embeddeddolt/cmd/BUILD.bazel new file mode 100644 index 000000000..9cc6a5f67 --- /dev/null +++ b/internal/storage/embeddeddolt/cmd/BUILD.bazel @@ -0,0 +1,15 @@ +load("@rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "cmd_lib", + srcs = ["main.go"], + importpath = "github.com/steveyegge/beads/internal/storage/embeddeddolt/cmd", + visibility = ["//visibility:private"], + deps = ["//internal/storage/embeddeddolt"], +) + +go_binary( + name = "cmd", + embed = [":cmd_lib"], + visibility = ["//:__subpackages__"], +) diff --git a/internal/storage/externaldeps/BUILD.bazel b/internal/storage/externaldeps/BUILD.bazel new file mode 100644 index 000000000..b5b75cde8 --- /dev/null +++ b/internal/storage/externaldeps/BUILD.bazel @@ -0,0 +1,43 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "externaldeps", + srcs = [ + "decorator.go", + "resolver.go", + "role_accessors.go", + "uow_decorator.go", + ], + importpath = "github.com/steveyegge/beads/internal/storage/externaldeps", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/storage", + "//internal/storage/domain", + "//internal/storage/issueops", + "//internal/storage/uow", + "//internal/types", + "//internal/workapi", + "//internal/workapi/storereader", + "//internal/workapi/storereadycounter", + "//issueops", + "//memoryops", + ], +) + +go_test( + name = "externaldeps_test", + srcs = [ + "decorator_test.go", + "ready_wake_test.go", + "uow_decorator_test.go", + ], + embed = [":externaldeps"], + deps = [ + "//internal/storage", + "//internal/storage/domain", + "//internal/storage/issueops", + "//internal/storage/uow", + "//internal/types", + "//issueops", + ], +) diff --git a/internal/storage/fs/BUILD.bazel b/internal/storage/fs/BUILD.bazel new file mode 100644 index 000000000..acef63262 --- /dev/null +++ b/internal/storage/fs/BUILD.bazel @@ -0,0 +1,12 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "fs", + srcs = ["provider.go"], + importpath = "github.com/steveyegge/beads/internal/storage/fs", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/storage/domain", + "//internal/storage/domain/fs", + ], +) diff --git a/internal/storage/git/BUILD.bazel b/internal/storage/git/BUILD.bazel new file mode 100644 index 000000000..630162f65 --- /dev/null +++ b/internal/storage/git/BUILD.bazel @@ -0,0 +1,12 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "git", + srcs = ["provider.go"], + importpath = "github.com/steveyegge/beads/internal/storage/git", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/storage/domain", + "//internal/storage/domain/git", + ], +) diff --git a/internal/storage/issueops/BUILD.bazel b/internal/storage/issueops/BUILD.bazel new file mode 100644 index 000000000..8e3cca3f7 --- /dev/null +++ b/internal/storage/issueops/BUILD.bazel @@ -0,0 +1,196 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "issueops", + srcs = [ + "aggregate.go", + "as_of.go", + "batch_apply.go", + "batching.go", + "blocked.go", + "blocked_consistency.go", + "blocked_merge.go", + "blocked_state.go", + "blocking_annotation.go", + "bootstrap.go", + "bulk_ops.go", + "child_id.go", + "claim.go", + "claim_next.go", + "close.go", + "close_batch.go", + "commenter.go", + "comments.go", + "commit_pending.go", + "compaction.go", + "config_helpers.go", + "config_metadata.go", + "count.go", + "create.go", + "create_batch.go", + "create_only_guard.go", + "cycle_report.go", + "cycles.go", + "delete.go", + "delete_role.go", + "dep_counts.go", + "dependencies.go", + "dependency_coordination.go", + "dependency_editor.go", + "dependency_queries.go", + "dependency_tree.go", + "derivedid.go", + "diff.go", + "edge_counts.go", + "edges.go", + "epic_closure.go", + "errors.go", + "events.go", + "execution.go", + "federation.go", + "filters.go", + "get_issue.go", + "helpers.go", + "history.go", + "history_presence.go", + "identity.go", + "journal.go", + "journal_autoprune.go", + "journal_dependencies.go", + "journal_prune.go", + "labels.go", + "lease.go", + "metadata.go", + "metadata_cas.go", + "molecule.go", + "persistence.go", + "promote.go", + "provenance.go", + "public_claim.go", + "public_create.go", + "public_hydration.go", + "public_snapshot.go", + "ready_work.go", + "ready_work_counts.go", + "ready_work_probe.go", + "relations.go", + "release_role.go", + "reopen.go", + "scan.go", + "search.go", + "search_counts.go", + "stale.go", + "statistics.go", + "sweep.go", + "tree_walk.go", + "unclaim.go", + "update.go", + "update_cas.go", + "version.go", + "version_commit.go", + "version_history.go", + "wake_defers.go", + "wisp_filter_convert.go", + "wisp_routing.go", + ], + importpath = "github.com/steveyegge/beads/internal/storage/issueops", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/config", + "//internal/debug", + "//internal/idgen", + "//internal/storage", + "//internal/storage/dberrors", + "//internal/storage/depid", + "//internal/storage/domain", + "//internal/storage/rowid", + "//internal/storage/sqlbuild", + "//internal/types", + "//internal/workapi", + "//issueops", + "@com_github_dolthub_go_mysql_server//sql", + "@com_github_go_sql_driver_mysql//:mysql", + "@com_github_gowebpki_jcs//:jcs", + ], +) + +go_test( + name = "issueops_test", + srcs = [ + "aggregate_authorize_transfer_test.go", + "as_of_test.go", + "batch_apply_test.go", + "batching_test.go", + "blocked_consistency_test.go", + "blocked_state_result_test.go", + "blocked_state_template_test.go", + "close_test.go", + "config_helpers_test.go", + "counts_missing_table_test.go", + "create_only_errors_test.go", + "create_only_guard_test.go", + "create_test.go", + "cycle_report_test.go", + "cycles_test.go", + "delete_cascade_tables_test.go", + "dependencies_test.go", + "dependency_coordination_test.go", + "dependency_queries_test.go", + "dependency_tree_test.go", + "edge_counts_test.go", + "edge_role_requests_test.go", + "execution_test.go", + "filters_test.go", + "get_issue_test.go", + "helpers_test.go", + "identity_parity_test.go", + "journal_autoprune_test.go", + "journal_completeness_test.go", + "journal_prune_test.go", + "journal_truncation_test.go", + "journal_vocabulary_test.go", + "lease_replica_test.go", + "metadata_test.go", + "public_claim_test.go", + "public_create_test.go", + "public_hydration_test.go", + "public_snapshot_test.go", + "ready_work_missing_table_test.go", + "ready_work_test.go", + "reopen_test.go", + "role_requests_test.go", + "row_lock_guard_test.go", + "scan_test.go", + "search_counts_test.go", + "search_goside_sort_test.go", + "search_lite_merge_test.go", + "search_missing_table_test.go", + "search_test.go", + "tree_walk_test.go", + "update_closed_fields_test.go", + "update_force_close_policy_test.go", + "update_mergeops_test.go", + "update_test.go", + "update_validation_test.go", + "version_completeness_test.go", + "version_history_durable_state_test.go", + "version_history_test.go", + "wisp_routing_test.go", + ], + data = glob(["testdata/**"]), + embed = [":issueops"], + deps = [ + "//internal/config", + "//internal/storage", + "//internal/storage/depid", + "//internal/storage/domain", + "//internal/storage/journalscan", + "//internal/storage/sqlbuild", + "//internal/types", + "//internal/validation", + "//issueops", + "@com_github_data_dog_go_sqlmock//:go-sqlmock", + "@com_github_dolthub_go_mysql_server//sql", + "@com_github_go_sql_driver_mysql//:mysql", + ], +) diff --git a/internal/storage/journalscan/BUILD.bazel b/internal/storage/journalscan/BUILD.bazel new file mode 100644 index 000000000..c2eb02e72 --- /dev/null +++ b/internal/storage/journalscan/BUILD.bazel @@ -0,0 +1,14 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "journalscan", + srcs = ["journalscan.go"], + importpath = "github.com/steveyegge/beads/internal/storage/journalscan", + visibility = ["//:__subpackages__"], +) + +go_test( + name = "journalscan_test", + srcs = ["journalscan_test.go"], + embed = [":journalscan"], +) diff --git a/internal/storage/kvkeys/BUILD.bazel b/internal/storage/kvkeys/BUILD.bazel new file mode 100644 index 000000000..be5e1ca3f --- /dev/null +++ b/internal/storage/kvkeys/BUILD.bazel @@ -0,0 +1,14 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "kvkeys", + srcs = ["kvkeys.go"], + importpath = "github.com/steveyegge/beads/internal/storage/kvkeys", + visibility = ["//:__subpackages__"], +) + +go_test( + name = "kvkeys_test", + srcs = ["kvkeys_test.go"], + embed = [":kvkeys"], +) diff --git a/internal/storage/memoryops/BUILD.bazel b/internal/storage/memoryops/BUILD.bazel new file mode 100644 index 000000000..e3acfef33 --- /dev/null +++ b/internal/storage/memoryops/BUILD.bazel @@ -0,0 +1,18 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "memoryops", + srcs = ["memories.go"], + importpath = "github.com/steveyegge/beads/internal/storage/memoryops", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/storage/issueops", + "//internal/storage/kvkeys", + ], +) + +go_test( + name = "memoryops_test", + srcs = ["memories_test.go"], + embed = [":memoryops"], +) diff --git a/internal/storage/rowid/BUILD.bazel b/internal/storage/rowid/BUILD.bazel new file mode 100644 index 000000000..e5b018c05 --- /dev/null +++ b/internal/storage/rowid/BUILD.bazel @@ -0,0 +1,15 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "rowid", + srcs = ["rowid.go"], + importpath = "github.com/steveyegge/beads/internal/storage/rowid", + visibility = ["//:__subpackages__"], + deps = ["@com_github_google_uuid//:uuid"], +) + +go_test( + name = "rowid_test", + srcs = ["rowid_test.go"], + embed = [":rowid"], +) diff --git a/internal/storage/schema/BUILD.bazel b/internal/storage/schema/BUILD.bazel new file mode 100644 index 000000000..c928d24d0 --- /dev/null +++ b/internal/storage/schema/BUILD.bazel @@ -0,0 +1,167 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "schema", + srcs = [ + "aux_row_id_backfill.go", + "backfill.go", + "cli_migrations.go", + "cli_prepared_ddl.go", + "content_skew.go", + "converged.go", + "dep_id_backfill.go", + "dirty_tables_error.go", + "ignored_cursor_untrack.go", + "lock.go", + "migration_content_hashes.go", + "migration_repairs.go", + "remote_migrate_gate.go", + "schema.go", + "smart_remote_migrate_gate.go", + "wisp_dep_forward_repair.go", + ], + embedsrcs = [ + "migrations/0001_create_issues.up.sql", + "migrations/0002_create_dependencies.up.sql", + "migrations/0003_create_labels.up.sql", + "migrations/0004_create_comments.up.sql", + "migrations/0005_create_events.up.sql", + "migrations/0006_create_config.up.sql", + "migrations/0007_create_metadata.up.sql", + "migrations/0008_create_child_counters.up.sql", + "migrations/0009_create_issue_snapshots.up.sql", + "migrations/0010_create_compaction_snapshots.up.sql", + "migrations/0011_create_repo_mtimes.up.sql", + "migrations/0012_create_routes.up.sql", + "migrations/0013_create_issue_counter.up.sql", + "migrations/0014_create_interactions.up.sql", + "migrations/0015_create_federation_peers.up.sql", + "migrations/0016_default_config.up.sql", + "migrations/0017_create_ready_issues_view.up.sql", + "migrations/0018_create_blocked_issues_view.up.sql", + "migrations/0019_wisps_dolt_ignore.up.sql", + "migrations/0020_create_wisps.up.sql", + "migrations/0021_create_wisp_auxiliary.up.sql", + "migrations/0022_wisp_dep_type_index.up.sql", + "migrations/0023_add_no_history_column.up.sql", + "migrations/0024_create_custom_status_type_tables.up.sql", + "migrations/0025_update_ready_issues_view.up.sql", + "migrations/0026_update_blocked_issues_view.up.sql", + "migrations/0027_add_started_at.up.sql", + "migrations/0028_local_state_dolt_ignore.up.sql", + "migrations/0029_create_local_metadata.up.sql", + "migrations/0030_migrate_local_metadata_keys.up.sql", + "migrations/0031_wisp_events_created_at_index.up.sql", + "migrations/0032_drop_schema_migrations_applied_at.up.sql", + "migrations/0033_add_wisp_type_column.up.sql", + "migrations/0034_add_spec_id_column.up.sql", + "migrations/0035_migrate_infra_to_wisps.up.sql", + "migrations/0036_cleanup_autopush_metadata.up.sql", + "migrations/0037_uuid_primary_keys.up.sql", + "migrations/0038_drop_hop_columns.up.sql", + "migrations/0039_drop_child_counters_fk.up.sql", + "migrations/0040_ignored_tables_also_nonlocal_tables.up.sql", + "migrations/0041_split_dependencies_target.up.sql", + "migrations/0042_add_on_update_cascade.up.sql", + "migrations/0043_drop_dependencies_generated_column.up.sql", + "migrations/0044_update_views_drop_depends_on_id.up.sql", + "migrations/0045_update_blocked_view_drop_depends_on_id.up.sql", + "migrations/0046_add_is_blocked.up.sql", + "migrations/0047_recompute_mixed_is_blocked.up.sql", + "migrations/0048_widen_event_value_columns.up.sql", + "migrations/0049_longtext_large_content_columns.up.sql", + "migrations/0050_dependencies_deterministic_id.up.sql", + "migrations/0051_drop_aux_id_defaults.up.sql", + "migrations/0052_add_date_indexes.up.sql", + "migrations/0053_repair_rig_wisps.up.sql", + "migrations/0054_add_lease_columns.up.sql", + "migrations/0055_move_leases_to_table.up.sql", + "migrations/0056_add_comments_keyset_index.up.sql", + "migrations/0057_events_value_columns_idempotent_longtext.up.sql", + "migrations/0058_heal_wisp_dependencies_split_constraints.up.sql", + "migrations/0059_recompute_null_gate_is_blocked.up.sql", + "migrations/0060_add_storage_class.up.sql", + "migrations/0061_content_derived_aux_ids.up.sql", + "migrations/0062_events_dolt_ignore.up.sql", + "migrations/0063_create_provenance_events.up.sql", + "migrations/0064_create_events_journal.up.sql", + "migrations/0065_widen_wisp_comments_text.up.sql", + "migrations/0066_add_events_journal_actor.up.sql", + "migrations/0067_add_versioned_beads_schema.up.sql", + "migrations/0068_add_attribution_status.up.sql", + "migrations/ignored/0001_create_local_state_tables.up.sql", + "migrations/ignored/0002_create_wisp_child_counters.up.sql", + "migrations/ignored/0003_split_wisp_dependencies_target.up.sql", + "migrations/ignored/0004_add_wisp_aux_fks.up.sql", + "migrations/ignored/0005_drop_wisp_dependencies_generated_column.up.sql", + "migrations/ignored/0006_add_wisp_is_blocked.up.sql", + "migrations/ignored/0007_recompute_wisp_is_blocked.up.sql", + "migrations/ignored/0008_widen_wisp_event_value_columns.up.sql", + "migrations/ignored/0009_aux_row_id_rekey_marker.up.sql", + "migrations/ignored/0010_drop_wisp_id_defaults.up.sql", + "migrations/ignored/0011_cleanup_orphaned_child_counters.up.sql", + "migrations/ignored/0012_create_leases.up.sql", + "migrations/ignored/0013_add_wisp_row_lock.up.sql", + "migrations/ignored/0014_add_wisp_comments_keyset_index.up.sql", + "migrations/ignored/0015_recompute_null_gate_wisp_is_blocked.up.sql", + "migrations/ignored/0016_add_lease_granted_node.up.sql", + "migrations/ignored/0017_add_wisps_defer_until_index.up.sql", + "migrations/ignored/0018_aux_row_id_rekey2_marker.up.sql", + "migrations/ignored/0019_create_events.up.sql", + "migrations/ignored/0020_add_wisp_storage_class.up.sql", + "migrations/ignored/0021_widen_wisp_large_content_columns.up.sql", + "migrations/ignored/0022_create_events_journal.up.sql", + "migrations/ignored/0023_repair_events_journal_shape.up.sql", + "migrations/ignored/0024_widen_wisp_comments_text.up.sql", + "migrations/ignored/0025_add_events_journal_actor.up.sql", + "migrations/ignored/0026_dep_rekey_dedup_marker.up.sql", + "migrations/ignored/0027_add_wisps_current_revision.up.sql", + ], + importpath = "github.com/steveyegge/beads/internal/storage/schema", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/debug", + "//internal/storage/dberrors", + "//internal/storage/depid", + "//internal/storage/issueops", + "//internal/storage/rowid", + "//internal/types", + "@org_golang_x_term//:term", + ], +) + +go_test( + name = "schema_test", + srcs = [ + "aux_row_id_backfill_test.go", + "aux_row_id_drift_test.go", + "call_returning_row_test.go", + "cli_prepared_ddl_test.go", + "content_hash_test.go", + "content_skew_test.go", + "converged_test.go", + "cursor_reality_test.go", + "dep_id_backfill_test.go", + "dolt_ignore_seed_test.go", + "ignored_cursor_untrack_test.go", + "lock_test.go", + "migration_0067_versioned_beads_test.go", + "migration_0068_add_attribution_status_test.go", + "migration_body_drain_test.go", + "progress_test.go", + "remote_migrate_gate_test.go", + "schema_skew_test.go", + "schema_test.go", + "shared_store_migrate_gate_test.go", + "smart_remote_migrate_gate_test.go", + ], + embed = [":schema"], + deps = [ + "//internal/debug", + "//internal/storage/depid", + "//internal/storage/rowid", + "//internal/testutil", + "@com_github_data_dog_go_sqlmock//:go-sqlmock", + "@com_github_go_sql_driver_mysql//:mysql", + ], +) diff --git a/internal/storage/sqlbuild/BUILD.bazel b/internal/storage/sqlbuild/BUILD.bazel new file mode 100644 index 000000000..5e8259312 --- /dev/null +++ b/internal/storage/sqlbuild/BUILD.bazel @@ -0,0 +1,35 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "sqlbuild", + srcs = [ + "counts.go", + "filter.go", + "labels.go", + "ready.go", + "reclaim.go", + "sort.go", + "sqlbuild.go", + ], + importpath = "github.com/steveyegge/beads/internal/storage/sqlbuild", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/storage", + "//internal/storage/domain", + "//internal/types", + ], +) + +go_test( + name = "sqlbuild_test", + srcs = [ + "filter_test.go", + "imports_boundary_test.go", + "keyset_test.go", + "labels_test.go", + "reclaim_test.go", + "sqlbuild_test.go", + ], + embed = [":sqlbuild"], + deps = ["//internal/types"], +) diff --git a/internal/storage/storagecontract/BUILD.bazel b/internal/storage/storagecontract/BUILD.bazel new file mode 100644 index 000000000..7589dcc06 --- /dev/null +++ b/internal/storage/storagecontract/BUILD.bazel @@ -0,0 +1,9 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "storagecontract", + srcs = ["history_presence.go"], + importpath = "github.com/steveyegge/beads/internal/storage/storagecontract", + visibility = ["//:__subpackages__"], + deps = ["//internal/storage"], +) diff --git a/internal/storage/uow/BUILD.bazel b/internal/storage/uow/BUILD.bazel new file mode 100644 index 000000000..c855073e2 --- /dev/null +++ b/internal/storage/uow/BUILD.bazel @@ -0,0 +1,177 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "uow", + srcs = [ + "batch_applier.go", + "batch_closer.go", + "batch_creator.go", + "blockingannotator.go", + "bootstrapper.go", + "commenter.go", + "counter.go", + "cycle_detector.go", + "deleter.go", + "dependency_editor.go", + "dolt_sql_provider.go", + "doltserver_provider.go", + "doltserver_tx.go", + "edgereader.go", + "errors.go", + "events_journal.go", + "external_doltserver_provider.go", + "graph_counter.go", + "importer.go", + "init_verifier.go", + "issue_claimer.go", + "issue_operations.go", + "issue_reader.go", + "journal_maintenance.go", + "maintenance.go", + "memories.go", + "metadata_cas.go", + "notifying.go", + "pool.go", + "querier.go", + "ready_claimer.go", + "ready_counter.go", + "relations.go", + "releaser.go", + "stats_reporter.go", + "sweeper.go", + "team_server_schema.go", + "tree_walker.go", + "tx.go", + "uow.go", + "version_reconciler.go", + "wake_defers.go", + "workspace_config.go", + ], + importpath = "github.com/steveyegge/beads/internal/storage/uow", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/config", + "//internal/configfile", + "//internal/debug", + "//internal/hooks", + "//internal/memoryapi", + "//internal/storage", + "//internal/storage/dberrors", + "//internal/storage/dbproxy/proxy", + "//internal/storage/dbproxy/server", + "//internal/storage/dbproxy/util", + "//internal/storage/domain", + "//internal/storage/domain/db", + "//internal/storage/issueops", + "//internal/storage/memoryops", + "//internal/storage/schema", + "//internal/types", + "//internal/workapi", + "//issueops", + "//memoryops", + "@com_github_cenkalti_backoff_v4//:backoff", + "@com_github_go_sql_driver_mysql//:mysql", + ], +) + +go_test( + name = "uow_test", + srcs = [ + "batch_apply_contract_test.go", + "batch_closer_contract_test.go", + "batch_creator_contract_test.go", + "blocking_annotator_contract_test.go", + "bootstrapper_contract_test.go", + "claimer_contract_test.go", + "commenter_contract_test.go", + "counter_contract_test.go", + "cross_record_invariant_contract_test.go", + "cycle_detector_contract_test.go", + "deleter_contract_test.go", + "dependency_editor_contract_test.go", + "dolt_sql_provider_lock_test.go", + "dolt_sql_provider_test.go", + "doltserver_provider_test.go", + "doltserver_tx_test.go", + "dualwrite_history_contract_test.go", + "edge_reader_contract_test.go", + "errors_test.go", + "expected_revision_contract_test.go", + "external_doltserver_provider_test.go", + "graph_counter_contract_test.go", + "importer_contract_test.go", + "importer_uow_test.go", + "issue_claimer_test.go", + "issue_operations_claim_contract_test.go", + "issue_operations_contract_test.go", + "issue_operations_force_close_policy_test.go", + "issue_operations_test.go", + "issue_operations_update_real_uow_test.go", + "issue_reader_test.go", + "journal_contract_test.go", + "journal_delete_actor_test.go", + "journal_scope_test.go", + "lifecycle_close_reopen_contract_test.go", + "lifecycle_create_contract_test.go", + "lifecycle_role_hooks_test.go", + "lifecycle_update_contract_test.go", + "lostupdate_dolt_test.go", + "memories_contract_test.go", + "metadata_cas_contract_test.go", + "metadata_patch_dolt_test.go", + "notifying_integration_test.go", + "notifying_parity_test.go", + "notifying_test.go", + "preview_provider_test.go", + "querier_contract_test.go", + "reader_contract_test.go", + "ready_claimer_contract_test.go", + "ready_counter_contract_test.go", + "relations_contract_test.go", + "releaser_contract_test.go", + "retention_epoch_contract_test.go", + "role_fixture_kit_test.go", + "session_database_test.go", + "shared_server_cleanup_guard_test.go", + "shared_server_cleanup_test.go", + "shared_store_migrate_gate_test.go", + "stats_reporter_contract_test.go", + "sweeper_contract_test.go", + "team_server_integration_test.go", + "team_server_schema_test.go", + "testmain_test.go", + "tree_walker_contract_test.go", + "tx_test.go", + "version_reconcile_boot_test.go", + "version_reconcile_integration_test.go", + "version_reconciler_contract_test.go", + "workspace_config_contract_test.go", + ], + embed = [":uow"], + deps = [ + "//backend/conformance", + "//internal/configfile", + "//internal/doltserver", + "//internal/hooks", + "//internal/procid", + "//internal/storage", + "//internal/storage/dberrors", + "//internal/storage/dbproxy/pidfile", + "//internal/storage/dbproxy/proxy", + "//internal/storage/dbproxy/server", + "//internal/storage/domain", + "//internal/storage/domain/db", + "//internal/storage/issueops", + "//internal/storage/schema", + "//internal/testutil", + "//internal/types", + "//internal/workapi", + "//internal/workapi/storereader", + "//issueops", + "@com_github_cenkalti_backoff_v4//:backoff", + "@com_github_data_dog_go_sqlmock//:go-sqlmock", + "@com_github_go_sql_driver_mysql//:mysql", + "@com_github_stretchr_testify//assert", + "@com_github_stretchr_testify//require", + ], +) diff --git a/internal/storage/versioncontrolops/BUILD.bazel b/internal/storage/versioncontrolops/BUILD.bazel new file mode 100644 index 000000000..7a4ad5fe7 --- /dev/null +++ b/internal/storage/versioncontrolops/BUILD.bazel @@ -0,0 +1,53 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "versioncontrolops", + srcs = [ + "automerge.go", + "backup.go", + "blocked_recompute.go", + "branches.go", + "clone.go", + "commit.go", + "compact.go", + "conflicts.go", + "db.go", + "envguards.go", + "fastforward.go", + "flatten.go", + "gc.go", + "mergesettle.go", + "remoterefs.go", + "remotes.go", + "version_control.go", + ], + importpath = "github.com/steveyegge/beads/internal/storage/versioncontrolops", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/githooksenv", + "//internal/gittraceenv", + "//internal/storage", + "//internal/storage/issueops", + "//internal/storage/kvkeys", + ], +) + +go_test( + name = "versioncontrolops_test", + srcs = [ + "automerge_test.go", + "backup_test.go", + "clone_test.go", + "commit_empty_test.go", + "conflicts_test.go", + "fastforward_test.go", + "gc_test.go", + "remotes_githooks_test.go", + "remotes_gittrace_test.go", + ], + embed = [":versioncontrolops"], + deps = [ + "//internal/githooksenv", + "@com_github_data_dog_go_sqlmock//:go-sqlmock", + ], +) diff --git a/internal/telemetry/BUILD.bazel b/internal/telemetry/BUILD.bazel new file mode 100644 index 000000000..a2d88c3d7 --- /dev/null +++ b/internal/telemetry/BUILD.bazel @@ -0,0 +1,82 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "telemetry", + srcs = [ + "batch_applier.go", + "batch_closer.go", + "batch_creator.go", + "blockingannotator.go", + "bootstrapper.go", + "commenter.go", + "counter.go", + "cycle_detector.go", + "deleter.go", + "dependency_editor.go", + "edgereader.go", + "graph_counter.go", + "init_verifier.go", + "issue_claimer.go", + "issue_operations.go", + "issue_reader.go", + "memories.go", + "metadata_cas.go", + "querier.go", + "ready_claimer.go", + "ready_counter.go", + "relations.go", + "releaser.go", + "stats_reporter.go", + "storage.go", + "sweeper.go", + "telemetry.go", + "tree_walker.go", + "version_reconciler.go", + "workspace_config.go", + ], + importpath = "github.com/steveyegge/beads/internal/telemetry", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/storage", + "//internal/types", + "//issueops", + "//memoryops", + "@io_opentelemetry_go_otel//:otel", + "@io_opentelemetry_go_otel//attribute", + "@io_opentelemetry_go_otel//codes", + "@io_opentelemetry_go_otel//semconv/v1.26.0:v1_26_0", + "@io_opentelemetry_go_otel_exporters_otlp_otlpmetric_otlpmetrichttp//:otlpmetrichttp", + "@io_opentelemetry_go_otel_exporters_stdout_stdoutmetric//:stdoutmetric", + "@io_opentelemetry_go_otel_exporters_stdout_stdouttrace//:stdouttrace", + "@io_opentelemetry_go_otel_metric//:metric", + "@io_opentelemetry_go_otel_metric//noop", + "@io_opentelemetry_go_otel_sdk//resource", + "@io_opentelemetry_go_otel_sdk//trace", + "@io_opentelemetry_go_otel_sdk_metric//:metric", + "@io_opentelemetry_go_otel_trace//:trace", + "@io_opentelemetry_go_otel_trace//noop", + ], +) + +go_test( + name = "telemetry_test", + srcs = [ + "issue_claimer_test.go", + "issue_operations_test.go", + "issue_reader_test.go", + "role_accessor_decorator_test.go", + "storage_test.go", + "telemetry_test.go", + ], + embed = [":telemetry"], + deps = [ + "//internal/storage", + "//internal/storage/externaldeps", + "//issueops", + "//memoryops", + "@io_opentelemetry_go_otel//:otel", + "@io_opentelemetry_go_otel//attribute", + "@io_opentelemetry_go_otel_metric//noop", + "@io_opentelemetry_go_otel_trace//noop", + ], +) diff --git a/internal/templates/BUILD.bazel b/internal/templates/BUILD.bazel new file mode 100644 index 000000000..486d2d183 --- /dev/null +++ b/internal/templates/BUILD.bazel @@ -0,0 +1,12 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "templates", + srcs = ["agent_skill.go"], + embedsrcs = [ + "skills/beads/SKILL.md", + "skills/beads/agents/openai.yaml", + ], + importpath = "github.com/steveyegge/beads/internal/templates", + visibility = ["//:__subpackages__"], +) diff --git a/internal/templates/agents/BUILD.bazel b/internal/templates/agents/BUILD.bazel new file mode 100644 index 000000000..edb3fc13a --- /dev/null +++ b/internal/templates/agents/BUILD.bazel @@ -0,0 +1,26 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "agents", + srcs = [ + "agents.go", + "render.go", + ], + embedsrcs = [ + "defaults/agents.md.tmpl", + "defaults/beads-section-codex.md", + "defaults/beads-section-minimal.md", + "defaults/beads-section.md", + ], + importpath = "github.com/steveyegge/beads/internal/templates/agents", + visibility = ["//:__subpackages__"], +) + +go_test( + name = "agents_test", + srcs = [ + "agents_test.go", + "render_test.go", + ], + embed = [":agents"], +) diff --git a/internal/testutil/BUILD.bazel b/internal/testutil/BUILD.bazel new file mode 100644 index 000000000..3e9d33a76 --- /dev/null +++ b/internal/testutil/BUILD.bazel @@ -0,0 +1,114 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "testutil", + srcs = [ + "container_provider.go", + "container_provider_windows.go", + "dockercontext.go", + "git_test_hooks.go", + "suite_temp.go", + "testdoltbranch.go", + "testdoltcommon.go", + "testdoltserver.go", + "testdoltserver_windows.go", + "tmpfs.go", + ], + importpath = "github.com/steveyegge/beads/internal/testutil", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/storage/doltutil", + "@com_github_go_sql_driver_mysql//:mysql", + ] + select({ + "@rules_go//go/platform:aix": [ + "@com_github_testcontainers_testcontainers_go//:testcontainers-go", + "@com_github_testcontainers_testcontainers_go//exec", + "@com_github_testcontainers_testcontainers_go_modules_dolt//:dolt", + ], + "@rules_go//go/platform:android": [ + "@com_github_testcontainers_testcontainers_go//:testcontainers-go", + "@com_github_testcontainers_testcontainers_go//exec", + "@com_github_testcontainers_testcontainers_go_modules_dolt//:dolt", + ], + "@rules_go//go/platform:darwin": [ + "@com_github_testcontainers_testcontainers_go//:testcontainers-go", + "@com_github_testcontainers_testcontainers_go//exec", + "@com_github_testcontainers_testcontainers_go_modules_dolt//:dolt", + ], + "@rules_go//go/platform:dragonfly": [ + "@com_github_testcontainers_testcontainers_go//:testcontainers-go", + "@com_github_testcontainers_testcontainers_go//exec", + "@com_github_testcontainers_testcontainers_go_modules_dolt//:dolt", + ], + "@rules_go//go/platform:freebsd": [ + "@com_github_testcontainers_testcontainers_go//:testcontainers-go", + "@com_github_testcontainers_testcontainers_go//exec", + "@com_github_testcontainers_testcontainers_go_modules_dolt//:dolt", + ], + "@rules_go//go/platform:illumos": [ + "@com_github_testcontainers_testcontainers_go//:testcontainers-go", + "@com_github_testcontainers_testcontainers_go//exec", + "@com_github_testcontainers_testcontainers_go_modules_dolt//:dolt", + ], + "@rules_go//go/platform:ios": [ + "@com_github_testcontainers_testcontainers_go//:testcontainers-go", + "@com_github_testcontainers_testcontainers_go//exec", + "@com_github_testcontainers_testcontainers_go_modules_dolt//:dolt", + ], + "@rules_go//go/platform:js": [ + "@com_github_testcontainers_testcontainers_go//:testcontainers-go", + "@com_github_testcontainers_testcontainers_go//exec", + "@com_github_testcontainers_testcontainers_go_modules_dolt//:dolt", + ], + "@rules_go//go/platform:linux": [ + "@com_github_testcontainers_testcontainers_go//:testcontainers-go", + "@com_github_testcontainers_testcontainers_go//exec", + "@com_github_testcontainers_testcontainers_go_modules_dolt//:dolt", + ], + "@rules_go//go/platform:netbsd": [ + "@com_github_testcontainers_testcontainers_go//:testcontainers-go", + "@com_github_testcontainers_testcontainers_go//exec", + "@com_github_testcontainers_testcontainers_go_modules_dolt//:dolt", + ], + "@rules_go//go/platform:openbsd": [ + "@com_github_testcontainers_testcontainers_go//:testcontainers-go", + "@com_github_testcontainers_testcontainers_go//exec", + "@com_github_testcontainers_testcontainers_go_modules_dolt//:dolt", + ], + "@rules_go//go/platform:osx": [ + "@com_github_testcontainers_testcontainers_go//:testcontainers-go", + "@com_github_testcontainers_testcontainers_go//exec", + "@com_github_testcontainers_testcontainers_go_modules_dolt//:dolt", + ], + "@rules_go//go/platform:plan9": [ + "@com_github_testcontainers_testcontainers_go//:testcontainers-go", + "@com_github_testcontainers_testcontainers_go//exec", + "@com_github_testcontainers_testcontainers_go_modules_dolt//:dolt", + ], + "@rules_go//go/platform:qnx": [ + "@com_github_testcontainers_testcontainers_go//:testcontainers-go", + "@com_github_testcontainers_testcontainers_go//exec", + "@com_github_testcontainers_testcontainers_go_modules_dolt//:dolt", + ], + "@rules_go//go/platform:solaris": [ + "@com_github_testcontainers_testcontainers_go//:testcontainers-go", + "@com_github_testcontainers_testcontainers_go//exec", + "@com_github_testcontainers_testcontainers_go_modules_dolt//:dolt", + ], + "//conditions:default": [], + }), +) + +go_test( + name = "testutil_test", + srcs = [ + "dockercontext_test.go", + "suite_temp_test.go", + "testdoltbranch_test.go", + "testdoltserver_env_test.go", + "testdoltserver_unreachable_test.go", + "tmpfs_test.go", + ], + data = glob(["testdata/**"]), + embed = [":testutil"], +) diff --git a/internal/testutil/fixtures/BUILD.bazel b/internal/testutil/fixtures/BUILD.bazel new file mode 100644 index 000000000..ae277b5e1 --- /dev/null +++ b/internal/testutil/fixtures/BUILD.bazel @@ -0,0 +1,12 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "fixtures", + srcs = ["fixtures.go"], + importpath = "github.com/steveyegge/beads/internal/testutil/fixtures", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/storage/dolt", + "//internal/types", + ], +) diff --git a/internal/timeparsing/BUILD.bazel b/internal/timeparsing/BUILD.bazel new file mode 100644 index 000000000..3455ac0bc --- /dev/null +++ b/internal/timeparsing/BUILD.bazel @@ -0,0 +1,22 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "timeparsing", + srcs = ["parser.go"], + importpath = "github.com/steveyegge/beads/internal/timeparsing", + visibility = ["//:__subpackages__"], + deps = [ + "@com_github_olebedev_when//:when", + "@com_github_olebedev_when//rules/common", + "@com_github_olebedev_when//rules/en", + ], +) + +go_test( + name = "timeparsing_test", + srcs = [ + "duration_test.go", + "nlp_test.go", + ], + embed = [":timeparsing"], +) diff --git a/internal/tracker/BUILD.bazel b/internal/tracker/BUILD.bazel new file mode 100644 index 000000000..a4decc1f1 --- /dev/null +++ b/internal/tracker/BUILD.bazel @@ -0,0 +1,60 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "tracker", + srcs = [ + "engine.go", + "errors.go", + "multiproject.go", + "registry.go", + "store.go", + "tracker.go", + "types.go", + "uow_store.go", + ], + importpath = "github.com/steveyegge/beads/internal/tracker", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/storage", + "//internal/storage/domain", + "//internal/storage/issueops", + "//internal/storage/uow", + "//internal/types", + "//internal/ui", + "@io_opentelemetry_go_otel//:otel", + "@io_opentelemetry_go_otel//attribute", + "@io_opentelemetry_go_otel//codes", + "@io_opentelemetry_go_otel_trace//:trace", + ], +) + +go_test( + name = "tracker_test", + srcs = [ + "engine_close_policy_test.go", + "engine_create_only_test.go", + "engine_external_ref_history_test.go", + "engine_history_gate_cgo_test.go", + "engine_pull_failure_test.go", + "engine_ratelimit_test.go", + "engine_selective_test.go", + "engine_test.go", + "multiproject_test.go", + "registry_test.go", + "store_test.go", + "test_helpers_pure_test.go", + "testmain_test.go", + "uow_store_engine_test.go", + ], + embed = [":tracker"], + deps = [ + "//internal/storage", + "//internal/storage/dolt", + "//internal/storage/domain", + "//internal/storage/embeddeddolt", + "//internal/storage/issueops", + "//internal/storage/uow", + "//internal/testutil", + "//internal/types", + ], +) diff --git a/internal/tracker/conformance/BUILD.bazel b/internal/tracker/conformance/BUILD.bazel new file mode 100644 index 000000000..2a1060557 --- /dev/null +++ b/internal/tracker/conformance/BUILD.bazel @@ -0,0 +1,28 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "conformance", + srcs = [ + "http.go", + "run.go", + "store.go", + ], + importpath = "github.com/steveyegge/beads/internal/tracker/conformance", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/storage", + "//internal/tracker", + "//internal/types", + ], +) + +go_test( + name = "conformance_test", + srcs = ["conformance_test.go"], + embed = [":conformance"], + deps = [ + "//internal/storage", + "//internal/tracker", + "//internal/types", + ], +) diff --git a/internal/types/BUILD.bazel b/internal/types/BUILD.bazel new file mode 100644 index 000000000..01fe65e2d --- /dev/null +++ b/internal/types/BUILD.bazel @@ -0,0 +1,24 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "types", + srcs = [ + "id_generator.go", + "orphans.go", + "storage_ext.go", + "types.go", + ], + importpath = "github.com/steveyegge/beads/internal/types", + visibility = ["//:__subpackages__"], +) + +go_test( + name = "types_test", + srcs = [ + "explain_test.go", + "id_generator_test.go", + "storage_class_test.go", + "types_test.go", + ], + embed = [":types"], +) diff --git a/internal/ui/BUILD.bazel b/internal/ui/BUILD.bazel new file mode 100644 index 000000000..b28b57666 --- /dev/null +++ b/internal/ui/BUILD.bazel @@ -0,0 +1,33 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "ui", + srcs = [ + "pager.go", + "sanitize.go", + "styles.go", + "terminal.go", + ], + importpath = "github.com/steveyegge/beads/internal/ui", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/types", + "@land_charm_lipgloss_v2//:lipgloss", + "@org_golang_x_term//:term", + ], +) + +go_test( + name = "ui_test", + srcs = [ + "pager_test.go", + "sanitize_test.go", + "styles_test.go", + "terminal_test.go", + ], + embed = [":ui"], + deps = [ + "//internal/types", + "@land_charm_lipgloss_v2//:lipgloss", + ], +) diff --git a/internal/uimd/BUILD.bazel b/internal/uimd/BUILD.bazel new file mode 100644 index 000000000..bb9d29bb0 --- /dev/null +++ b/internal/uimd/BUILD.bazel @@ -0,0 +1,21 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "uimd", + srcs = ["markdown.go"], + importpath = "github.com/steveyegge/beads/internal/uimd", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/ui", + "@com_github_charmbracelet_x_ansi//:ansi", + "@land_charm_glamour_v2//:glamour", + "@land_charm_glamour_v2//styles", + "@org_golang_x_term//:term", + ], +) + +go_test( + name = "uimd_test", + srcs = ["markdown_test.go"], + embed = [":uimd"], +) diff --git a/internal/utils/BUILD.bazel b/internal/utils/BUILD.bazel new file mode 100644 index 000000000..711268577 --- /dev/null +++ b/internal/utils/BUILD.bazel @@ -0,0 +1,47 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "utils", + srcs = [ + "id_parser.go", + "issue_id.go", + "path.go", + "path_case_darwin.go", + "path_case_other.go", + "strings.go", + ], + importpath = "github.com/steveyegge/beads/internal/utils", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/types", + ] + select({ + "@rules_go//go/platform:darwin": [ + "@org_golang_x_sys//unix", + ], + "@rules_go//go/platform:ios": [ + "@org_golang_x_sys//unix", + ], + "//conditions:default": [], + }), +) + +go_test( + name = "utils_test", + srcs = [ + "id_parser_prefix_test.go", + "id_parser_test.go", + "id_parser_unit_test.go", + "issue_446_test.go", + "issue_id_test.go", + "path_case_test.go", + "path_test.go", + "strings_test.go", + "testmain_test.go", + ], + embed = [":utils"], + deps = [ + "//internal/storage/dolt", + "//internal/testutil", + "//internal/types", + ], +) diff --git a/internal/validation/BUILD.bazel b/internal/validation/BUILD.bazel new file mode 100644 index 000000000..46bf8895d --- /dev/null +++ b/internal/validation/BUILD.bazel @@ -0,0 +1,32 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "validation", + srcs = [ + "bead.go", + "issue.go", + "template.go", + ], + importpath = "github.com/steveyegge/beads/internal/validation", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/config", + "//internal/types", + "//internal/utils", + ], +) + +go_test( + name = "validation_test", + srcs = [ + "bead_test.go", + "issue_test.go", + "template_lint_sections_test.go", + "template_test.go", + ], + embed = [":validation"], + deps = [ + "//internal/config", + "//internal/types", + ], +) diff --git a/internal/workapi/BUILD.bazel b/internal/workapi/BUILD.bazel new file mode 100644 index 000000000..877ce8fce --- /dev/null +++ b/internal/workapi/BUILD.bazel @@ -0,0 +1,71 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "workapi", + srcs = [ + "bootstrap.go", + "count.go", + "delete.go", + "detail.go", + "doc.go", + "list.go", + "metadata.go", + "page.go", + "query.go", + "ready.go", + "release.go", + "sort.go", + "stats.go", + "sweep.go", + "versionreconcile.go", + "workspaceconfig.go", + ], + importpath = "github.com/steveyegge/beads/internal/workapi", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/config", + "//internal/query", + "//internal/storage", + "//internal/storage/domain", + "//internal/storage/kvkeys", + "//internal/types", + "//internal/utils", + "//issueops", + ], +) + +go_test( + name = "workapi_test", + srcs = [ + "bootstrap_test.go", + "count_test.go", + "delete_test.go", + "detail_test.go", + "list_ephemeral_test.go", + "list_golden_test.go", + "list_keyset_test.go", + "list_pinned_test.go", + "list_ready_status_test.go", + "list_status_test.go", + "page_test.go", + "query_test.go", + "race_detector_off_test.go", + "race_detector_on_test.go", + "ready_count_test.go", + "ready_golden_test.go", + "ready_test.go", + "release_test.go", + "stats_test.go", + "sweep_test.go", + "versionreconcile_test.go", + "workspaceconfig_test.go", + ], + data = glob(["testdata/**"]), + embed = [":workapi"], + deps = [ + "//internal/storage", + "//internal/storage/domain", + "//internal/types", + "//issueops", + ], +) diff --git a/internal/workapi/storecounter/BUILD.bazel b/internal/workapi/storecounter/BUILD.bazel new file mode 100644 index 000000000..e200739bd --- /dev/null +++ b/internal/workapi/storecounter/BUILD.bazel @@ -0,0 +1,14 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "storecounter", + srcs = ["counter.go"], + importpath = "github.com/steveyegge/beads/internal/workapi/storecounter", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/storage", + "//internal/types", + "//internal/workapi", + "//issueops", + ], +) diff --git a/internal/workapi/storequerier/BUILD.bazel b/internal/workapi/storequerier/BUILD.bazel new file mode 100644 index 000000000..72cb226c6 --- /dev/null +++ b/internal/workapi/storequerier/BUILD.bazel @@ -0,0 +1,13 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "storequerier", + srcs = ["querier.go"], + importpath = "github.com/steveyegge/beads/internal/workapi/storequerier", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/storage", + "//internal/workapi", + "//issueops", + ], +) diff --git a/internal/workapi/storereader/BUILD.bazel b/internal/workapi/storereader/BUILD.bazel new file mode 100644 index 000000000..16a5105dc --- /dev/null +++ b/internal/workapi/storereader/BUILD.bazel @@ -0,0 +1,25 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "storereader", + srcs = ["reader.go"], + importpath = "github.com/steveyegge/beads/internal/workapi/storereader", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/storage", + "//internal/types", + "//internal/workapi", + "//issueops", + ], +) + +go_test( + name = "storereader_test", + srcs = ["reader_test.go"], + embed = [":storereader"], + deps = [ + "//internal/storage", + "//internal/types", + "//issueops", + ], +) diff --git a/internal/workapi/storereadycounter/BUILD.bazel b/internal/workapi/storereadycounter/BUILD.bazel new file mode 100644 index 000000000..8ab96877b --- /dev/null +++ b/internal/workapi/storereadycounter/BUILD.bazel @@ -0,0 +1,13 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "storereadycounter", + srcs = ["counter.go"], + importpath = "github.com/steveyegge/beads/internal/workapi/storereadycounter", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/storage", + "//internal/workapi", + "//issueops", + ], +) diff --git a/internal/workapi/storestats/BUILD.bazel b/internal/workapi/storestats/BUILD.bazel new file mode 100644 index 000000000..f29b27789 --- /dev/null +++ b/internal/workapi/storestats/BUILD.bazel @@ -0,0 +1,14 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "storestats", + srcs = ["reporter.go"], + importpath = "github.com/steveyegge/beads/internal/workapi/storestats", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/storage", + "//internal/types", + "//internal/workapi", + "//issueops", + ], +) diff --git a/internal/workapi/storeversionreconciler/BUILD.bazel b/internal/workapi/storeversionreconciler/BUILD.bazel new file mode 100644 index 000000000..7d5b03eec --- /dev/null +++ b/internal/workapi/storeversionreconciler/BUILD.bazel @@ -0,0 +1,13 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "storeversionreconciler", + srcs = ["versionreconciler.go"], + importpath = "github.com/steveyegge/beads/internal/workapi/storeversionreconciler", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/storage", + "//internal/workapi", + "//issueops", + ], +) diff --git a/internal/workapi/storeworkspaceconfig/BUILD.bazel b/internal/workapi/storeworkspaceconfig/BUILD.bazel new file mode 100644 index 000000000..33fe08f81 --- /dev/null +++ b/internal/workapi/storeworkspaceconfig/BUILD.bazel @@ -0,0 +1,13 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "storeworkspaceconfig", + srcs = ["workspaceconfig.go"], + importpath = "github.com/steveyegge/beads/internal/workapi/storeworkspaceconfig", + visibility = ["//:__subpackages__"], + deps = [ + "//internal/storage", + "//internal/workapi", + "//issueops", + ], +) diff --git a/internal/workspacegate/BUILD.bazel b/internal/workspacegate/BUILD.bazel new file mode 100644 index 000000000..54fbdad7d --- /dev/null +++ b/internal/workspacegate/BUILD.bazel @@ -0,0 +1,15 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "workspacegate", + srcs = ["gate.go"], + importpath = "github.com/steveyegge/beads/internal/workspacegate", + visibility = ["//:__subpackages__"], + deps = ["//internal/lockfile"], +) + +go_test( + name = "workspacegate_test", + srcs = ["gate_test.go"], + embed = [":workspacegate"], +) diff --git a/internal/worktreeremove/BUILD.bazel b/internal/worktreeremove/BUILD.bazel new file mode 100644 index 000000000..ea9020fcb --- /dev/null +++ b/internal/worktreeremove/BUILD.bazel @@ -0,0 +1,14 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "worktreeremove", + srcs = ["policy.go"], + importpath = "github.com/steveyegge/beads/internal/worktreeremove", + visibility = ["//:__subpackages__"], +) + +go_test( + name = "worktreeremove_test", + srcs = ["policy_test.go"], + embed = [":worktreeremove"], +) diff --git a/issueops/BUILD.bazel b/issueops/BUILD.bazel new file mode 100644 index 000000000..c7e7ac0b5 --- /dev/null +++ b/issueops/BUILD.bazel @@ -0,0 +1,56 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "issueops", + srcs = [ + "batchapplier.go", + "batchcloser.go", + "batchcreator.go", + "blockedstate.go", + "blockingannotator.go", + "bootstrapper.go", + "claimer.go", + "commenter.go", + "counter.go", + "cycledetector.go", + "deleter.go", + "dependencyeditor.go", + "edgereader.go", + "errors.go", + "graphcounter.go", + "importer.go", + "initverifier.go", + "issueops.go", + "metadatacas.go", + "querier.go", + "reader.go", + "reader_ready_scope.go", + "readyclaimer.go", + "readycounter.go", + "relations.go", + "releaser.go", + "statsreporter.go", + "sweeper.go", + "treewalker.go", + "versionreconciler.go", + "workspaceconfig.go", + ], + importpath = "github.com/steveyegge/beads/issueops", + visibility = ["//visibility:public"], + deps = [ + "//beadserrors", + "//internal/types", + ], +) + +go_test( + name = "issueops_test", + srcs = [ + "claimer_external_test.go", + "issueops_external_test.go", + ], + deps = [ + ":issueops", + "//:beads", + ], +) diff --git a/journalops/BUILD.bazel b/journalops/BUILD.bazel new file mode 100644 index 000000000..875174526 --- /dev/null +++ b/journalops/BUILD.bazel @@ -0,0 +1,12 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "journalops", + srcs = [ + "doc.go", + "errors.go", + "journal.go", + ], + importpath = "github.com/steveyegge/beads/journalops", + visibility = ["//visibility:public"], +) diff --git a/memoryops/BUILD.bazel b/memoryops/BUILD.bazel new file mode 100644 index 000000000..e7c7f072e --- /dev/null +++ b/memoryops/BUILD.bazel @@ -0,0 +1,13 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "memoryops", + srcs = [ + "doc.go", + "errors.go", + "memories.go", + ], + importpath = "github.com/steveyegge/beads/memoryops", + visibility = ["//visibility:public"], + deps = ["//beadserrors"], +) diff --git a/plugins/beads/BUILD.bazel b/plugins/beads/BUILD.bazel new file mode 100644 index 000000000..c2126041b --- /dev/null +++ b/plugins/beads/BUILD.bazel @@ -0,0 +1,9 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "beads", + srcs = ["copilot_manifest.go"], + embedsrcs = [".copilot-plugin/plugin.json"], + importpath = "github.com/steveyegge/beads/plugins/beads", + visibility = ["//visibility:public"], +) diff --git a/schema/BUILD.bazel b/schema/BUILD.bazel new file mode 100644 index 000000000..c2de6036f --- /dev/null +++ b/schema/BUILD.bazel @@ -0,0 +1,15 @@ +load("@rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "schema", + srcs = ["schema.go"], + importpath = "github.com/steveyegge/beads/schema", + visibility = ["//visibility:public"], + deps = ["//internal/storage/schema"], +) + +go_test( + name = "schema_test", + srcs = ["schema_test.go"], + deps = [":schema"], +) diff --git a/scripts/BUILD.bazel b/scripts/BUILD.bazel new file mode 100644 index 000000000..472aa9c2b --- /dev/null +++ b/scripts/BUILD.bazel @@ -0,0 +1,24 @@ +load("@rules_go//go:def.bzl", "go_test") + +go_test( + name = "scripts_test", + srcs = [ + "bazel_policy_test.go", + "check_build_tags_test.go", + "check_testing_short_test.go", + "ci_capability_selector_test.go", + "ci_workflow_apt_get_timeout_test.go", + "ci_workflow_test.go", + "complexity_script_test.go", + "conformance_script_test.go", + "install_dolt_test.go", + "pull_dolt_image_test.go", + "release_script_test.go", + "test_script_test.go", + ], + data = ["//:bazel_policy_files"], + deps = [ + "//internal/formula", + "@in_gopkg_yaml_v3//:yaml_v3", + ], +) diff --git a/scripts/bazel_policy_test.go b/scripts/bazel_policy_test.go new file mode 100644 index 000000000..4226a7a98 --- /dev/null +++ b/scripts/bazel_policy_test.go @@ -0,0 +1,498 @@ +package scripts_test + +import ( + "bufio" + "bytes" + "errors" + "os" + "os/exec" + "path/filepath" + "regexp" + "strconv" + "strings" + "testing" +) + +// Policy tests for the side-by-side Bazel configuration. They are plain Go +// tests so they run under `go test ./scripts` and `bazel test //scripts:...` +// alike. Each invariant is a pure check function exercised against the real +// repository files and against synthetic fixtures that break it. + +// bazelPolicyRoot returns the repository root holding the Bazel policy files. +// Under `bazel test` those files are declared as data (//:bazel_policy_files) +// and resolved from the runfiles tree; under `go test` the source checkout is +// used directly. +func bazelPolicyRoot(t *testing.T) string { + t.Helper() + if srcdir := os.Getenv("TEST_SRCDIR"); srcdir != "" { + workspace := os.Getenv("TEST_WORKSPACE") + if workspace == "" { + workspace = "_main" + } + return filepath.Join(srcdir, workspace) + } + return sourceRepoRoot(t) +} + +func readPolicyFile(t *testing.T, root, name string) string { + t.Helper() + data, err := os.ReadFile(filepath.Join(root, name)) + if err != nil { + t.Fatalf("read %s: %v", name, err) + } + return string(data) +} + +// --- go_sdk version == go.mod toolchain ------------------------------------- + +var ( + goModToolchainRe = regexp.MustCompile(`(?m)^toolchain\s+go(\S+)\s*$`) + goModGoRe = regexp.MustCompile(`(?m)^go\s+(\S+)\s*$`) + goSDKDownloadRe = regexp.MustCompile(`(?s)go_sdk\.download\((.*?)\)`) + starlarkVersion = regexp.MustCompile(`\bversion\s*=\s*"([^"]+)"`) +) + +// goModToolchainVersion returns the Go version go.mod selects: the toolchain +// directive when present, otherwise the go directive. +func goModToolchainVersion(goMod string) (string, error) { + if m := goModToolchainRe.FindStringSubmatch(goMod); m != nil { + return m[1], nil + } + if m := goModGoRe.FindStringSubmatch(goMod); m != nil { + return m[1], nil + } + return "", errors.New("go.mod has neither a toolchain nor a go directive") +} + +// moduleGoSDKVersions returns the version of every go_sdk.download(...) call. +func moduleGoSDKVersions(module string) []string { + var versions []string + for _, call := range goSDKDownloadRe.FindAllStringSubmatch(stripStarlarkComments(module), -1) { + if m := starlarkVersion.FindStringSubmatch(call[1]); m != nil { + versions = append(versions, m[1]) + } else { + versions = append(versions, "") + } + } + return versions +} + +func stripStarlarkComments(src string) string { + var out strings.Builder + for _, line := range strings.Split(src, "\n") { + if strings.HasPrefix(strings.TrimSpace(line), "#") { + continue + } + out.WriteString(line) + out.WriteByte('\n') + } + return out.String() +} + +func checkGoSDKMatchesToolchain(module, goMod string) error { + want, err := goModToolchainVersion(goMod) + if err != nil { + return err + } + versions := moduleGoSDKVersions(module) + if len(versions) == 0 { + return errors.New("MODULE.bazel has no go_sdk.download(...) call") + } + for _, got := range versions { + if got != want { + return errors.New("MODULE.bazel go_sdk.download version " + strconv.Quote(got) + + " != go.mod toolchain " + strconv.Quote(want) + "; update them in lockstep") + } + } + return nil +} + +func TestBazelGoSDKMatchesGoModToolchain(t *testing.T) { + root := bazelPolicyRoot(t) + if err := checkGoSDKMatchesToolchain(readPolicyFile(t, root, "MODULE.bazel"), readPolicyFile(t, root, "go.mod")); err != nil { + t.Fatal(err) + } + + goMod := "module example.com/m\n\ngo 1.26.0\n\ntoolchain go1.26.7\n" + for name, module := range map[string]string{ + "skewed": "go_sdk.download(\n name = \"go_sdk\",\n version = \"1.26.6\",\n)\n", + "missing": "bazel_dep(name = \"rules_go\", version = \"0.63.0\")\n", + "no version": "go_sdk.download(name = \"go_sdk\")\n", + "commented": "# go_sdk.download(version = \"1.26.7\")\n", + "second skew": "go_sdk.download(version = \"1.26.7\")\ngo_sdk.download(version = \"1.25.0\")\n", + } { + if err := checkGoSDKMatchesToolchain(module, goMod); err == nil { + t.Errorf("%s: expected a mismatch error for MODULE.bazel fixture:\n%s", name, module) + } + } + if err := checkGoSDKMatchesToolchain("go_sdk.download(version = \"1.26.7\")\n", goMod); err != nil { + t.Errorf("matching fixture rejected: %v", err) + } + if err := checkGoSDKMatchesToolchain("go_sdk.download(version = \"1.26.0\")\n", "module m\n\ngo 1.26.0\n"); err != nil { + t.Errorf("go directive fallback rejected: %v", err) + } +} + +// --- ICU policy: gms_pure_go under Bazel ------------------------------------ + +var bazelrcPureGoTagRe = regexp.MustCompile( + `^(build|common)\s+(?:.*\s)?--@@?rules_go//go/config:tags=(?:[^\s,]+,)*gms_pure_go(?:,[^\s,]+)*(?:\s|$)`) + +// checkBazelrcSetsPureGo requires a build (or common) line that sets the +// gms_pure_go tag, so every bazel build/test/run links the pure-Go regex +// backend (engdocs/ICU-POLICY.md). +func checkBazelrcSetsPureGo(bazelrc string) error { + for _, line := range strings.Split(bazelrc, "\n") { + line = strings.TrimSpace(line) + if line == "" || strings.HasPrefix(line, "#") { + continue + } + if bazelrcPureGoTagRe.MatchString(line) { + return nil + } + } + return errors.New(".bazelrc must contain `build --@rules_go//go/config:tags=gms_pure_go` (engdocs/ICU-POLICY.md)") +} + +// checkModulePrunesICU requires the go-mysql-server gazelle_override that +// selects the pure-Go regex file and excludes the cgo/ICU one; without it +// gazelle keeps the go-icu-regex (libicu) dependency edge. +func checkModulePrunesICU(module string) error { + module = stripStarlarkComments(module) + for _, call := range regexp.MustCompile(`(?s)go_deps\.gazelle_override\((.*?)\n\)`).FindAllStringSubmatch(module, -1) { + body := call[1] + if !strings.Contains(body, `"github.com/dolthub/go-mysql-server"`) { + continue + } + if !strings.Contains(body, `"gazelle:build_tags gms_pure_go"`) { + return errors.New("go-mysql-server gazelle_override lacks \"gazelle:build_tags gms_pure_go\"") + } + if !strings.Contains(body, `"gazelle:exclude internal/regex/regex_cgo.go"`) { + return errors.New("go-mysql-server gazelle_override lacks \"gazelle:exclude internal/regex/regex_cgo.go\"") + } + return nil + } + return errors.New("MODULE.bazel has no go_deps.gazelle_override for github.com/dolthub/go-mysql-server") +} + +func TestBazelICUPolicy(t *testing.T) { + root := bazelPolicyRoot(t) + if err := checkBazelrcSetsPureGo(readPolicyFile(t, root, ".bazelrc")); err != nil { + t.Error(err) + } + if err := checkModulePrunesICU(readPolicyFile(t, root, "MODULE.bazel")); err != nil { + t.Error(err) + } + if !regexp.MustCompile(`(?m)^# gazelle:build_tags (?:\S+,)*gms_pure_go(?:,\S+)*\s*$`).MatchString(readPolicyFile(t, root, "BUILD.bazel")) { + t.Error("root BUILD.bazel must carry `# gazelle:build_tags gms_pure_go`") + } + + for name, rc := range map[string]string{ + "absent": "build --incompatible_strict_action_env\n", + "commented": "# build --@rules_go//go/config:tags=gms_pure_go\n", + "test only": "test --@rules_go//go/config:tags=gms_pure_go\n", + "config only": "build:remote-exec --@rules_go//go/config:tags=gms_pure_go\n", + "lookalike": "build --@rules_go//go/config:tags=gms_pure_go_x\n", + } { + if err := checkBazelrcSetsPureGo(rc); err == nil { + t.Errorf("%s: expected .bazelrc fixture to be rejected:\n%s", name, rc) + } + } + for _, rc := range []string{ + "build --@rules_go//go/config:tags=gms_pure_go\n", + "common --@rules_go//go/config:tags=foo,gms_pure_go\n", + "build --@@rules_go//go/config:tags=gms_pure_go,bar # trailing\n", + } { + if err := checkBazelrcSetsPureGo(rc); err != nil { + t.Errorf("valid .bazelrc fixture rejected: %q: %v", rc, err) + } + } + + override := "go_deps.gazelle_override(\n directives = [\n \"gazelle:build_tags gms_pure_go\",\n%s ],\n path = \"github.com/dolthub/go-mysql-server\",\n)\n" + if err := checkModulePrunesICU(strings.Replace(override, "%s", "", 1)); err == nil { + t.Error("gazelle_override without the regex_cgo.go exclude was accepted") + } + if err := checkModulePrunesICU(strings.Replace(override, "%s", " \"gazelle:exclude internal/regex/regex_cgo.go\",\n", 1)); err != nil { + t.Errorf("complete gazelle_override rejected: %v", err) + } +} + +// --- .bazelversion pinned --------------------------------------------------- + +func checkBazelVersionPin(content string) error { + v := strings.TrimSpace(content) + if !regexp.MustCompile(`^\d+\.\d+\.\d+(?:rc\d+)?$`).MatchString(v) { + return errors.New(".bazelversion must pin an exact Bazel release (e.g. 9.2.0), got " + strconv.Quote(v)) + } + return nil +} + +func TestBazelVersionPinned(t *testing.T) { + root := bazelPolicyRoot(t) + content, err := os.ReadFile(filepath.Join(root, ".bazelversion")) + if err != nil { + t.Fatalf(".bazelversion must exist so bazelisk pins one Bazel release: %v", err) + } + if err := checkBazelVersionPin(string(content)); err != nil { + t.Error(err) + } + for _, bad := range []string{"", "latest", "9.x", "9", "last_green"} { + if checkBazelVersionPin(bad) == nil { + t.Errorf(".bazelversion fixture %q was accepted", bad) + } + } +} + +// --- machine-local rc files are gitignored ---------------------------------- + +// bazelLocalRCFiles hold a developer's remote-executor endpoint and TLS +// credential paths; they must never be committed. +var bazelLocalRCFiles = []string{".bazelrc.local", "user.bazelrc"} + +// checkGitignoreCoversLocalRCs reports local rc files that no top-level +// .gitignore pattern ignores (or that a later negation re-includes). It +// understands the literal and root-anchored forms used for these files. +func checkGitignoreCoversLocalRCs(gitignore string) []string { + ignored := map[string]bool{} + for _, line := range strings.Split(gitignore, "\n") { + line = strings.TrimSpace(line) + if line == "" || strings.HasPrefix(line, "#") { + continue + } + negate := strings.HasPrefix(line, "!") + pattern := strings.TrimPrefix(strings.TrimPrefix(line, "!"), "/") + for _, name := range bazelLocalRCFiles { + if ok, _ := filepath.Match(pattern, name); ok { + ignored[name] = !negate + } + } + } + var missing []string + for _, name := range bazelLocalRCFiles { + if !ignored[name] { + missing = append(missing, name) + } + } + return missing +} + +func TestBazelLocalRCFilesGitignored(t *testing.T) { + root := bazelPolicyRoot(t) + if missing := checkGitignoreCoversLocalRCs(readPolicyFile(t, root, ".gitignore")); len(missing) > 0 { + t.Errorf(".gitignore must ignore %v (they carry remote endpoints and credential paths)", missing) + } + // Cross-check with git itself when running from a checkout. + if gitRepoAvailable(root) { + for _, name := range bazelLocalRCFiles { + cmd := exec.Command("git", "-C", root, "check-ignore", "-q", "--no-index", name) + if err := cmd.Run(); err != nil { + t.Errorf("git check-ignore %s: not ignored (%v)", name, err) + } + } + } + + if missing := checkGitignoreCoversLocalRCs("/bazel-*\n"); len(missing) != 2 { + t.Errorf("fixture without rc patterns: missing = %v, want both", missing) + } + if missing := checkGitignoreCoversLocalRCs("/.bazelrc.local\n/user.bazelrc\n!user.bazelrc\n"); len(missing) != 1 || missing[0] != "user.bazelrc" { + t.Errorf("fixture with negation: missing = %v, want [user.bazelrc]", missing) + } + if missing := checkGitignoreCoversLocalRCs("*.bazelrc.local\nuser.bazelrc\n"); len(missing) != 0 { + t.Errorf("fixture with glob patterns: missing = %v, want none", missing) + } +} + +// --- no remote-execution endpoints in tracked files ------------------------- + +// Remote-execution endpoints, credentials and TLS material belong in a +// gitignored user.bazelrc/.bazelrc.local or a CI-generated rc outside the +// workspace, never in the repository. The scan covers committed bazelrc-like +// files, Markdown docs and .github/** (plan ยง3.8) and flags: +// - any remote/BES/TLS flag below whose value is a literal (not a +// , a $VARIABLE/${{ expression }}, empty, or loopback); +// - in rc and .github files, any gRPC URL that is not loopback. Markdown is +// exempt from this rule because beads documents OTel gRPC exporters. + +var ( + remoteFlagNames = `remote_executor|remote_cache|remote_downloader|remote_header|remote_instance_name|` + + `bes_backend|bes_results_url|bes_header|tls_client_certificate|tls_client_key|tls_certificate` + // `--flag=value` is recognized everywhere; `--flag value` only in rc and + // workflow files, where prose ("--remote_executor and ...") does not occur. + remoteFlagEqRe = regexp.MustCompile(`--(` + remoteFlagNames + `)=("[^"]*"|'[^']*'|[^\s"'` + "`" + `]*)`) + remoteFlagSpaceRe = regexp.MustCompile(`--(` + remoteFlagNames + `)\s+("[^"]*"|'[^']*'|[^\s"'` + "`" + `]+)`) + remoteEndpointRe = regexp.MustCompile(`\bgrpcs?://[^\s"'<>)\]]+`) + loopbackValueRe = regexp.MustCompile(`^(?:[a-z][a-z0-9+.-]*://)?(?:127\.0\.0\.1|localhost|\[::1\])(?:[:/]|$)`) + // remoteScanPrefilter: a file lacking all of these cannot produce a hit. + remoteScanPrefilter = [][]byte{[]byte("--remote_"), []byte("--bes_"), []byte("--tls_"), []byte("grpc")} +) + +type endpointHit struct { + path string + line int + what string +} + +// remoteScanKind classifies a tracked path for the endpoint scan. +func remoteScanKind(rel string) (scan, strict bool) { + base := filepath.Base(rel) + switch { + case strings.Contains(base, "bazelrc"), strings.HasPrefix(rel, ".github/"): + return true, true + case strings.HasSuffix(base, ".md"): + return true, false + } + return false, false +} + +func allowedRemoteValue(v string) bool { + v = strings.Trim(v, `"'`) + if i := strings.Index(v, "://"); i >= 0 { + v = v[i+len("://"):] + } + return v == "" || strings.HasPrefix(v, "<") || strings.HasPrefix(v, "$") || loopbackValueRe.MatchString(v) +} + +// findRemoteEndpoints reports literal remote endpoints/credentials in content. +// strict enables the whitespace-separated flag form and the gRPC URL rule. +func findRemoteEndpoints(path string, content []byte, strict bool) []endpointHit { + if bytes.IndexByte(content, 0) >= 0 { // binary + return nil + } + relevant := false + for _, needle := range remoteScanPrefilter { + if bytes.Contains(content, needle) { + relevant = true + break + } + } + if !relevant { + return nil + } + flagRes := []*regexp.Regexp{remoteFlagEqRe} + if strict { + flagRes = append(flagRes, remoteFlagSpaceRe) + } + var hits []endpointHit + scanner := bufio.NewScanner(bytes.NewReader(content)) + scanner.Buffer(make([]byte, 0, 64*1024), 16*1024*1024) + for n := 1; scanner.Scan(); n++ { + line := scanner.Text() + for _, re := range flagRes { + for _, m := range re.FindAllStringSubmatch(line, -1) { + if !allowedRemoteValue(m[2]) { + hits = append(hits, endpointHit{path: path, line: n, what: m[0]}) + } + } + } + if strict { + for _, url := range remoteEndpointRe.FindAllString(line, -1) { + if !allowedRemoteValue(url) { + hits = append(hits, endpointHit{path: path, line: n, what: url}) + } + } + } + } + return hits +} + +func gitRepoAvailable(root string) bool { + if _, err := exec.LookPath("git"); err != nil { + return false + } + return exec.Command("git", "-C", root, "rev-parse", "--is-inside-work-tree").Run() == nil +} + +func TestBazelNoRemoteEndpointsInTrackedFiles(t *testing.T) { + // Fixtures are assembled at runtime so this file never contains a literal + // endpoint itself. + scheme := "grpc" + "s://" + flag := func(name string) string { return "--" + name } + for _, bad := range []string{ + "build:remote-exec " + flag("remote_executor") + "=" + scheme + "rbe.example.com:443\n", + "build:remote-exec " + flag("remote_executor") + "=rbe.example.com:443\n", + "build:remote-exec " + flag("remote_executor") + " rbe.example.com:443\n", + "build " + flag("remote_cache") + "=https://cache.example.com\n", + "build " + flag("bes_backend") + "=bes.example.com\n", + "build " + flag("bes_results_url") + "=https://results.example.com/inv/\n", + "build " + flag("remote_header") + "=x-api-key=abc123\n", + "build " + flag("tls_client_certificate") + "=/etc/rbe/client.crt\n", + "build " + flag("tls_client_key") + "=\"/etc/rbe/client.key\"\n", + "# farm: " + scheme + "10.0.0.5:8980\n", + "REMOTE=" + "grpc" + "://cache.internal:9092\n", + } { + if len(findRemoteEndpoints(".bazelrc", []byte(bad), true)) == 0 { + t.Errorf("endpoint fixture not detected: %q", bad) + } + } + for _, ok := range []string{ + "build:remote-exec " + flag("remote_executor") + "=" + scheme + "\n", + "build:remote-exec " + flag("remote_executor") + "=\n", + "build:remote-exec " + flag("tls_client_certificate") + "=\n", + " run: echo \"build " + flag("remote_executor") + "=${{ secrets.BAZEL_REMOTE_EXECUTOR }}\" >> \"$RUNNER_TEMP/ci.bazelrc\"\n", + " " + flag("tls_client_key") + " \"$RUNNER_TEMP/rbe.key\"\n", + " " + flag("remote_executor") + "=" + scheme + "${{ secrets.RBE_HOST }}\n", + flag("remote_cache") + "=" + "grpc" + "://127.0.0.1:50052\n", + flag("remote_cache") + "=localhost:9092\n", + flag("remote_cache") + "=\n", + "build " + flag("remote_timeout") + "=600\n", + "use grpc for transport\n", + } { + if hits := findRemoteEndpoints(".bazelrc", []byte(ok), true); len(hits) != 0 { + t.Errorf("allowed fixture flagged: %q -> %v", ok, hits) + } + } + // Markdown: OTel gRPC exporter URLs and prose mentioning the flag are fine; + // a literal flag value is not. + for _, ok := range []string{ + "Set OTEL_EXPORTER_OTLP_ENDPOINT=" + "grpc" + "://collector:4317\n", + "Pass " + flag("remote_executor") + " and TLS flags from user.bazelrc.\n", + } { + if hits := findRemoteEndpoints("docs/x.md", []byte(ok), false); len(hits) != 0 { + t.Errorf("allowed Markdown fixture flagged: %q -> %v", ok, hits) + } + } + if len(findRemoteEndpoints("docs/x.md", []byte("bazel build "+flag("remote_executor")+"=rbe.example.com:443 //...\n"), false)) == 0 { + t.Error("literal remote_executor in Markdown not detected") + } + for rel, want := range map[string][2]bool{ + ".bazelrc": {true, true}, + "tools/ci.bazelrc": {true, true}, + ".bazelrc.local": {true, true}, + ".github/workflows/x.yml": {true, true}, + "docs/BAZEL.md": {true, false}, + "issues.jsonl": {false, false}, + "internal/telemetry/x.go": {false, false}, + } { + if scan, strict := remoteScanKind(rel); scan != want[0] || strict != want[1] { + t.Errorf("remoteScanKind(%q) = %v,%v, want %v,%v", rel, scan, strict, want[0], want[1]) + } + } + + root := bazelPolicyRoot(t) + if !gitRepoAvailable(root) { + t.Skip("not a git checkout (e.g. Bazel sandbox); tracked-file scan runs under go test and CI") + } + out, err := exec.Command("git", "-C", root, "ls-files", "-z", "--", "*bazelrc*", "*.md", ".github").Output() + if err != nil { + t.Fatalf("git ls-files: %v", err) + } + var hits []endpointHit + for _, rel := range strings.Split(strings.TrimRight(string(out), "\x00"), "\x00") { + scan, strict := remoteScanKind(rel) + if !scan { + continue + } + info, err := os.Lstat(filepath.Join(root, rel)) + if err != nil || !info.Mode().IsRegular() { + continue // deleted in the worktree, submodule, or symlink + } + content, err := os.ReadFile(filepath.Join(root, rel)) + if err != nil { + t.Fatalf("read %s: %v", rel, err) + } + hits = append(hits, findRemoteEndpoints(rel, content, strict)...) + } + for _, h := range hits { + t.Errorf("%s:%d: remote endpoint or credential %q in a tracked file; it belongs in a gitignored user.bazelrc/.bazelrc.local or a CI-generated rc outside the workspace", h.path, h.line, h.what) + } +} diff --git a/scripts/bench-ready-indexes/BUILD.bazel b/scripts/bench-ready-indexes/BUILD.bazel new file mode 100644 index 000000000..9d64f87d8 --- /dev/null +++ b/scripts/bench-ready-indexes/BUILD.bazel @@ -0,0 +1,22 @@ +load("@rules_go//go:def.bzl", "go_binary", "go_library", "go_test") + +go_library( + name = "bench-ready-indexes_lib", + srcs = ["main.go"], + importpath = "github.com/steveyegge/beads/scripts/bench-ready-indexes", + visibility = ["//visibility:private"], + deps = ["@com_github_go_sql_driver_mysql//:mysql"], +) + +go_binary( + name = "bench-ready-indexes", + embed = [":bench-ready-indexes_lib"], + visibility = ["//visibility:public"], +) + +go_test( + name = "bench-ready-indexes_test", + srcs = ["main_test.go"], + embed = [":bench-ready-indexes_lib"], + deps = ["@com_github_data_dog_go_sqlmock//:go-sqlmock"], +) diff --git a/scripts/check-build-tags.sh b/scripts/check-build-tags.sh index c24ae18ce..895d458f9 100755 --- a/scripts/check-build-tags.sh +++ b/scripts/check-build-tags.sh @@ -7,6 +7,11 @@ # (b) appears in a file that sources .buildflags beforehand, nor # (c) is an exempt third-party tool install (go install X@version). # +# Bazel invocations (`bazel build|test|run|...`) are not `go` invocations: +# their Go build tags come from the committed .bazelrc, not GOFLAGS. When any +# scanned file invokes Bazel, the script instead requires .bazelrc to set +# `--@rules_go//go/config:tags=...gms_pure_go` for build (and so test/run). +# # This is the source-time companion to scripts/verify-cgo.sh (which is a # runtime check on release binaries). See engdocs/ICU-POLICY.md. @@ -31,6 +36,8 @@ mapfile -t candidates < <( opt_out_regex='^(scripts/test-cgo\.sh|scripts/test-icu-path\.sh|scripts/check-build-tags\.sh|examples/)' fail=0 +bazel_users=() +bazel_invocation_regex='(^|[^[:alnum:]_/.-])(bazel|bazelisk|\$\(BAZEL\)|\$\{?BAZEL\}?)[[:space:]]+(build|test|run|coverage|query|cquery|aquery|mod)($|[[:space:]])' for f in "${candidates[@]}"; do [[ -f "$f" ]] || continue [[ "$f" =~ $opt_out_regex ]] && continue @@ -40,6 +47,11 @@ for f in "${candidates[@]}"; do continue fi + # Record files that drive Bazel; .bazelrc must then carry the tag. + if grep -Eq "$bazel_invocation_regex" "$f" 2>/dev/null; then + bazel_users+=("$f") + fi + # Does the file source .buildflags before any `go` invocation? # If so, GOFLAGS covers all bare `go` commands in the file. sources_buildflags=no @@ -78,6 +90,34 @@ for f in "${candidates[@]}"; do continue fi + # Bazel invocations are governed by .bazelrc (checked below), even + # when their arguments mention a go verb (e.g. `bazel run @rules_go//go -- test`). + # Only the Bazel command itself is exempt: split the line into shell + # command segments (on &&, ||, ;, |, $( and backticks) and drop the + # segments that invoke Bazel, so `bazel build x && go test ./...` + # still has its `go test` checked. Make variable references like + # $(BAZEL) are rewritten to ${BAZEL} first so they are not split. + # Lines without a Bazel invocation are checked unchanged. + # Pure bash (no sed): BSD sed does not expand \n in replacements. + segmented="$stripped" + while [[ "$segmented" =~ \$\(([A-Za-z_][A-Za-z0-9_]*)\) ]]; do + segmented="${segmented/"${BASH_REMATCH[0]}"/\$\{${BASH_REMATCH[1]}\}}" + done + nl=$'\n' + segmented="${segmented//&&/$nl}" + segmented="${segmented//||/$nl}" + segmented="${segmented//;/$nl}" + segmented="${segmented//|/$nl}" + segmented="${segmented//\$\(/$nl}" + segmented="${segmented//\`/$nl}" + if [[ "$segmented" =~ $bazel_invocation_regex ]]; then + stripped="" + while IFS= read -r segment; do + [[ "$segment" =~ $bazel_invocation_regex ]] && continue + stripped+="$segment"$'\n' + done <<< "$segmented" + fi + verb="" if [[ "$stripped" =~ (^|[^[:alnum:]_/.-])go[[:space:]]+(build|test|run|generate|install)($|[[:space:]]) ]]; then verb="${BASH_REMATCH[2]}" @@ -125,6 +165,22 @@ for f in "${candidates[@]}"; do done < <(grep -n -E '\bgo[[:space:]]+(build|test|run|generate|install)\b' "$f" 2>/dev/null || true) done +# Bazel: every `bazel` invocation reads the committed .bazelrc, so the tag +# must be set there once. Accept `build` or `common` (test/run inherit build). +bazelrc_tag_regex='^[[:space:]]*(build|common)[[:space:]]+(.*[[:space:]])?--@(@)?rules_go//go/config:tags=([^[:space:]]*,)?gms_pure_go(,[^[:space:]]*)?([[:space:]]|$)' +if [[ ${#bazel_users[@]} -gt 0 || -f .bazelrc ]]; then + if [[ ! -f .bazelrc ]]; then + printf 'error: %s invoke(s) Bazel but .bazelrc is missing\n' "${bazel_users[*]}" >&2 + fail=1 + elif ! grep -Eq "$bazelrc_tag_regex" .bazelrc; then + printf 'error: .bazelrc does not set --@rules_go//go/config:tags=gms_pure_go for build\n' >&2 + if [[ ${#bazel_users[@]} -gt 0 ]]; then + printf ' Bazel is invoked from: %s\n' "${bazel_users[*]}" >&2 + fi + fail=1 + fi +fi + if [[ "$fail" -ne 0 ]]; then cat >&2 <<'EOF' @@ -138,6 +194,9 @@ Fix by EITHER: 2. Pass -tags=gms_pure_go (or -tags=other,gms_pure_go) explicitly. 3. Add a '# build-tags: allow-bare' marker in the top 5 lines of the file if it intentionally exercises the ICU path. + +Bazel invocations take their tags from .bazelrc, which must contain: + build --@rules_go//go/config:tags=gms_pure_go EOF exit 1 fi diff --git a/scripts/check_build_tags_test.go b/scripts/check_build_tags_test.go new file mode 100644 index 000000000..1ececfc31 --- /dev/null +++ b/scripts/check_build_tags_test.go @@ -0,0 +1,105 @@ +package scripts_test + +import ( + "os" + "os/exec" + "path/filepath" + "runtime" + "strings" + "testing" +) + +// runCheckBuildTags runs check-build-tags.sh in a throwaway git repository +// holding the given tracked files plus a .bazelrc that sets gms_pure_go. The +// script resolves the repository from its own location, so it is copied in. +func runCheckBuildTags(t *testing.T, files map[string]string) (string, error) { + t.Helper() + if runtime.GOOS == "windows" { + t.Skip("checker is a Bash boundary") + } + if _, err := exec.LookPath("git"); err != nil { + t.Skip("git not available") + } + // The checker needs bash >= 4 (mapfile); macOS ships bash 3.2 as /bin/bash. + if err := exec.Command("bash", "-c", "type mapfile").Run(); err != nil { + t.Skip("bash lacks mapfile (bash >= 4 required)") + } + script, err := os.ReadFile(filepath.Join(sourceRepoRoot(t), "scripts", "check-build-tags.sh")) + if err != nil { + t.Fatalf("read check-build-tags.sh: %v", err) + } + dir := t.TempDir() + all := map[string]string{ + "scripts/check-build-tags.sh": string(script), + ".bazelrc": "build --@rules_go//go/config:tags=gms_pure_go\n", + } + for rel, content := range files { + all[rel] = content + } + for rel, content := range all { + full := filepath.Join(dir, rel) + if err := os.MkdirAll(filepath.Dir(full), 0o700); err != nil { + t.Fatalf("mkdir %s: %v", filepath.Dir(full), err) + } + if err := os.WriteFile(full, []byte(content), 0o600); err != nil { + t.Fatalf("write %s: %v", rel, err) + } + } + for _, args := range [][]string{{"init", "-q"}, {"add", "-A"}} { + cmd := exec.Command("git", args...) + cmd.Dir = dir + cmd.Env = append(os.Environ(), "GIT_CONFIG_GLOBAL=/dev/null", "GIT_CONFIG_NOSYSTEM=1") + if out, err := cmd.CombinedOutput(); err != nil { + t.Fatalf("git %v: %v\n%s", args, err, out) + } + } + cmd := exec.Command("bash", filepath.Join(dir, "scripts", "check-build-tags.sh")) + cmd.Dir = dir + out, err := cmd.CombinedOutput() + return string(out), err +} + +// A Bazel invocation on the same line must not exempt a bare `go` command in +// another shell command segment of that line. +func TestCheckBuildTagsBazelLineDoesNotExemptBareGo(t *testing.T) { + for name, line := range map[string]string{ + "and-list": "bazel build //cmd/bd && go test ./internal/...", + "sequence": "bazel query //... >/dev/null; go build ./cmd/bd", + "substitution": "go run ./cmd/bd -- $(bazel run //:gazelle)", + "pipe": "bazel query //... | go run ./cmd/bd", + "make var": "\t$(BAZEL) build //... || go install ./cmd/bd", + } { + t.Run(name, func(t *testing.T) { + out, err := runCheckBuildTags(t, map[string]string{"scripts/ci.sh": "#!/usr/bin/env bash\n" + line + "\n"}) + if err == nil { + t.Fatalf("bare go next to a Bazel invocation was accepted: %q\n%s", line, out) + } + if !strings.Contains(out, "scripts/ci.sh:2") { + t.Errorf("expected scripts/ci.sh:2 to be reported, got:\n%s", out) + } + }) + } +} + +func TestCheckBuildTagsExemptsBazelInvocations(t *testing.T) { + out, err := runCheckBuildTags(t, map[string]string{ + "scripts/ci.sh": "#!/usr/bin/env bash\n" + + "bazel run @rules_go//go -- test ./...\n" + + "bazel test //... && go test -tags=gms_pure_go ./...\n" + + "bazel build //cmd/bd | tee build.log\n", + "Makefile": "BAZEL ?= bazel\nsync:\n\t$(BAZEL) run //:gazelle\n\t$(BAZEL) mod tidy\n", + }) + if err != nil { + t.Fatalf("Bazel invocations should be exempt: %v\n%s", err, out) + } +} + +func TestCheckBuildTagsRequiresBazelrcTagForBazelUsers(t *testing.T) { + out, err := runCheckBuildTags(t, map[string]string{ + "scripts/ci.sh": "#!/usr/bin/env bash\nbazel build //...\n", + ".bazelrc": "build --incompatible_strict_action_env\n", + }) + if err == nil { + t.Fatalf(".bazelrc without gms_pure_go was accepted:\n%s", out) + } +} diff --git a/scripts/gitattributespolicy/BUILD.bazel b/scripts/gitattributespolicy/BUILD.bazel new file mode 100644 index 000000000..f274ac03d --- /dev/null +++ b/scripts/gitattributespolicy/BUILD.bazel @@ -0,0 +1,10 @@ +load("@rules_go//go:def.bzl", "go_test") + +go_test( + name = "gitattributespolicy_test", + srcs = [ + "git_boundary_test.go", + "gitattributes_policy_test.go", + "required_host_test.go", + ], +) diff --git a/scripts/migration-test/catalog/BUILD.bazel b/scripts/migration-test/catalog/BUILD.bazel new file mode 100644 index 000000000..3aed211c2 --- /dev/null +++ b/scripts/migration-test/catalog/BUILD.bazel @@ -0,0 +1,20 @@ +load("@rules_go//go:def.bzl", "go_binary", "go_library", "go_test") + +go_library( + name = "catalog_lib", + srcs = ["main.go"], + importpath = "github.com/steveyegge/beads/scripts/migration-test/catalog", + visibility = ["//visibility:private"], +) + +go_binary( + name = "catalog", + embed = [":catalog_lib"], + visibility = ["//visibility:public"], +) + +go_test( + name = "catalog_test", + srcs = ["main_test.go"], + embed = [":catalog_lib"], +) diff --git a/scripts/prlintmake/BUILD.bazel b/scripts/prlintmake/BUILD.bazel new file mode 100644 index 000000000..813c6d873 --- /dev/null +++ b/scripts/prlintmake/BUILD.bazel @@ -0,0 +1,6 @@ +load("@rules_go//go:def.bzl", "go_test") + +go_test( + name = "prlintmake_test", + srcs = ["prlintmake_test.go"], +) diff --git a/scripts/repro-dolt-hang/BUILD.bazel b/scripts/repro-dolt-hang/BUILD.bazel new file mode 100644 index 000000000..87208ed30 --- /dev/null +++ b/scripts/repro-dolt-hang/BUILD.bazel @@ -0,0 +1,18 @@ +load("@rules_go//go:def.bzl", "go_binary", "go_library") + +go_library( + name = "repro-dolt-hang_lib", + srcs = ["main.go"], + importpath = "github.com/steveyegge/beads/scripts/repro-dolt-hang", + visibility = ["//visibility:private"], + deps = [ + "//internal/storage/doltutil", + "@com_github_go_sql_driver_mysql//:mysql", + ], +) + +go_binary( + name = "repro-dolt-hang", + embed = [":repro-dolt-hang_lib"], + visibility = ["//visibility:public"], +) diff --git a/scripts/repro-dolt-prod-timeouts/BUILD.bazel b/scripts/repro-dolt-prod-timeouts/BUILD.bazel new file mode 100644 index 000000000..b38d6644a --- /dev/null +++ b/scripts/repro-dolt-prod-timeouts/BUILD.bazel @@ -0,0 +1,32 @@ +load("@rules_go//go:def.bzl", "go_binary", "go_library", "go_test") + +go_library( + name = "repro-dolt-prod-timeouts_lib", + srcs = ["main.go"], + importpath = "github.com/steveyegge/beads/scripts/repro-dolt-prod-timeouts", + visibility = ["//visibility:private"], + deps = [ + "//internal/storage/depid", + "//internal/storage/doltutil", + "@com_github_go_sql_driver_mysql//:mysql", + ], +) + +go_binary( + name = "repro-dolt-prod-timeouts", + embed = [":repro-dolt-prod-timeouts_lib"], + visibility = ["//visibility:public"], +) + +go_test( + name = "repro-dolt-prod-timeouts_test", + srcs = ["main_test.go"], + embed = [":repro-dolt-prod-timeouts_lib"], + deps = [ + "//internal/storage/depid", + "//internal/storage/doltutil", + "//internal/storage/schema", + "//internal/testutil", + "@com_github_data_dog_go_sqlmock//:go-sqlmock", + ], +) diff --git a/test/conformance/BUILD.bazel b/test/conformance/BUILD.bazel new file mode 100644 index 000000000..115d75c1d --- /dev/null +++ b/test/conformance/BUILD.bazel @@ -0,0 +1,8 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "conformance", + srcs = ["profiles.go"], + importpath = "github.com/steveyegge/beads/test/conformance", + visibility = ["//visibility:public"], +) diff --git a/test/docsync/BUILD.bazel b/test/docsync/BUILD.bazel new file mode 100644 index 000000000..64b26a9c8 --- /dev/null +++ b/test/docsync/BUILD.bazel @@ -0,0 +1,9 @@ +load("@rules_go//go:def.bzl", "go_test") + +go_test( + name = "docsync_test", + srcs = [ + "docsync_test.go", + "doltpin_test.go", + ], +) diff --git a/test/testmainconvention/BUILD.bazel b/test/testmainconvention/BUILD.bazel new file mode 100644 index 000000000..68121c2c6 --- /dev/null +++ b/test/testmainconvention/BUILD.bazel @@ -0,0 +1,6 @@ +load("@rules_go//go:def.bzl", "go_test") + +go_test( + name = "testmainconvention_test", + srcs = ["testmain_convention_test.go"], +) diff --git a/third_party/patches/BUILD.bazel b/third_party/patches/BUILD.bazel new file mode 100644 index 000000000..31c29bfc2 --- /dev/null +++ b/third_party/patches/BUILD.bazel @@ -0,0 +1,12 @@ +# Patches applied to third-party Go modules via go_deps.module_override in +# MODULE.bazel. They replace WORKSPACE-era BUILD files shipped by some dolt +# dependencies that do not resolve under bzlmod + gazelle. +# +# eventsapi_schema_build.patch, flatbuffers_v23_importpath.patch and +# dolt_go_serial.patch are adapted from the gascity project +# (github.com/gastownhall/gascity, third_party/patches). Keep them in sync +# when bumping the pinned dolt versions in go.mod. + +package(default_visibility = ["//visibility:public"]) + +exports_files(glob(["*.patch"])) diff --git a/third_party/patches/dolt_go_serial.patch b/third_party/patches/dolt_go_serial.patch new file mode 100644 index 000000000..1cc03be5c --- /dev/null +++ b/third_party/patches/dolt_go_serial.patch @@ -0,0 +1,42 @@ +diff -ruN a/serial/BUILD.bazel b/serial/BUILD.bazel +--- a/serial/BUILD.bazel 2026-09-21 23:59:07.249245731 +0000 ++++ b/serial/BUILD.bazel 2026-09-21 23:59:07.250190084 +0000 +@@ -1,35 +1,10 @@ + load("@io_bazel_rules_go//go:def.bzl", "go_library") +-load("@rules_pkg//:pkg.bzl", "pkg_tar") + + package(default_visibility = ["//visibility:public"]) + +-alias( +- name = "flatc", +- actual = "@com_github_dolthub_flatbuffers//:flatc", +-) +- +-genrule( +- name = "go_srcs", +- srcs = glob(["*.fbs"]), +- outs = [n[:-4] + ".go" for n in glob(["*.fbs"])], +- cmd = "$(location //:generate.sh) $(location //:flatc) $(RULEDIR) $(location :copyright.txt) $(SRCS)", +- tools = [ +- ":copyright.txt", +- ":flatc", +- ":generate.sh", +- ], +-) +- +-pkg_tar( +- name = "go_srcs.tar", +- srcs = [ +- "fileidentifiers.go", +- ":go_srcs", +- ], +- mode = "0644", +- package_dir = "gen/fb/serial", +-) +- ++# Patched for Bazel (Bzlmod): dropped the pkg_tar/go_srcs/flatc codegen ++# targets. They load @rules_pkg, which is not visible from go_deps extension ++# repos under Bzlmod, and are only used to regenerate flatbuffers sources. + go_library( + name = "serial", + srcs = [ diff --git a/third_party/patches/eventsapi_schema_build.patch b/third_party/patches/eventsapi_schema_build.patch new file mode 100644 index 000000000..8f83a524f --- /dev/null +++ b/third_party/patches/eventsapi_schema_build.patch @@ -0,0 +1,120 @@ +diff -ruN a/BUILD.bazel b/BUILD.bazel +--- a/BUILD.bazel 2026-09-21 23:58:53.884394811 +0000 ++++ b/BUILD.bazel 2026-09-21 23:58:53.894171166 +0000 +@@ -1,50 +1 @@ +-load("@npm//:defs.bzl", "npm_link_all_packages") +-load("@npm//:ts-protoc-gen/package_json.bzl", "bin") +-load("@rules_pkg//:pkg.bzl", "pkg_tar") +-load("@rules_shell//shell:sh_binary.bzl", "sh_binary") +-load(":defs.bzl", "is_windows") +- +-is_windows(name = "is_windows") +- +-npm_link_all_packages( +- name = "node_modules", +-) +- +-bin.protoc_gen_ts_binary( +- name = "protoc-gen-ts", +-) +- +-filegroup( +- name = "go_srcs_files", +- srcs = [ +- "//dolt/services/eventsapi/v1alpha1:eventsapi_go_proto", +- ], +- output_group = "go_generated_srcs", +-) +- +-pkg_tar( +- name = "srcs", +- srcs = [ +- ":go_srcs_files", +- "//dolt/services/eventsapi/v1alpha1:eventsapi_ts_proto", +- ], +- mode = "0644", +- remap_paths = { +- "dolt/services/eventsapi/v1alpha1/eventsapi_go_proto_/github.com/dolthub/eventsapi_schema": "/", +- }, +- strip_prefix = "./", +-) +- +-sh_binary( +- name = "update", +- srcs = ["update.sh"], +- args = [ +- "$(rlocationpath :srcs)", +- ], +- data = [ +- ":srcs", +- ], +- deps = [ +- "@bazel_tools//tools/bash/runfiles", +- ], +-) ++package(default_visibility = ["//visibility:public"]) +diff -ruN a/dolt/services/eventsapi/v1alpha1/BUILD.bazel b/dolt/services/eventsapi/v1alpha1/BUILD.bazel +--- a/dolt/services/eventsapi/v1alpha1/BUILD.bazel 2026-09-21 23:58:53.889887856 +0000 ++++ b/dolt/services/eventsapi/v1alpha1/BUILD.bazel 2026-09-22 00:00:59.862349475 +0000 +@@ -1,26 +1,32 @@ +-load("@rules_go//proto:def.bzl", "go_proto_library") +-load("@protobuf//bazel:proto_library.bzl", "proto_library") +-load("//:defs.bzl", "typescript_proto_library") ++load("@io_bazel_rules_go//go:def.bzl", "go_library") + + package(default_visibility = ["//visibility:public"]) + +-proto_library( +- name = "eventsapi_proto", +- srcs = glob(["*.proto"]), +- deps = [ +- "@protobuf//:duration_proto", +- "@protobuf//:timestamp_proto", +- ], +-) +- +-go_proto_library( ++# Patched for Bazel (Bzlmod): the shipped proto/BUILD files reference ++# WORKSPACE-era apparent names (@rules_go, @protobuf, @npm) that are not ++# visible from go_deps extension repos under Bzlmod. The repo ships ++# pre-generated *.pb.go files, so a plain go_library replaces the ++# proto toolchain entirely. ++go_library( + name = "eventsapi_go_proto", +- compilers = ["@rules_go//proto:go_grpc"], ++ srcs = [ ++ "client_event.pb.go", ++ "event_constants.pb.go", ++ ], + importpath = "github.com/dolthub/eventsapi_schema/dolt/services/eventsapi/v1alpha1", +- proto = ":eventsapi_proto", ++ visibility = ["//visibility:public"], ++ deps = [ ++ "@org_golang_google_grpc//:grpc", ++ "@org_golang_google_grpc//codes:codes", ++ "@org_golang_google_grpc//status:status", ++ "@org_golang_google_protobuf//reflect/protoreflect:protoreflect", ++ "@org_golang_google_protobuf//runtime/protoimpl:protoimpl", ++ "@org_golang_google_protobuf//types/known/durationpb:durationpb", ++ "@org_golang_google_protobuf//types/known/timestamppb:timestamppb", ++ ], + ) + +-typescript_proto_library( +- name = "eventsapi_ts_proto", +- proto = ":eventsapi_proto", ++alias( ++ name = "v1alpha1", ++ actual = ":eventsapi_go_proto", + ) +diff -ruN a/tools/BUILD.bazel b/tools/BUILD.bazel +--- a/tools/BUILD.bazel 2026-09-21 23:58:53.892261249 +0000 ++++ b/tools/BUILD.bazel 2026-09-21 23:58:53.898171172 +0000 +@@ -1,6 +1 @@ +-load("@bazelrc-preset.bzl", "bazelrc_preset") +- +-bazelrc_preset( +- name = "preset", +- strict = True, +-) ++package(default_visibility = ["//visibility:public"]) diff --git a/third_party/patches/flatbuffers_v23_importpath.patch b/third_party/patches/flatbuffers_v23_importpath.patch new file mode 100644 index 000000000..3a5d2018e --- /dev/null +++ b/third_party/patches/flatbuffers_v23_importpath.patch @@ -0,0 +1,11 @@ +diff -ruN a/go/BUILD.bazel b/go/BUILD.bazel +--- a/go/BUILD.bazel 2026-09-22 00:06:47.043685364 +0000 ++++ b/go/BUILD.bazel 2026-09-22 00:06:47.045883735 +0000 +@@ -18,6 +18,6 @@ + "struct.go", + "table.go", + ], +- importpath = "github.com/google/flatbuffers/go", ++ importpath = "github.com/dolthub/flatbuffers/v23/go", + visibility = ["//visibility:public"], + ) diff --git a/tools/docsmint/BUILD.bazel b/tools/docsmint/BUILD.bazel new file mode 100644 index 000000000..23dd7578d --- /dev/null +++ b/tools/docsmint/BUILD.bazel @@ -0,0 +1,27 @@ +load("@rules_go//go:def.bzl", "go_binary", "go_library", "go_test") + +go_library( + name = "docsmint_lib", + srcs = [ + "docsmint.go", + "legacy.go", + "main.go", + ], + importpath = "github.com/steveyegge/beads/tools/docsmint", + visibility = ["//visibility:private"], +) + +go_binary( + name = "docsmint", + embed = [":docsmint_lib"], + visibility = ["//visibility:public"], +) + +go_test( + name = "docsmint_test", + srcs = [ + "docsmint_test.go", + "legacy_test.go", + ], + embed = [":docsmint_lib"], +)