diff --git a/cmd/frontend/graphqlbackend/BUILD.bazel b/cmd/frontend/graphqlbackend/BUILD.bazel index 0400f2ab584e9..a9579b3871b0c 100644 --- a/cmd/frontend/graphqlbackend/BUILD.bazel +++ b/cmd/frontend/graphqlbackend/BUILD.bazel @@ -375,7 +375,6 @@ go_library( "@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", diff --git a/cmd/frontend/graphqlbackend/repository_text_search_index.go b/cmd/frontend/graphqlbackend/repository_text_search_index.go index dded9f04ade3c..46327b5678664 100644 --- a/cmd/frontend/graphqlbackend/repository_text_search_index.go +++ b/cmd/frontend/graphqlbackend/repository_text_search_index.go @@ -10,7 +10,6 @@ import ( "github.com/grafana/regexp" "github.com/sourcegraph/zoekt" zoektquery "github.com/sourcegraph/zoekt/query" - "github.com/sourcegraph/zoekt/stream" "github.com/sourcegraph/sourcegraph/internal/gitserver" "github.com/sourcegraph/sourcegraph/internal/gqlutil" @@ -256,7 +255,7 @@ func (r *skippedIndexedResolver) Count(ctx context.Context) (BigInt, error) { // ask for ChunkMatches from Sourcegraph. ChunkMatches: true, }, - stream.SenderFunc(func(sr *zoekt.SearchResult) { + zoekt.SenderFunc(func(sr *zoekt.SearchResult) { stats.Add(sr.Stats) }), ); err != nil { diff --git a/deps.bzl b/deps.bzl index d6889d3a1fe16..fe08134b6684b 100644 --- a/deps.bzl +++ b/deps.bzl @@ -5494,8 +5494,8 @@ def go_dependencies(): patches = [ "//third_party/com_github_sourcegraph_zoekt:x_defs_version.patch", ], - sum = "h1:ZoA5u9P6wjoUFwfgi+alUVLJ60dc0XkshTjzDNoQpGg=", - version = "v0.0.0-20240418025752-74e75efaded6", + sum = "h1:aXHLpH1rhdvg4gQOiQWLkqVd3D/DG2li5Nnf6WE7mRs=", + version = "v0.0.0-20240501072156-72f95004e6d6", ) go_repository( name = "com_github_spaolacci_murmur3", diff --git a/go.mod b/go.mod index 09c88485e450a..61edaee530b1f 100644 --- a/go.mod +++ b/go.mod @@ -590,7 +590,7 @@ require ( github.com/scim2/filter-parser/v2 v2.2.0 github.com/sourcegraph/conc v0.3.1-0.20240108182409-4afefce20f9b github.com/sourcegraph/mountinfo v0.0.0-20240201124957-b314c0befab1 - github.com/sourcegraph/zoekt v0.0.0-20240418025752-74e75efaded6 + github.com/sourcegraph/zoekt v0.0.0-20240501072156-72f95004e6d6 github.com/spf13/cobra v1.8.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/stretchr/objx v0.5.2 // indirect diff --git a/go.sum b/go.sum index 91322a8181463..d0122c5b939b4 100644 --- a/go.sum +++ b/go.sum @@ -1707,8 +1707,8 @@ github.com/sourcegraph/sourcegraph-accounts-sdk-go v0.0.0-20240426173441-db5b0a1 github.com/sourcegraph/sourcegraph-accounts-sdk-go v0.0.0-20240426173441-db5b0a145ceb/go.mod h1:xul4Fiph3Pvdx/1qsmhCUL2GBeYjTcnga0LXZEbKdGo= github.com/sourcegraph/yaml v1.0.1-0.20200714132230-56936252f152 h1:z/MpntplPaW6QW95pzcAR/72Z5TWDyDnSo0EOcyij9o= github.com/sourcegraph/yaml v1.0.1-0.20200714132230-56936252f152/go.mod h1:GIjDIg/heH5DOkXY3YJ/wNhfHsQHoXGjl8G8amsYQ1I= -github.com/sourcegraph/zoekt v0.0.0-20240418025752-74e75efaded6 h1:ZoA5u9P6wjoUFwfgi+alUVLJ60dc0XkshTjzDNoQpGg= -github.com/sourcegraph/zoekt v0.0.0-20240418025752-74e75efaded6/go.mod h1:+j+huwz4ZnffJmDHeLJyI9AY4a8DKQnfNV0J//upnyo= +github.com/sourcegraph/zoekt v0.0.0-20240501072156-72f95004e6d6 h1:aXHLpH1rhdvg4gQOiQWLkqVd3D/DG2li5Nnf6WE7mRs= +github.com/sourcegraph/zoekt v0.0.0-20240501072156-72f95004e6d6/go.mod h1:K7dYKxtKLPBRwu55Useje/JUZEuWgzlu5O1F8VFHfwE= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v0.0.0-20170901052352-ee1bd8ee15a1/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= diff --git a/internal/search/backend/BUILD.bazel b/internal/search/backend/BUILD.bazel index 0476ed6f04970..43c0fb106811a 100644 --- a/internal/search/backend/BUILD.bazel +++ b/internal/search/backend/BUILD.bazel @@ -39,7 +39,6 @@ go_library( "@com_github_sourcegraph_zoekt//cmd/zoekt-sourcegraph-indexserver/protos/sourcegraph/zoekt/configuration/v1:configuration", "@com_github_sourcegraph_zoekt//grpc/protos/zoekt/webserver/v1:webserver", "@com_github_sourcegraph_zoekt//query", - "@com_github_sourcegraph_zoekt//stream", "@io_opentelemetry_go_otel//attribute", "@org_golang_google_grpc//:go_default_library", "@org_golang_google_grpc//codes", diff --git a/internal/search/backend/cached.go b/internal/search/backend/cached.go index dd916ca94a867..7e5a39c9d8358 100644 --- a/internal/search/backend/cached.go +++ b/internal/search/backend/cached.go @@ -81,9 +81,6 @@ func (c *cachedSearcher) List(ctx context.Context, q zoektquery.Q, opts *zoekt.L // isTrueQuery returns true if q will always match all shards. func isTrueQuery(q zoektquery.Q) bool { - // the query is probably wrapped to avoid extra RPC work. - q = zoektquery.RPCUnwrap(q) - v, ok := q.(*zoektquery.Const) return ok && v.Value } diff --git a/internal/search/backend/horizontal.go b/internal/search/backend/horizontal.go index 40416047c9097..ba3554eac7ef3 100644 --- a/internal/search/backend/horizontal.go +++ b/internal/search/backend/horizontal.go @@ -14,7 +14,6 @@ import ( "github.com/sourcegraph/conc/pool" "github.com/sourcegraph/zoekt" "github.com/sourcegraph/zoekt/query" - "github.com/sourcegraph/zoekt/stream" "go.opentelemetry.io/otel/attribute" "github.com/sourcegraph/sourcegraph/internal/conf" @@ -64,7 +63,7 @@ func (s *HorizontalSearcher) StreamSearch(ctx context.Context, q query.Q, opts * pl := pool.New().WithErrors() for endpoint, client := range clients { pl.Go(func() error { - err := client.StreamSearch(ctx, q, opts, stream.SenderFunc(func(sr *zoekt.SearchResult) { + err := client.StreamSearch(ctx, q, opts, zoekt.SenderFunc(func(sr *zoekt.SearchResult) { // This shouldn't happen, but skip event if sr is nil. if sr == nil { return diff --git a/internal/search/backend/metered_searcher.go b/internal/search/backend/metered_searcher.go index a037941cc91c1..c747f8b328254 100644 --- a/internal/search/backend/metered_searcher.go +++ b/internal/search/backend/metered_searcher.go @@ -96,14 +96,6 @@ func (m *meteredSearcher) StreamSearch(ctx context.Context, q query.Q, opts *zoe tr, ctx := trace.New(ctx, "zoekt."+cat, attrs...) defer tr.EndWithErrIfNotContext(&err) - // We wrap our queries in GobCache, this gives us a convenient way to find - // out the marshalled size of the query. - if gobCache, ok := q.(*query.GobCache); ok { - b, _ := gobCache.GobEncode() - tr.SetAttributes(attribute.Int("query.size", len(b))) - event.AddField("query.size", len(b)) - } - // Instrument the RPC layer var writeRequestStart, writeRequestDone time.Time if isLeaf {