Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,8 @@ release
.env
.envrc
src-snapshot/
bazel-bin
bazel-out
bazel-testlogs
bazel-zoekt
bazel-src-cli
16 changes: 16 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# gazelle:prefix github.com/sourcegraph/src-cli
# gazelle:build_file_name BUILD.bazel
load("@bazel_gazelle//:def.bzl", "gazelle")

gazelle(name = "gazelle")

gazelle(
name = "gazelle-update-repos",
args = [
"-from_file=go.mod",
"-to_macro=deps.bzl%go_dependencies",
"-prune",
"-build_file_proto_mode=disable_global",
],
command = "update-repos",
)
62 changes: 62 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "bazel_skylib",
sha256 = "74d544d96f4a5bb630d465ca8bbcfe231e3594e5aae57e1edbf17a6eb3ca2506",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz",
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz",
],
)

load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")

bazel_skylib_workspace()

http_archive(
name = "aspect_bazel_lib",
sha256 = "2518c757715d4f5fc7cc7e0a68742dd1155eaafc78fb9196b8a18e13a738cea2",
strip_prefix = "bazel-lib-1.28.0",
url = "https://github.com/aspect-build/bazel-lib/releases/download/v1.28.0/bazel-lib-v1.28.0.tar.gz",
)

http_archive(
name = "io_bazel_rules_go",
sha256 = "dd926a88a564a9246713a9c00b35315f54cbd46b31a26d5d8fb264c07045f05d",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.38.1/rules_go-v0.38.1.zip",
"https://github.com/bazelbuild/rules_go/releases/download/v0.38.1/rules_go-v0.38.1.zip",
],
)

http_archive(
name = "bazel_gazelle",
sha256 = "ecba0f04f96b4960a5b250c8e8eeec42281035970aa8852dda73098274d14a1d",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.29.0/bazel-gazelle-v0.29.0.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.29.0/bazel-gazelle-v0.29.0.tar.gz",
],
)

# Go toolchain setup
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies","go_repository")
load("//:deps.bzl", "go_dependencies")

# gazelle:repository_macro deps.bzl%go_dependencies
go_dependencies()

go_rules_dependencies()

go_register_toolchains(
version = "1.19.6",
)

gazelle_dependencies()

go_repository(
name = "com_github_aws_aws_sdk_go_v2_service_eks",
importpath = "github.com/aws/aws-sdk-go-v2/service/eks",
version = "v1.27.3",
sum = "h1:jlh0AJVhauqSGaiwRJx4j0LNBGEAaGn46sA1XJyTj0E=",
)
186 changes: 186 additions & 0 deletions cmd/src/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")

