Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.
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/internal/httpapi/httpapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ func RegisterInternalServices(
}
m.Get(apirouter.SearchConfiguration).Handler(trace.Route(handler(indexer.serveConfiguration)))
m.Get(apirouter.ReposIndex).Handler(trace.Route(handler(indexer.serveList)))
m.Get(apirouter.RepoRank).Handler(trace.Route(handler(indexer.serveRepoRank)))
m.Get(apirouter.DocumentRanks).Handler(trace.Route(handler(indexer.serveDocumentRanks)))
m.Get(apirouter.UpdateIndexStatus).Handler(trace.Route(handler(indexer.handleIndexStatusUpdate)))

Expand Down
19 changes: 0 additions & 19 deletions cmd/frontend/internal/httpapi/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,21 +117,6 @@ func (s *searchIndexerGRPCServer) List(ctx context.Context, r *proto.ListRequest
return &response, nil
}

func (s *searchIndexerGRPCServer) RepositoryRank(ctx context.Context, request *proto.RepositoryRankRequest) (*proto.RepositoryRankResponse, error) {
ranks, err := s.server.Ranking.GetRepoRank(ctx, api.RepoName(request.Repository))
if err != nil {
if errcode.IsNotFound(err) {
return nil, status.Error(codes.NotFound, err.Error())
}

return nil, err
}

return &proto.RepositoryRankResponse{
Rank: ranks,
}, nil
}

func (s *searchIndexerGRPCServer) DocumentRanks(ctx context.Context, request *proto.DocumentRanksRequest) (*proto.DocumentRanksResponse, error) {
ranks, err := s.server.Ranking.GetDocumentRanks(ctx, api.RepoName(request.Repository))
if err != nil {
Expand Down Expand Up @@ -475,10 +460,6 @@ var metricGetVersion = promauto.NewCounter(prometheus.CounterOpts{
Help: "The total number of times we poll gitserver for the version of a indexable branch.",
})

func (h *searchIndexerServer) serveRepoRank(w http.ResponseWriter, r *http.Request) error {
return serveRank(h.Ranking.GetRepoRank, w, r)
}

func (h *searchIndexerServer) serveDocumentRanks(w http.ResponseWriter, r *http.Request) error {
return serveRank(h.Ranking.GetDocumentRanks, w, r)
}
Expand Down
4 changes: 2 additions & 2 deletions deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -6310,8 +6310,8 @@ def go_dependencies():
name = "com_github_sourcegraph_zoekt",
build_file_proto_mode = "disable_global",
importpath = "github.com/sourcegraph/zoekt",
sum = "h1:zFLcZUQ74dCV/oIiQT3+db8kFPstAnvFDm7pd+tjZ+8=",
version = "v0.0.0-20230620185637-63241cb1b17a",
sum = "h1:R47B3db8T7o6/STiPywibnrD+kZvlAXp5W5N0S+dSvg=",
version = "v0.0.0-20230629101834-7643f3b313a2",
)

go_repository(
Expand Down
13 changes: 12 additions & 1 deletion dev/backcompat/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,16 @@ PATCH_GO_TEST_CMDS = [
# Join all individual go test patches into a single shell snippet.
PATCH_ALL_GO_TESTS_CMD = "\n".join(PATCH_GO_TEST_CMDS)

# Replaces all occurences of @com_github_sourcegraph_(scip|conc) by @back_compat_com_github_sourcegraph_(scip|conc).
# Replaces all occurences of @com_github_sourcegraph_(scip|conc) and zoekt by @back_compat_com_github_sourcegraph_(scip|conc).
# We need to do this, because the backcompat share the same deps as the current HEAD, so we need to handle deviations manually here.
# It's annoying, but that's how we get cached back compat tests.
PATCH_BUILD_FIXES_CMD = """_sed_binary="sed"
if [ "$(uname)" == "Darwin" ]; then
_sed_binary="gsed"
fi
find . -type f -name "*.bazel" -exec $_sed_binary -i 's|@com_github_sourcegraph_conc|@back_compat_com_github_sourcegraph_conc|g' {} +
find . -type f -name "*.bazel" -exec $_sed_binary -i 's|@com_github_sourcegraph_scip|@back_compat_com_github_sourcegraph_scip|g' {} +
find . -type f -name "*.bazel" -exec $_sed_binary -i 's|@com_github_sourcegraph_zoekt|@back_compat_com_github_sourcegraph_zoekt|g' {} +
"""

def back_compat_defs():
Expand Down Expand Up @@ -102,6 +105,14 @@ def back_compat_defs():
version = "v0.2.0", # Need to be manually updated when bumping the back compat release target.
)

go_repository(
name = "back_compat_com_github_sourcegraph_zoekt",
build_file_proto_mode = "disable_global",
importpath = "github.com/sourcegraph/zoekt",
sum = "h1:zFLcZUQ74dCV/oIiQT3+db8kFPstAnvFDm7pd+tjZ+8=",
version = "v0.0.0-20230620185637-63241cb1b17a",
)


# Now that we have declared a replacement for the two problematic go packages that
# @sourcegraph_back_compat depends on, we can define the repository itself. Because it
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,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-20230620185637-63241cb1b17a
github.com/sourcegraph/zoekt v0.0.0-20230629101834-7643f3b313a2
github.com/spf13/cobra v1.6.1 // 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 @@ -2066,8 +2066,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-20230620185637-63241cb1b17a h1:zFLcZUQ74dCV/oIiQT3+db8kFPstAnvFDm7pd+tjZ+8=
github.com/sourcegraph/zoekt v0.0.0-20230620185637-63241cb1b17a/go.mod h1:E6oxotmuKTfdjmlkhyqc4eR3YvDLAHDHyPYISBP5+0g=
github.com/sourcegraph/zoekt v0.0.0-20230629101834-7643f3b313a2 h1:R47B3db8T7o6/STiPywibnrD+kZvlAXp5W5N0S+dSvg=
github.com/sourcegraph/zoekt v0.0.0-20230629101834-7643f3b313a2/go.mod h1:tulqNTjuUDxIO3W80Ipbe6drMJJdcJdQPyKwAwo9cmw=
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
1 change: 1 addition & 0 deletions internal/search/backend/metered_searcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ func (m *meteredSearcher) StreamSearch(ctx context.Context, q query.Q, opts *zoe
attribute.Int("stats.files_loaded", statsAgg.FilesLoaded),
attribute.Int("stats.files_skipped", statsAgg.FilesSkipped),
attribute.Int("stats.match_count", statsAgg.MatchCount),
attribute.Int("stats.ngram_lookups", statsAgg.NgramLookups),
attribute.Int("stats.ngram_matches", statsAgg.NgramMatches),
attribute.Int("stats.shard_files_considered", statsAgg.ShardFilesConsidered),
attribute.Int("stats.shards_scanned", statsAgg.ShardsScanned),
Expand Down