sourcegraph/internal/object/BUILD.bazel
Varun Gandhi 9145768648
chore: Rename uploadstore packages for clarity (#63931)
- The `internal/uploadstore` package is renamed to `object` indicating
   that it is meant to provide a generic object storage wrapper.
- The `search/exhaustive/uploadstore` package is used in very few places
  so I've merged into the `internal/search` package similar to
  `internal/embeddings`.

There are a few reasons to do the renaming.

1. The word `upload` in a more general context is ambiguous (just in
    `internal/`) - in the codeintel context, it means "SCIP index" but it
    can also be interpreted generically ("upload of _some_ data").
2. Better readability - `object.Storage` is much shorter than
    `uploadstore.Store`. Additionally, we use the term `Store` A LOT
    in the codebase, and usually, these refer to wrappers over some
    tables in some DB.

    Making things worse, some of our code also has:

    ```
    uploadsstore
"github.com/sourcegraph/sourcegraph/internal/codeintel/uploads/internal/store"
    ```

And code which says `uploadsstore.Store` (notice the extra `s` 😢), which
is actually a wrapper over some key DB tables like `lsif_uploads`.
2024-07-22 08:57:56 +08:00

77 lines
2.2 KiB
Python

load("//dev:go_mockgen.bzl", "go_mockgen")
load("//dev:go_defs.bzl", "go_test")
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "object",
srcs = [
"config.go",
"expirer.go",
"gcs_api.go",
"gcs_client.go",
"lazy_client.go",
"observability.go",
"pool.go",
"reader.go",
"s3_api.go",
"s3_client.go",
"store.go",
],
importpath = "github.com/sourcegraph/sourcegraph/internal/object",
visibility = ["//:__subpackages__"],
deps = [
"//internal/goroutine",
"//internal/metrics",
"//internal/observation",
"//lib/errors",
"//lib/iterator",
"@com_github_aws_aws_sdk_go_v2//aws",
"@com_github_aws_aws_sdk_go_v2_config//:config",
"@com_github_aws_aws_sdk_go_v2_credentials//:credentials",
"@com_github_aws_aws_sdk_go_v2_feature_s3_manager//:manager",
"@com_github_aws_aws_sdk_go_v2_service_s3//:s3",
"@com_github_aws_aws_sdk_go_v2_service_s3//types",
"@com_github_sourcegraph_conc//pool",
"@com_github_sourcegraph_log//:log",
"@com_google_cloud_go_storage//:storage",
"@io_opentelemetry_go_otel//attribute",
"@org_golang_google_api//iterator",
"@org_golang_google_api//option",
],
)
go_test(
name = "object_test",
srcs = [
"config_test.go",
"gcs_client_test.go",
"mocks_test.go",
"s3_client_test.go",
"store_test.go",
],
embed = [":object"],
deps = [
"//internal/observation",
"//lib/errors",
"@com_github_aws_aws_sdk_go_v2//aws",
"@com_github_aws_aws_sdk_go_v2_service_s3//:s3",
"@com_github_aws_aws_sdk_go_v2_service_s3//types",
"@com_github_google_go_cmp//cmp",
"@com_github_grafana_regexp//:regexp",
"@com_github_sourcegraph_log//logtest",
"@com_google_cloud_go_storage//:storage",
"@org_golang_google_api//iterator",
],
)
go_mockgen(
name = "generate_mocks",
out = "mocks_test.go",
manifests = [
"//:mockgen.yaml",
"//:mockgen.test.yaml",
"//:mockgen.temp.yaml",
],
deps = [":object"],
)