Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

go.mod: bump zoekt #62332

Merged
merged 5 commits into from
May 1, 2024
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
1 change: 0 additions & 1 deletion cmd/frontend/graphqlbackend/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 1 addition & 2 deletions cmd/frontend/graphqlbackend/repository_text_search_index.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
1 change: 0 additions & 1 deletion internal/search/backend/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 0 additions & 3 deletions internal/search/backend/cached.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
3 changes: 1 addition & 2 deletions internal/search/backend/horizontal.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
8 changes: 0 additions & 8 deletions internal/search/backend/metered_searcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't wrap our queries in GobCache anymore since we fully switched to grpc, see here

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 {
Expand Down
Loading