zoekt: treat repo names case sensitively
Created by: keegancsmith
Previously we treated zoekt repositories as if the case would not match what is returned from the repo database. However, Zoekt requires the correct caseing of the repo name to do the search. Additionally Zoekt uses the correct casing of the repo name when indexing.
So the uses of ToLower when checking if a repo was indexed was unnecessary. Additionally in the case a repository name changed case we would incorrectly believe we have indexed the repo, but the actual zoekt search would fail due to the index being case sensitive.
Additionally avoiding the calls to ToLower should improve performance. However, I didn't validate this (but naively it should).
Merge request reports
Activity
Created by: keegancsmith
cc @tsenart @mrnugget if you remember our early work on zoekt perf, I think this was something we wanted to do? I spent a little bit of time validating we could :)
@sourcegraph/cloud note: we do ToLower on repo names in gitserver. This is unnecessary since we should always be using the casing from the repo table. This is a legacy from when gitserver used to be more directly tied to repo discovery. The proper solution some broader tech debt around using repo IDs everywhere instead of names.
Created by: codecov[bot]
Codecov Report
Merging #11670 into master will increase coverage by
0.08%
. The diff coverage is72.72%
.@@ Coverage Diff @@ ## master #11670 +/- ## ========================================== + Coverage 47.44% 47.53% +0.08% ========================================== Files 1404 1402 -2 Lines 79706 79489 -217 Branches 6816 6775 -41 ========================================== - Hits 37817 37782 -35 + Misses 38310 38131 -179 + Partials 3579 3576 -3
Flag Coverage Δ #go 51.72% <72.72%> (+0.13%)
#storybook 10.12% <ø> (ø)
#typescript 36.42% <ø> (ø)
#unit 47.13% <72.72%> (+0.08%)
Impacted Files Coverage Δ cmd/frontend/graphqlbackend/repositories.go 37.65% <0.00%> (ø)
cmd/frontend/graphqlbackend/symbols.go 0.00% <0.00%> (ø)
internal/search/backend/text.go 0.00% <0.00%> (ø)
cmd/frontend/graphqlbackend/search_structural.go 56.52% <100.00%> (ø)
cmd/frontend/graphqlbackend/zoekt.go 72.07% <100.00%> (ø)
...cker-images/grafana/cmd/grafana-wrapper/grafana.go 0.00% <0.00%> (-4.00%)
.../internal/codeintel/resolvers/graphql/locations.go 78.30% <0.00%> (-3.78%)
docker-images/grafana/cmd/grafana-wrapper/main.go 0.00% <0.00%> (ø)
docker-images/grafana/cmd/grafana-wrapper/site.go 0.00% <0.00%> (ø)
...ages/grafana/cmd/grafana-wrapper/grafana_change.go ... and 2 more