sourcegraph/cmd/frontend/graphqlbackend/BUILD.bazel
Noah S-C cb7034680d
bump to Go 1.22.1 (#60902)
🚀 💎 🙌 🚙 

## Test plan

CI
2024-03-06 17:38:43 -07:00

567 lines
18 KiB
Python

load("//dev:go_defs.bzl", "go_test")
load("@io_bazel_rules_go//go:def.bzl", "go_library")
load("@npm//:graphql-schema-linter/package_json.bzl", linter_bin = "bin")
load("@aspect_rules_js//js:defs.bzl", "js_library")
package(default_visibility = [
"//client/shared:__subpackages__",
"//cmd/frontend:__subpackages__",
])
js_library(
name = "graphql_schema",
srcs = glob([
"*.graphql",
]),
visibility = [
"//client/backstage-backend/node_modules/@sourcegraph/shared/dev:__pkg__",
"//client/shared/dev:__pkg__",
"//client/web-sveltekit:__pkg__",
],
)
linter_bin.graphql_schema_linter_test(
name = "graphql_schema_lint_test",
size = "small",
data = ["//:graphql_schema_config"] + glob(["*.graphql"]),
)
go_library(
name = "graphqlbackend",
srcs = [
"access_requests.go",
"access_token.go",
"access_tokens.go",
"auth_provider.go",
"auth_providers.go",
"authz.go",
"background_jobs.go",
"batches.go",
"bigint.go",
"client_configuration.go",
"code_host.go",
"code_hosts.go",
"code_monitors.go",
"codeintel.go",
"cody_context.go",
"cody_gateway_rate_limit.go",
"commit_search_result.go",
"completions.go",
"compute.go",
"content_library.go",
"default_settings.go",
"doc.go",
"dotcom.go",
"embeddings.go",
"empty_response.go",
"event_log.go",
"event_logs.go",
"execution_log_entry.go",
"executor.go",
"executor_connection.go",
"executor_secret.go",
"executor_secret_access_log.go",
"executor_secret_access_logs_connection.go",
"executor_secret_connection.go",
"executor_secrets.go",
"executors.go",
"external_account.go",
"external_account_data_resolver.go",
"external_accounts.go",
"external_service.go",
"external_service_collaborators.go",
"external_services.go",
"feature_flags.go",
"file.go",
"file_match.go",
"git_blob.go",
"git_commit.go",
"git_commits.go",
"git_object.go",
"git_ref.go",
"git_revision.go",
"git_tree.go",
"git_tree_entry.go",
"git_tree_history.go",
"git_tree_submodule.go",
"githubapps.go",
"gitserver.go",
"graphqlbackend.go",
"guardrails.go",
"highlight.go",
"hunk.go",
"insights.go",
"insights_aggregations.go",
"json.go",
"language_statistics.go",
"lfs.go",
"license.go",
"location.go",
"markdown.go",
"namespaces.go",
"node.go",
"notebooks.go",
"observability.go",
"oobmigrations.go",
"org.go",
"org_invitation.go",
"org_invitations.go",
"org_members.go",
"orgs.go",
"outbound_requests.go",
"outbound_webhook_logs.go",
"outbound_webhooks.go",
"own.go",
"package_repo_filters.go",
"package_repos.go",
"parse_search_query.go",
"perforce_changelist.go",
"permission.go",
"permission_connection_store.go",
"permissions.go",
"permissions_sync_jobs.go",
"person.go",
"phabricator.go",
"preview_repository_comparison.go",
"product_license_info.go",
"product_subscription_status.go",
"rate_limit.go",
"ratelimiter.go",
"rbac.go",
"recorded_commands.go",
"repositories.go",
"repository.go",
"repository_comparison.go",
"repository_contributor.go",
"repository_contributors.go",
"repository_cursor.go",
"repository_external.go",
"repository_git_refs.go",
"repository_metadata.go",
"repository_mirror.go",
"repository_reindex.go",
"repository_stats.go",
"repository_text_search_index.go",
"role.go",
"role_connection_store.go",
"roles.go",
"saved_searches.go",
"schema.go",
"search.go",
"search_alert.go",
"search_contexts.go",
"search_jobs.go",
"search_query_annotation.go",
"search_query_description.go",
"search_result_match.go",
"search_results.go",
"search_results_stats_languages.go",
"send_test_email.go",
"settings.go",
"settings_cascade.go",
"settings_mutation.go",
"settings_subject.go",
"signature.go",
"site.go",
"site_admin.go",
"site_alerts.go",
"site_analytics.go",
"site_config_change.go",
"site_config_change_connection.go",
"site_flags.go",
"site_monitoring.go",
"site_reload.go",
"site_update_check.go",
"site_usage_stats.go",
"site_users.go",
"slow_requests_tracer.go",
"source_type.go",
"status_messages.go",
"survey_response.go",
"survey_responses.go",
"symbols.go",
"teams.go",
"telemetry.go",
"temporary_settings.go",
"testing.go",
"types.go",
"user.go",
"user_emails.go",
"user_session.go",
"user_usage_stats.go",
"users.go",
"users_create.go",
"users_randomize_password.go",
"virtual_file.go",
"webhook_logs.go",
"webhooks.go",
],
embedsrcs = [
"authz.graphql",
"batches.graphql",
"code_monitors.graphql",
"codeintel.autoindexing.graphql",
"codeintel.codenav.graphql",
"codeintel.graphql",
"codeintel.policies.graphql",
"codeintel.ranking.graphql",
"codeintel.sentinel.graphql",
"cody_context.graphql",
"completions.graphql",
"compute.graphql",
"dotcom.graphql",
"embeddings.graphql",
"githubapps.graphql",
"guardrails.graphql",
"insights.graphql",
"insights_aggregations.graphql",
"license.graphql",
"notebooks.graphql",
"outbound_webhooks.graphql",
"own.graphql",
"rbac.graphql",
"schema.graphql",
"search_contexts.graphql",
"content_library.graphql",
"search_jobs.graphql",
"telemetry.graphql",
],
importpath = "github.com/sourcegraph/sourcegraph/cmd/frontend/graphqlbackend",
visibility = ["//:__subpackages__"],
deps = [
"//cmd/frontend/auth",
"//cmd/frontend/backend",
"//cmd/frontend/envvar",
"//cmd/frontend/external/session",
"//cmd/frontend/globals",
"//cmd/frontend/graphqlbackend/externallink",
"//cmd/frontend/graphqlbackend/graphqlutil",
"//cmd/frontend/hubspot",
"//cmd/frontend/hubspot/hubspotutil",
"//cmd/frontend/internal/processrestart",
"//cmd/frontend/internal/search/logs",
"//internal/actor",
"//internal/adminanalytics",
"//internal/api",
"//internal/auth",
"//internal/auth/providers",
"//internal/auth/userpasswd",
"//internal/authz",
"//internal/authz/permssync",
"//internal/binary",
"//internal/cloneurls",
"//internal/cloud",
"//internal/codeintel/dependencies",
"//internal/codeintel/dependencies/shared",
"//internal/codeintel/resolvers",
"//internal/cody",
"//internal/codygateway",
"//internal/conf",
"//internal/conf/conftypes",
"//internal/conf/deploy",
"//internal/conf/reposource",
"//internal/database",
"//internal/database/basestore",
"//internal/database/migration",
"//internal/database/migration/cliutil",
"//internal/database/migration/drift",
"//internal/database/migration/multiversion",
"//internal/database/migration/runner",
"//internal/database/migration/schemas",
"//internal/deviceid",
"//internal/dotcom",
"//internal/embeddings/background/repo",
"//internal/encryption",
"//internal/encryption/keyring",
"//internal/env",
"//internal/errcode",
"//internal/executor",
"//internal/extsvc",
"//internal/extsvc/gerrit/externalaccount",
"//internal/extsvc/github",
"//internal/extsvc/phabricator",
"//internal/extsvc/versions",
"//internal/featureflag",
"//internal/gitserver",
"//internal/gitserver/gitdomain",
"//internal/gitserver/protocol",
"//internal/goroutine",
"//internal/goroutine/recorder",
"//internal/gosyntect",
"//internal/gqlutil",
"//internal/highlight",
"//internal/honey",
"//internal/honey/search",
"//internal/httpcli",
"//internal/insights",
"//internal/inventory",
"//internal/jsonc",
"//internal/lazyregexp",
"//internal/licensing",
"//internal/markdown",
"//internal/observation",
"//internal/oobmigration",
"//internal/perforce",
"//internal/ratelimit",
"//internal/rbac",
"//internal/rcache",
"//internal/redispool",
"//internal/repos",
"//internal/repoupdater",
"//internal/repoupdater/protocol",
"//internal/search",
"//internal/search/client",
"//internal/search/job",
"//internal/search/job/jobutil",
"//internal/search/job/printer",
"//internal/search/query",
"//internal/search/result",
"//internal/search/streaming",
"//internal/search/symbol",
"//internal/search/zoekt",
"//internal/settings",
"//internal/siteid",
"//internal/sourcegraphoperator",
"//internal/src-prometheus",
"//internal/ssc",
"//internal/suspiciousnames",
"//internal/symbols",
"//internal/temporarysettings",
"//internal/trace",
"//internal/txemail",
"//internal/txemail/txtypes",
"//internal/types",
"//internal/updatecheck",
"//internal/usagestats",
"//internal/users",
"//internal/version",
"//internal/version/upgradestore",
"//internal/webhooks/outbound",
"//internal/wrexec",
"//lib/api",
"//lib/batches",
"//lib/codeintel/languages",
"//lib/errors",
"//lib/output",
"//lib/pointers",
"//schema",
"@com_github_gogo_protobuf//jsonpb",
"@com_github_golang_jwt_jwt_v4//:jwt",
"@com_github_gomodule_redigo//redis",
"@com_github_google_go_cmp//cmp",
"@com_github_google_go_cmp//cmp/cmpopts",
"@com_github_google_uuid//:uuid",
"@com_github_grafana_regexp//:regexp",
"@com_github_graph_gophers_graphql_go//:graphql-go",
"@com_github_graph_gophers_graphql_go//errors",
"@com_github_graph_gophers_graphql_go//introspection",
"@com_github_graph_gophers_graphql_go//relay",
"@com_github_graph_gophers_graphql_go//trace/otel",
"@com_github_graph_gophers_graphql_go//trace/tracer",
"@com_github_graphql_go_graphql//language/ast",
"@com_github_graphql_go_graphql//language/kinds",
"@com_github_graphql_go_graphql//language/parser",
"@com_github_graphql_go_graphql//language/visitor",
"@com_github_hexops_gotextdiff//:gotextdiff",
"@com_github_hexops_gotextdiff//myers",
"@com_github_inconshreveable_log15//:log15",
"@com_github_keegancsmith_sqlf//:sqlf",
"@com_github_masterminds_semver//:semver",
"@com_github_prometheus_client_golang//prometheus",
"@com_github_prometheus_client_golang//prometheus/promauto",
"@com_github_sourcegraph_conc//pool",
"@com_github_sourcegraph_go_diff//diff",
"@com_github_sourcegraph_go_langserver//pkg/lsp",
"@com_github_sourcegraph_jsonx//:jsonx",
"@com_github_sourcegraph_log//:log",
"@com_github_sourcegraph_zoekt//:zoekt",
"@com_github_sourcegraph_zoekt//query",
"@com_github_sourcegraph_zoekt//stream",
"@com_github_stretchr_testify//require",
"@com_github_throttled_throttled_v2//:throttled",
"@io_opentelemetry_go_otel//:otel",
"@io_opentelemetry_go_otel//attribute",
],
)
go_test(
name = "graphqlbackend_test",
timeout = "long",
srcs = [
"access_requests_test.go",
"access_tokens_test.go",
"client_configuration_test.go",
"code_hosts_test.go",
"enry_test.go",
"event_log_test.go",
"event_logs_test.go",
"executor_secrets_test.go",
"executor_test.go",
"external_account_data_resolver_test.go",
"external_account_test.go",
"external_accounts_test.go",
"external_service_collaborators_test.go",
"external_services_test.go",
"feature_flags_test.go",
"git_blob_test.go",
"git_commit_test.go",
"git_revision_test.go",
"git_tree_entry_test.go",
"git_tree_test.go",
"gitserver_test.go",
"graphqlbackend_test.go",
"guardrails_test.go",
"lfs_test.go",
"main_test.go",
"namespaces_test.go",
"org_invitations_test.go",
"org_members_test.go",
"org_test.go",
"orgs_test.go",
"outbound_webhook_logs_test.go",
"outbound_webhooks_test.go",
"perforce_changelist_test.go",
"permission_test.go",
"permissions_test.go",
"preview_repository_comparison_test.go",
"rate_limit_test.go",
"recorded_commands_test.go",
"repositories_test.go",
"repository_comparison_test.go",
"repository_contributors_test.go",
"repository_cursor_test.go",
"repository_metadata_test.go",
"repository_mirror_test.go",
"repository_test.go",
"repository_text_search_index_test.go",
"role_test.go",
"roles_test.go",
"saved_searches_test.go",
"search_results_stats_languages_test.go",
"search_results_test.go",
"search_test.go",
"settings_cascade_test.go",
"settings_mutation_test.go",
"site_admin_test.go",
"site_alerts_test.go",
"site_config_change_connection_test.go",
"site_config_change_test.go",
"site_test.go",
"slow_requests_tracer_test.go",
"status_messages_test.go",
"teams_test.go",
"telemetry_test.go",
"temporary_settings_test.go",
"testutil_test.go",
"user_emails_test.go",
"user_test.go",
"user_usage_stats_test.go",
"users_create_test.go",
"users_randomize_password_test.go",
"users_test.go",
"virtual_file_test.go",
"webhook_logs_test.go",
],
# graphqlbackend_test.go opens itself during its test, so we need to make it available.
data = ["graphqlbackend_test.go"],
embed = [":graphqlbackend"],
tags = [
# Test requires localhost database
"requires-network",
],
deps = [
"//cmd/frontend/backend",
"//cmd/frontend/enterprise",
"//cmd/frontend/graphqlbackend/apitest",
"//cmd/frontend/graphqlbackend/externallink",
"//cmd/frontend/graphqlbackend/graphqlutil",
"//cmd/frontend/internal/guardrails",
"//internal/actor",
"//internal/api",
"//internal/auth",
"//internal/auth/providers",
"//internal/auth/userpasswd",
"//internal/authz",
"//internal/authz/permssync",
"//internal/binary",
"//internal/codeintel",
"//internal/conf",
"//internal/database",
"//internal/database/basestore",
"//internal/database/dbmocks",
"//internal/database/dbtest",
"//internal/database/dbutil",
"//internal/database/fakedb",
"//internal/dotcom",
"//internal/encryption",
"//internal/extsvc",
"//internal/extsvc/gerrit",
"//internal/extsvc/github",
"//internal/featureflag",
"//internal/fileutil",
"//internal/gitserver",
"//internal/gitserver/gitdomain",
"//internal/gitserver/protocol",
"//internal/gqlutil",
"//internal/highlight",
"//internal/inventory",
"//internal/observation",
"//internal/oobmigration",
"//internal/ratelimit",
"//internal/rbac",
"//internal/rbac/types",
"//internal/rcache",
"//internal/repos",
"//internal/search",
"//internal/search/backend",
"//internal/search/client",
"//internal/search/job",
"//internal/search/query",
"//internal/search/repos",
"//internal/search/result",
"//internal/search/streaming",
"//internal/settings",
"//internal/src-prometheus",
"//internal/telemetry/telemetrytest",
"//internal/temporarysettings",
"//internal/timeutil",
"//internal/trace",
"//internal/txemail",
"//internal/types",
"//internal/usagestats",
"//internal/version",
"//internal/webhooks/outbound",
"//internal/wrexec",
"//lib/codeintel/languages",
"//lib/errors",
"//lib/pointers",
"//schema",
"@com_github_davecgh_go_spew//spew",
"@com_github_derision_test_go_mockgen_v2//testutil/assert",
"@com_github_derision_test_go_mockgen_v2//testutil/require",
"@com_github_go_enry_go_enry_v2//:go-enry",
"@com_github_gofrs_uuid//:uuid",
"@com_github_golang_jwt_jwt_v4//:jwt",
"@com_github_google_go_cmp//cmp",
"@com_github_google_go_cmp//cmp/cmpopts",
"@com_github_grafana_regexp//:regexp",
"@com_github_graph_gophers_graphql_go//:graphql-go",
"@com_github_graph_gophers_graphql_go//errors",
"@com_github_graph_gophers_graphql_go//relay",
"@com_github_hexops_autogold_v2//:autogold",
"@com_github_inconshreveable_log15//:log15",
"@com_github_keegancsmith_sqlf//:sqlf",
"@com_github_sourcegraph_go_diff//diff",
"@com_github_sourcegraph_log//:log",
"@com_github_sourcegraph_log//logtest",
"@com_github_sourcegraph_zoekt//:zoekt",
"@com_github_sourcegraph_zoekt//web",
"@com_github_stretchr_testify//assert",
"@com_github_stretchr_testify//require",
"@com_github_throttled_throttled_v2//store/memstore",
"@org_golang_google_protobuf//types/known/structpb",
],
)
exports_files(glob(["*.graphql"]))