-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
searcher: Consolidate FetchTar and FetchTarPaths #64268
searcher: Consolidate FetchTar and FetchTarPaths #64268
Conversation
func fetchTarFromGithub(ctx context.Context, repo api.RepoName, commit api.CommitID, paths []string) (io.ReadCloser, error) { | ||
r, err := fetchTarFromGithubWithPaths(ctx, repo, commit, paths) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you will need to run the benchmarks in this package to ensure you don't regress this behaviour.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
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.