fork of https://github.com/sourcegraph/zoekt
0

Configure Feed

Select the types of activity you want to include in your feed.

archive: add cody and golang repo to e2e rank corpus (#696)

Additionally we add many queries we are tracking.

Test Plan: go test

+314
+15
cmd/zoekt-archive-index/e2e_rank_test.go
··· 37 37 38 38 archiveURLs := []string{ 39 39 "https://github.com/sourcegraph/sourcegraph/tree/v5.2.2", 40 + "https://github.com/golang/go/tree/go1.21.4", 41 + "https://github.com/sourcegraph/cody/tree/vscode-v0.14.5", 40 42 } 41 43 queries := []string{ 44 + // golang/go 45 + "test server", 46 + "bytes buffer", 47 + "bufio buffer", 48 + 49 + // sourcegraph/sourcegraph 42 50 "graphql type User", 51 + "Get database/user", 52 + "InternalDoer", 53 + "Repository metadata Write rbac", 54 + 55 + // cody 56 + "generate unit test", 57 + "r:cody sourcegraph url", 43 58 } 44 59 45 60 indexDir := t.TempDir()
+40
cmd/zoekt-archive-index/testdata/Get_databaseuser.txt
··· 1 + queryString: Get database/user 2 + query: (and case_substr:"Get" substr:"database/user") 3 + 4 + github.com/sourcegraph/sourcegraph/internal/database/user_emails.go 5 + 161:func (s *userEmailsStore) Get(ctx context.Context, userID int32, email string) (emailCanonicalCase string, verified bool, err error) { 6 + 50: Get(ctx context.Context, userID int32, email string) (emailCanonicalCase string, verified bool, err error) 7 + 91:func (s *userEmailsStore) GetInitialSiteAdminInfo(ctx context.Context) (email string, tosAccepted bool, err error) { 8 + hidden 14 more line matches 9 + 10 + github.com/sourcegraph/sourcegraph/internal/database/user_roles.go 11 + 35: GetUserRoleOpts UserRoleOpts 12 + 358:func (r *userRoleStore) GetByUserID(ctx context.Context, opts GetUserRoleOpts) ([]*types.UserRole, error) { 13 + 365:func (r *userRoleStore) GetByRoleID(ctx context.Context, opts GetUserRoleOpts) ([]*types.UserRole, error) { 14 + hidden 8 more line matches 15 + 16 + github.com/sourcegraph/sourcegraph/internal/database/users.go 17 + 940:func (u *userStore) GetByID(ctx context.Context, id int32) (*types.User, error) { 18 + 947:func (u *userStore) GetByVerifiedEmail(ctx context.Context, email string) (*types.User, error) { 19 + 951:func (u *userStore) GetByUsername(ctx context.Context, username string) (*types.User, error) { 20 + hidden 17 more line matches 21 + 22 + github.com/sourcegraph/sourcegraph/internal/database/user_credentials.go 23 + 248:func (s *userCredentialsStore) GetByID(ctx context.Context, id int64) (*UserCredential, error) { 24 + 271:func (s *userCredentialsStore) GetByScope(ctx context.Context, scope UserCredentialScope) (*UserCredential, error) { 25 + 108: GetByID(ctx context.Context, id int64) (*UserCredential, error) 26 + hidden 8 more line matches 27 + 28 + github.com/sourcegraph/sourcegraph/internal/database/user_emails_test.go 29 + 56:func TestUserEmails_Get(t *testing.T) { 30 + 106:func TestUserEmails_GetPrimary(t *testing.T) { 31 + 585:func TestUserEmails_GetLatestVerificationSentEmail(t *testing.T) { 32 + hidden 10 more line matches 33 + 34 + github.com/sourcegraph/sourcegraph/internal/database/users_test.go 35 + 628:func TestUsers_GetByVerifiedEmail(t *testing.T) { 36 + 664:func TestUsers_GetByUsername(t *testing.T) { 37 + 711:func TestUsers_GetByUsernames(t *testing.T) { 38 + hidden 32 more line matches 39 + 40 + hidden 3 more file matches
+27
cmd/zoekt-archive-index/testdata/InternalDoer.txt
··· 1 + queryString: InternalDoer 2 + query: case_substr:"InternalDoer" 3 + 4 + github.com/sourcegraph/sourcegraph/internal/httpcli/client.go 5 + 217:var InternalDoer, _ = InternalClientFactory.Doer() 6 + 215:// InternalDoer is a shared client for internal communication. This is a 7 + 8 + github.com/sourcegraph/sourcegraph/internal/api/internalapi/client.go 9 + 144: resp, err := httpcli.InternalDoer.Do(req.WithContext(ctx)) 10 + 11 + github.com/sourcegraph/sourcegraph/enterprise/cmd/embeddings/qa/context_data.tsv 12 + 3:In the sourcegraph repository, what does InternalDoer do? internal/httpcli/client.go 13 + 4:In my codebase, what does InternalDoer do? internal/httpcli/client.go 14 + 15 + github.com/sourcegraph/sourcegraph/cmd/frontend/internal/app/badge.go 16 + 23: totalRefs, err := backend.CountGoImporters(r.Context(), httpcli.InternalDoer, routevar.ToRepo(mux.Vars(r))) 17 + 18 + github.com/sourcegraph/sourcegraph/internal/batches/webhooks/webhooks.go 19 + 67: Enqueue(ctx, logger, db, eventType, marshalBatchChange, id, httpcli.InternalDoer) 20 + 74: Enqueue(ctx, logger, db, eventType, marshalChangeset, id, httpcli.InternalDoer) 21 + 22 + github.com/sourcegraph/sourcegraph/cmd/frontend/internal/app/resolvers/app.go 23 + 53: doer: httpcli.InternalDoer, 24 + 354: cli := httpcli.InternalDoer 25 + 424: cli := httpcli.InternalDoer 26 + 27 + hidden 9 more file matches
+33
cmd/zoekt-archive-index/testdata/Repository_metadata_Write_rbac.txt
··· 1 + queryString: Repository metadata Write rbac 2 + query: (and case_substr:"Repository" substr:"metadata" case_substr:"Write" substr:"rbac") 3 + 4 + github.com/sourcegraph/sourcegraph/cmd/frontend/graphqlbackend/repository_metadata.go 5 + 54:func (r *schemaResolver) AddRepoMetadata(ctx context.Context, args struct { 6 + 95:func (r *schemaResolver) UpdateRepoMetadata(ctx context.Context, args struct { 7 + 134:func (r *schemaResolver) DeleteRepoMetadata(ctx context.Context, args struct { 8 + hidden 30 more line matches 9 + 10 + github.com/sourcegraph/sourcegraph/client/web/src/repo/tree/TreePageContent.tsx 11 + 666:interface RepositoryContributorNodeProps extends QuerySpec { 12 + 10:import { RepoMetadata } from '@sourcegraph/branded' 13 + 16:import { RepositoryType, SearchPatternType, type TreeFields } from '@sourcegraph/shared/src/graphql-operations' 14 + hidden 46 more line matches 15 + 16 + github.com/sourcegraph/sourcegraph/doc/admin/repo/metadata.md 17 + 1:# Custom repository metadata 18 + 18:## Adding metadata 19 + 8:### Repository owners 20 + hidden 14 more line matches 21 + 22 + github.com/sourcegraph/sourcegraph/cmd/frontend/graphqlbackend/repository_metadata_test.go 23 + 26:func TestRepositoryMetadata(t *testing.T) { 24 + 17: "github.com/sourcegraph/sourcegraph/internal/rbac" 25 + 23: rtypes "github.com/sourcegraph/sourcegraph/internal/rbac/types" 26 + hidden 25 more line matches 27 + 28 + github.com/sourcegraph/sourcegraph/client/web/src/repo/repoContainerRoutes.tsx 29 + 3:import { canWriteRepoMetadata } from '../util/rbac' 30 + 5:import { RepositoryChangelistPage } from './commit/RepositoryCommitPage' 31 + 9:const RepositoryCommitPage = lazyComponent(() => import('./commit/RepositoryCommitPage'), 'RepositoryCommitPage') 32 + hidden 19 more line matches 33 +
+40
cmd/zoekt-archive-index/testdata/bufio_buffer.txt
··· 1 + queryString: bufio buffer 2 + query: (and substr:"bufio" substr:"buffer") 3 + 4 + github.com/golang/go/src/bytes/buffer.go 5 + 20:type Buffer struct { 6 + 60:func (b *Buffer) AvailableBuffer() []byte { return b.buf[len(b.buf):] } 7 + 472:func NewBuffer(buf []byte) *Buffer { return &Buffer{buf: buf} } 8 + hidden 108 more line matches 9 + 10 + github.com/golang/go/src/bufio/scan.go 11 + 267:func (s *Scanner) Buffer(buf []byte, max int) { 12 + 5:package bufio 13 + 25:// large to fit in the buffer. When a scan stops, the reader may have 14 + hidden 21 more line matches 15 + 16 + github.com/golang/go/src/bufio/bufio.go 17 + 8:package bufio 18 + 665:func (b *Writer) AvailableBuffer() []byte { 19 + 338:func (b *Reader) Buffered() int { return b.w - b.r } 20 + hidden 89 more line matches 21 + 22 + github.com/golang/go/src/cmd/doc/pkg.go 23 + 59: bytes.Buffer 24 + 56:type pkgBuffer struct { 25 + 8: "bufio" 26 + hidden 8 more line matches 27 + 28 + github.com/golang/go/src/net/http/h2_bundle.go 29 + 3716:type http2pipeBuffer interface { 30 + 1086:type http2dataBuffer struct { 31 + 3724:func (p *http2pipe) setBuffer(b http2pipeBuffer) { 32 + hidden 116 more line matches 33 + 34 + github.com/golang/go/src/image/png/writer.go 35 + 36:type EncoderBuffer encoder 36 + 24: BufferPool EncoderBufferPool 37 + 30:type EncoderBufferPool interface { 38 + hidden 18 more line matches 39 + 40 + hidden 112 more file matches
+40
cmd/zoekt-archive-index/testdata/bytes_buffer.txt
··· 1 + queryString: bytes buffer 2 + query: (and substr:"bytes" substr:"buffer") 3 + 4 + github.com/golang/go/src/bytes/buffer.go 5 + 20:type Buffer struct { 6 + 54:func (b *Buffer) Bytes() []byte { return b.buf[b.off:] } 7 + 5:package bytes 8 + hidden 126 more line matches 9 + 10 + github.com/golang/go/src/cmd/internal/edit/edit.go 11 + 14:type Buffer struct { 12 + 68:func (b *Buffer) Bytes() []byte { 13 + 41:func NewBuffer(data []byte) *Buffer { 14 + hidden 13 more line matches 15 + 16 + github.com/golang/go/src/hash/crc32/crc32_ppc64le.s 17 + 122: SLD $2,R8 // convert index-> bytes 18 + 59: MOVWZ 0(R5),R8 // 0-3 bytes of p ?Endian? 19 + 60: MOVWZ 4(R5),R9 // 4-7 bytes of p 20 + hidden 35 more line matches 21 + 22 + github.com/golang/go/src/fmt/print.go 23 + 101:type buffer []byte 24 + 509:func (p *pp) fmtBytes(v []byte, verb rune, typeString string) { 25 + 17:// Strings for use with buffer.WriteString. 26 + hidden 28 more line matches 27 + 28 + github.com/golang/go/src/bufio/scan.go 29 + 106:func (s *Scanner) Bytes() []byte { 30 + 267:func (s *Scanner) Buffer(buf []byte, max int) { 31 + 289:func ScanBytes(data []byte, atEOF bool) (advance int, token []byte, err error) { 32 + hidden 26 more line matches 33 + 34 + github.com/golang/go/src/os/exec/exec.go 35 + 1134:func (w *prefixSuffixSaver) Bytes() []byte { 36 + 94: "bytes" 37 + 396: if i := bytes.Index(stack, []byte("\nos/exec.Command(")); i >= 0 { 38 + hidden 17 more line matches 39 + 40 + hidden 494 more file matches
+40
cmd/zoekt-archive-index/testdata/generate_unit_test.txt
··· 1 + queryString: generate unit test 2 + query: (and substr:"generate" substr:"unit" substr:"test") 3 + 4 + github.com/sourcegraph/sourcegraph/cmd/frontend/internal/insights/resolvers/insight_series_resolver.go 5 + 300:func (j *seriesResolverGenerator) Generate(ctx context.Context, series types.InsightViewSeries, baseResolver baseInsightResolver, filters types.InsightViewFilters, options types.SeriesDisplayOptions) ([]graphqlbackend.InsightSeriesResolver, error) { 6 + 275: Generate(ctx context.Context, series types.InsightViewSeries, baseResolver baseInsightResolver, filters types.InsightViewFilters, options types.SeriesDisplayOptions) ([]graphqlbackend.InsightSeriesResolver, error) 7 + 286: generateResolver resolverGenerator 8 + hidden 16 more line matches 9 + 10 + github.com/golang/go/src/cmd/vendor/github.com/google/pprof/internal/report/report.go 11 + 87:func Generate(w io.Writer, rpt *Report, obj plugin.ObjTool) error { 12 + 187:func (rpt *Report) selectOutputUnit(g *graph.Graph) { 13 + 75: SampleUnit string // Unit for the sample data from the profile. 14 + hidden 48 more line matches 15 + 16 + github.com/sourcegraph/sourcegraph/internal/codeintel/autoindexing/internal/inference/lua/test.lua 17 + 9: generate = function(_, paths) 18 + 6: patterns = { pattern.new_path_basename "sg-test" }, 19 + 8: -- Invoked as part of unit tests for the autoindexing service 20 + hidden 1 more line matches 21 + 22 + github.com/golang/go/src/cmd/internal/testdir/testdir_test.go 23 + 273:type test struct { 24 + 74:func Test(t *testing.T) { 25 + 263:type testCommon struct { 26 + hidden 120 more line matches 27 + 28 + github.com/golang/go/src/cmd/vendor/github.com/google/pprof/profile/profile.go 29 + 65: Unit string // seconds, nanoseconds, bytes, etc 30 + 77: NumUnit map[string][]string 31 + 68: unitX int64 32 + hidden 44 more line matches 33 + 34 + github.com/golang/go/src/cmd/link/internal/loader/loader.go 35 + 79: unit *sym.CompilationUnit 36 + 1544:func (l *Loader) SymUnit(i Sym) *sym.CompilationUnit { 37 + 228: generatedSyms Bitmap // symbols that generate their content, indexed by ext sym idx 38 + hidden 50 more line matches 39 + 40 + hidden 244 more file matches
+39
cmd/zoekt-archive-index/testdata/r_cody_sourcegraph_url.txt
··· 1 + queryString: r:cody sourcegraph url 2 + query: (and repo:cody substr:"sourcegraph" substr:"url") 3 + 4 + github.com/sourcegraph/cody/lib/shared/src/sourcegraph-api/graphql/client.ts 5 + 611: const url = buildGraphQLUrl({ request: query, baseUrl: this.config.serverEndpoint }) 6 + 626: const url = buildGraphQLUrl({ request: query, baseUrl: this.dotcomUrl.href }) 7 + 641: const url = 'http://localhost:49300/.api/testLogging' 8 + hidden 51 more line matches 9 + 10 + github.com/sourcegraph/cody/vscode/src/completions/client.ts 11 + 85: const url = getCodeCompletionsEndpoint() 12 + 1:import { FeatureFlag, featureFlagProvider } from '@sourcegraph/cody-shared/src/experimentation/FeatureFlagProvider' 13 + 5:} from '@sourcegraph/cody-shared/src/sourcegraph-api/completions/client' 14 + hidden 6 more line matches 15 + 16 + github.com/sourcegraph/cody/vscode/scripts/download-wasm-modules.ts 17 + 83: for (const url of urls) { 18 + 93:function getFilePathFromURL(url: string): string { 19 + 20:const urls = [ 20 + hidden 21 more line matches 21 + 22 + github.com/sourcegraph/cody/slack/src/services/local-vector-store.ts 23 + 18: const { content, url } = codyNotice 24 + 9: owner: 'sourcegraph', 25 + 24: fileName: url, 26 + 27 + github.com/sourcegraph/cody/lib/shared/src/sourcegraph-api/completions/client.ts 28 + 23:export abstract class SourcegraphCompletionsClient { 29 + 21: * Access the chat based LLM APIs via a Sourcegraph server instance. 30 + 36: return new URL('/.api/completions/stream', this.config.serverEndpoint).href 31 + hidden 1 more line matches 32 + 33 + github.com/sourcegraph/cody/lib/shared/src/sourcegraph-api/completions/browserClient.ts 34 + 8:export class SourcegraphBrowserCompletionsClient extends SourcegraphCompletionsClient { 35 + 5:import { SourcegraphCompletionsClient } from './client' 36 + 20: headersInstance.set('X-Sourcegraph-Should-Trace', 'true') 37 + hidden 1 more line matches 38 + 39 + hidden 71 more file matches
+40
cmd/zoekt-archive-index/testdata/test_server.txt
··· 1 + queryString: test server 2 + query: (and substr:"test" substr:"server") 3 + 4 + github.com/golang/go/src/net/http/httptest/server.go 5 + 26:type Server struct { 6 + 105:func NewServer(handler http.Handler) *Server { 7 + 117:func NewUnstartedServer(handler http.Handler) *Server { 8 + hidden 62 more line matches 9 + 10 + github.com/golang/go/src/net/rpc/server.go 11 + 188:type Server struct { 12 + 656:type ServerCodec interface { 13 + 197:func NewServer() *Server { 14 + hidden 104 more line matches 15 + 16 + github.com/sourcegraph/cody/vscode/test/fixtures/mock-server.ts 17 + 126: const server = app.listen(SERVER_PORT, () => { 18 + 19:const SERVER_PORT = 49300 19 + 21:export const SERVER_URL = 'http://localhost:49300' 20 + hidden 24 more line matches 21 + 22 + github.com/golang/go/src/net/http/server.go 23 + 2617:type Server struct { 24 + 256: server *Server 25 + 2925:type serverHandler struct { 26 + hidden 180 more line matches 27 + 28 + github.com/sourcegraph/sourcegraph/cmd/gitserver/server/server.go 29 + 132:type Server struct { 30 + 2:package server 31 + 741:func (s *Server) serverContext() (context.Context, context.CancelFunc) { 32 + hidden 166 more line matches 33 + 34 + github.com/golang/go/src/cmd/go/internal/vcweb/vcstest/vcstest.go 35 + 32:type Server struct { 36 + 42:func NewServer() (srv *Server, err error) { 37 + 7:package vcstest 38 + hidden 31 more line matches 39 + 40 + hidden 494 more file matches