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

Commit

Permalink
bump zoekt to version in sourcegraph/zoekt#642
Browse files Browse the repository at this point in the history
this will be changed to point to zoekt@main once sourcegraph/zoekt#642 is merged.
  • Loading branch information
ggilmore committed Sep 6, 2023
1 parent 25f1f4e commit 4f25112
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 16 deletions.
4 changes: 2 additions & 2 deletions deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -6273,8 +6273,8 @@ def go_dependencies():
name = "com_github_sourcegraph_zoekt",
build_file_proto_mode = "disable_global",
importpath = "github.com/sourcegraph/zoekt",
sum = "h1:kqYHOCtMTKwkM2F6AbpelFE+Olt2qqJyxBCNps1oIjQ=",
version = "v0.0.0-20230825171831-40a9a23bb04b",
sum = "h1:eeILF/Jb3ikAon458Uz29bDJD/SAZsc//czC+Hxyv1g=",
version = "v0.0.0-20230906170904-de3f7cb040b2",
)

go_repository(
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ require (
github.com/sourcegraph/conc v0.2.0
github.com/sourcegraph/mountinfo v0.0.0-20230106004439-7026e28cef67
github.com/sourcegraph/sourcegraph/monitoring v0.0.0-20230124144931-b2d81b1accb6
github.com/sourcegraph/zoekt v0.0.0-20230825171831-40a9a23bb04b
github.com/sourcegraph/zoekt v0.0.0-20230906170904-de3f7cb040b2
github.com/spf13/cobra v1.7.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/objx v0.5.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2027,8 +2027,8 @@ github.com/sourcegraph/scip v0.3.1-0.20230627154934-45df7f6d33fc h1:o+eq0cjVV3B5
github.com/sourcegraph/scip v0.3.1-0.20230627154934-45df7f6d33fc/go.mod h1:7ZKAtLIUmiMvOIgG5LMcBxdtBXVa0v2GWC4Hm1ASYQ0=
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-20230825171831-40a9a23bb04b h1:kqYHOCtMTKwkM2F6AbpelFE+Olt2qqJyxBCNps1oIjQ=
github.com/sourcegraph/zoekt v0.0.0-20230825171831-40a9a23bb04b/go.mod h1:3rlMtZdLxkc7P1R14qWq20fWDDyRQwL6TmAqH81WQ4M=
github.com/sourcegraph/zoekt v0.0.0-20230906170904-de3f7cb040b2 h1:eeILF/Jb3ikAon458Uz29bDJD/SAZsc//czC+Hxyv1g=
github.com/sourcegraph/zoekt v0.0.0-20230906170904-de3f7cb040b2/go.mod h1:49Y2VVQuWxaSUXeFphZnZX+/zVy2G/sqd+cg/oqQTBk=
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spf13/afero v0.0.0-20170901052352-ee1bd8ee15a1/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
Expand Down
2 changes: 1 addition & 1 deletion internal/search/backend/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ go_library(
"@com_github_sourcegraph_log//:log",
"@com_github_sourcegraph_zoekt//:zoekt",
"@com_github_sourcegraph_zoekt//cmd/zoekt-sourcegraph-indexserver/protos/sourcegraph/zoekt/configuration/v1:configuration",
"@com_github_sourcegraph_zoekt//grpc/v1:grpc",
"@com_github_sourcegraph_zoekt//cmd/zoekt-webserver/grpc/protos/zoekt/webserver/v1:webserver",
"@com_github_sourcegraph_zoekt//query",
"@com_github_sourcegraph_zoekt//rpc",
"@com_github_sourcegraph_zoekt//stream",
Expand Down
18 changes: 10 additions & 8 deletions internal/search/backend/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"io"

"github.com/sourcegraph/zoekt"
v1 "github.com/sourcegraph/zoekt/grpc/v1"
proto "github.com/sourcegraph/zoekt/cmd/zoekt-webserver/grpc/protos/zoekt/webserver/v1"
"github.com/sourcegraph/zoekt/query"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
Expand Down Expand Up @@ -55,7 +55,7 @@ func (c *switchableZoektGRPCClient) String() string {
// zoektGRPCClient is a zoekt.Streamer that uses gRPC for its RPC layer
type zoektGRPCClient struct {
endpoint string
client v1.WebserverServiceClient
client proto.WebserverServiceClient

// We capture the dial error to return it lazily.
// This allows us to treat Dial as infallible, which is
Expand All @@ -70,9 +70,11 @@ func (z *zoektGRPCClient) StreamSearch(ctx context.Context, q query.Q, opts *zoe
return z.dialErr
}

req := &v1.SearchRequest{
Query: query.QToProto(q),
Opts: opts.ToProto(),
req := &proto.StreamSearchRequest{
Request: &proto.SearchRequest{
Query: query.QToProto(q),
Opts: opts.ToProto(),
},
}

ss, err := z.client.StreamSearch(ctx, req)
Expand All @@ -89,7 +91,7 @@ func (z *zoektGRPCClient) StreamSearch(ctx context.Context, q query.Q, opts *zoe
var repoURLS map[string]string // We don't use repoURLs in Sourcegraph
var lineFragments map[string]string // We don't use lineFragments in Sourcegraph

sender.Send(zoekt.SearchResultFromProto(msg, repoURLS, lineFragments))
sender.Send(zoekt.SearchResultFromProto(msg.GetResponseChunk(), repoURLS, lineFragments))
}
}

Expand All @@ -98,7 +100,7 @@ func (z *zoektGRPCClient) Search(ctx context.Context, q query.Q, opts *zoekt.Sea
return nil, z.dialErr
}

req := &v1.SearchRequest{
req := &proto.SearchRequest{
Query: query.QToProto(q),
Opts: opts.ToProto(),
}
Expand All @@ -121,7 +123,7 @@ func (z *zoektGRPCClient) List(ctx context.Context, q query.Q, opts *zoekt.ListO
return nil, z.dialErr
}

req := &v1.ListRequest{
req := &proto.ListRequest{
Query: query.QToProto(q),
Opts: opts.ToProto(),
}
Expand Down
4 changes: 2 additions & 2 deletions internal/search/backend/zoekt.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/sourcegraph/log"
"github.com/sourcegraph/zoekt"
v1 "github.com/sourcegraph/zoekt/grpc/v1"
proto "github.com/sourcegraph/zoekt/cmd/zoekt-webserver/grpc/protos/zoekt/webserver/v1"
"github.com/sourcegraph/zoekt/rpc"
zoektstream "github.com/sourcegraph/zoekt/stream"
"google.golang.org/grpc"
Expand Down Expand Up @@ -122,7 +122,7 @@ func ZoektDialGRPC(endpoint string) zoekt.Streamer {
)
return NewMeteredSearcher(endpoint, &zoektGRPCClient{
endpoint: endpoint,
client: v1.NewWebserverServiceClient(conn),
client: proto.NewWebserverServiceClient(conn),
dialErr: err,
})
}

0 comments on commit 4f25112

Please sign in to comment.