This repository was archived by the owner on Sep 30, 2024. It is now read-only.
searcher: Consolidate FetchTar and FetchTarPaths#64268
Merged
eseliger merged 5 commits intoAug 8, 2024
Merged
Conversation
This was referenced Aug 5, 2024
This was referenced Aug 5, 2024
Member
Author
keegancsmith
approved these changes
Aug 5, 2024
Comment on lines
471
to
474
Member
There was a problem hiding this comment.
you will need to run the benchmarks in this package to ensure you don't regress this behaviour.
Member
Author
There was a problem hiding this comment.
Uhm :(
➜ sourcegraph git:(main) go test -bench=. ./cmd/searcher/internal/search/...
--- FAIL: BenchmarkColumnHelper
chunk_test.go:374: column is not offset even though data is ASCII
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x10623f684]
goroutine 5275 [running]:
github.com/sourcegraph/sourcegraph/cmd/searcher/internal/search.(*Store).fetch(0x108d98f00, {0x1070a2400, 0x1400221a570}, {0x1064c1142, 0x14}, {0x106554df7, 0x28}, 0x14002102100, {0x0, 0x0, ...})
/Users/erik/Code/sourcegraph/sourcegraph/cmd/searcher/internal/search/store.go:272 +0x464
github.com/sourcegraph/sourcegraph/cmd/searcher/internal/search.(*Store).PrepareZip.func2.1({0x1070a2400?, 0x1400221a570?})
/Users/erik/Code/sourcegraph/sourcegraph/cmd/searcher/internal/search/store.go:189 +0x5c
github.com/sourcegraph/sourcegraph/internal/diskcache.(*store).Open.func1({0x1070a2400?, 0x1400221a570?}, {0x140028bc4e0, 0x60})
/Users/erik/Code/sourcegraph/sourcegraph/internal/diskcache/cache.go:113 +0x34
github.com/sourcegraph/sourcegraph/internal/diskcache.doFetch({0x1070a2400, 0x1400221a570}, {0x140028bc300, 0x5b}, 0x1400224a1c0, {0x1070af9c0, 0x1400298c410})
/Users/erik/Code/sourcegraph/sourcegraph/internal/diskcache/cache.go:257 +0x30c
github.com/sourcegraph/sourcegraph/internal/diskcache.(*store).OpenWithPath.func2()
/Users/erik/Code/sourcegraph/sourcegraph/internal/diskcache/cache.go:185 +0x218
created by github.com/sourcegraph/sourcegraph/internal/diskcache.(*store).OpenWithPath in goroutine 5274
/Users/erik/Code/sourcegraph/sourcegraph/internal/diskcache/cache.go:172 +0x798
exit status 2
FAIL github.com/sourcegraph/sourcegraph/cmd/searcher/internal/search 3.441s
FAIL
Seems like it's borked on main and that fetchTarFromGithubWithPaths never properly respected paths..
Member
There was a problem hiding this comment.
Cool, go ahead and merge I will take a look in https://linear.app/sourcegraph/issue/SPLF-183/benchmarks-in-searcher-broken
827cf1f to
fdaccd5
Compare
3e22471 to
f410ad5
Compare
fdaccd5 to
dd453a0
Compare
f410ad5 to
7a13632
Compare
dd453a0 to
bb34348
Compare
7a13632 to
a5583c1
Compare
This PR makes the calls to create the OIDC provider explicit, so that we don't need to implicitly need to call a Refresh method, even if we might end up not needing the `p.oidc`. This is a start toward being able to create providers on the fly cheaply vs having a globally managed list of providers in memory. Test plan: Auth with SAMS locally still works.
This PR fixes a few more imports from /internal/ packages using /cmd/... contents. Test plan: Mainly moved code around and CI still passes.
These functions are not required to be called outside of frontend, so there's no need to reexport them. Instead, we consolidate the signout cookie logic in the session package. Test plan: Just moved some code around, go compiler doesn't complain.
To prevent cross-cmd imports in the future, moving the backend package into internal. Test plan: Just moved a package around, Go compiler doesn't complain and CI still passes.
There was a todo comment that said we want to consolidate them but didn't yet to keep another diff smaller - so now we're doing that. Test plan: Integration tests for search still pass.
bb34348 to
0a78295
Compare
a5583c1 to
e719eb4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

There was a todo comment that said we want to consolidate them but didn't yet to keep another diff smaller - so now we're doing that.
Test plan: Integration tests for search still pass.