go_library(
name = "src_lib",
srcs = [
"admin.go",
"admin_create.go",
"api.go",
"batch.go",
"batch_apply.go",
"batch_common.go",
"batch_exec.go",
"batch_new.go",
"batch_preview.go",
"batch_remote.go",
"batch_repositories.go",
"batch_validate.go",
"cmd.go",
"code_intel.go",
"code_intel_upload.go",
"code_intel_upload_flags.go",
"codeowners.go",
"codeowners_create.go",
"codeowners_delete.go",
"codeowners_get.go",
"codeowners_update.go",
"colors.go",
"config.go",
"config_edit.go",
"config_get.go",
"config_list.go",
"debug.go",
"debug_common.go",
"debug_compose.go",
"debug_kube.go",
"debug_server.go",
"doc.go",
"extensions.go",
"extensions_copy.go",
"extensions_delete.go",
"extensions_get.go",
"extensions_list.go",
"extensions_publish.go",
"extsvc.go",
"extsvc_create.go",
"extsvc_edit.go",
"extsvc_list.go",
"format.go",
"headers.go",
"login.go",
"lsif.go",
"main.go",
"orgs.go",
"orgs_create.go",
"orgs_delete.go",
"orgs_get.go",
"orgs_list.go",
"orgs_members.go",
"orgs_members_add.go",
"orgs_members_remove.go",
"repos.go",
"repos_add_metadata.go",
"repos_delete.go",
"repos_delete_metadata.go",
"repos_get.go",
"repos_list.go",
"repos_update_metadata.go",
"search.go",
"search_alert.go",
"search_stream.go",
"servegit.go",
"snapshot.go",
"snapshot_databases.go",
"snapshot_restore.go",
"snapshot_summary.go",
"snapshot_testcmd.go",
"snapshot_upload.go",
"team_members_list.go",
"teams.go",
"teams_create.go",
"teams_delete.go",
"teams_list.go",
"teams_members.go",
"teams_members_add.go",
"teams_members_remove.go",
"teams_update.go",
"users.go",
"users_create.go",
"users_delete.go",
"users_get.go",
"users_list.go",
"users_prune.go",
"users_tag.go",
"validate.go",
"validate_install.go",
"validate_kube.go",
"version.go",
],
importpath = "github.com/sourcegraph/src-cli/cmd/src",
visibility = ["//visibility:private"],
deps = [
"//internal/api",
"//internal/batches",
"//internal/batches/docker",
"//internal/batches/executor",
"//internal/batches/graphql",
"//internal/batches/log",
"//internal/batches/repozip",
"//internal/batches/service",
"//internal/batches/ui",
"//internal/batches/watchdog",
"//internal/batches/workspace",
"//internal/cmderrors",
"//internal/codeintel",
"//internal/exec",
"//internal/instancehealth",
"//internal/pgdump",
"//internal/servegit",
"//internal/streaming",
"//internal/users",
"//internal/validate/install",
"//internal/validate/kube",
"//internal/version",
"@com_github_dustin_go_humanize//:go-humanize",
"@com_github_google_go_cmp//cmp",
"@com_github_grafana_regexp//:regexp",
"@com_github_jedib0t_go_pretty_v6//table",
"@com_github_mattn_go_isatty//:go-isatty",
"@com_github_pkg_browser//:browser",
"@com_github_sourcegraph_conc//pool",
"@com_github_sourcegraph_jsonx//:jsonx",
"@com_github_sourcegraph_scip//bindings/go/scip",
"@com_github_sourcegraph_sourcegraph_lib//batches",
"@com_github_sourcegraph_sourcegraph_lib//batches/template",
"@com_github_sourcegraph_sourcegraph_lib//codeintel/lsif/scip",
"@com_github_sourcegraph_sourcegraph_lib//codeintel/upload",
"@com_github_sourcegraph_sourcegraph_lib//errors",
"@com_github_sourcegraph_sourcegraph_lib//output",
"@com_google_cloud_go_storage//:storage",
"@com_jaytaylor_html2text//:html2text",
"@in_gopkg_yaml_v3//:yaml_v3",
"@io_k8s_client_go//kubernetes",
"@io_k8s_client_go//plugin/pkg/client/auth/azure",
"@io_k8s_client_go//plugin/pkg/client/auth/gcp",
"@io_k8s_client_go//tools/clientcmd",
"@io_k8s_client_go//util/homedir",
"@org_golang_google_api//option",
"@org_golang_google_protobuf//proto",
"@org_golang_x_net//context",
"@org_golang_x_sync//errgroup",
"@org_golang_x_sync//semaphore",
],
)

go_binary(
name = "src",
embed = [":src_lib"],
visibility = ["//visibility:public"],
)

go_test(
name = "src_test",
srcs = [
"code_intel_upload_flags_test.go",
"extensions_publish_test.go",
"headers_test.go",
"login_test.go",
"main_test.go",
"search_alert_test.go",
"search_stream_test.go",
"search_test.go",
],
data = glob(["testdata/**"]),
embed = [":src_lib"],
deps = [
"//internal/api",
"//internal/cmderrors",
"//internal/streaming",
"@com_github_google_go_cmp//cmp",
"@com_github_grafana_regexp//:regexp",
"@com_github_hexops_autogold//:autogold",
"@com_github_sourcegraph_scip//bindings/go/scip",
"@com_github_stretchr_testify//require",
"@org_golang_google_protobuf//proto",
],
)
Loading