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

Configure Feed

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

introduce ability to skip indexing symbols metadata for certain repositories (#344)

+16 -3
+16 -3
cmd/zoekt-sourcegraph-indexserver/main.go
··· 175 175 // deltaShardNumberFallbackThreshold is an upper limit on the number of preexisting shards that can exist 176 176 // before attempting a delta build. 177 177 deltaShardNumberFallbackThreshold uint64 178 + 179 + // repositoriesSkipSymbolsCalculationAllowList is an allowlist for repositories that 180 + // we skip calculating symbols metadata for during builds 181 + repositoriesSkipSymbolsCalculationAllowList map[string]struct{} 178 182 } 179 183 180 184 var debug = log.New(ioutil.Discard, "", log.LstdFlags) ··· 477 481 478 482 repositoryName := args.Name 479 483 if _, ok := s.deltaBuildRepositoriesAllowList[repositoryName]; ok { 480 - repositoryID := args.BuildOptions().RepositoryDescription.ID 481 - debug.Printf("delta build: Server.Index: marking %q (ID %d) for delta build", repositoryName, repositoryID) 482 - 484 + tr.LazyPrintf("marking this repository for delta build") 483 485 args.UseDelta = true 484 486 } 485 487 486 488 args.DeltaShardNumberFallbackThreshold = s.deltaShardNumberFallbackThreshold 489 + 490 + if _, ok := s.repositoriesSkipSymbolsCalculationAllowList[repositoryName]; ok { 491 + tr.LazyPrintf("skipping symbols calculation") 492 + args.Symbols = false 493 + } 487 494 488 495 reason := "forced" 489 496 ··· 924 931 debug.Printf("disabling delta build fallback behavior - delta builds will be performed regardless of the number of preexisting shards") 925 932 } 926 933 934 + reposShouldSkipSymbolsCalculation := getEnvWithDefaultEmptySet("SKIP_SYMBOLS_REPOS_ALLOWLIST") 935 + if len(reposShouldSkipSymbolsCalculation) > 0 { 936 + debug.Printf("skipping generating symbols metadata for: %s", joinStringSet(reposShouldSkipSymbolsCalculation, ", ")) 937 + } 938 + 927 939 var sg Sourcegraph 928 940 if rootURL.IsAbs() { 929 941 var batchSize int ··· 959 971 shardMerging: zoekt.ShardMergingEnabled(), 960 972 deltaBuildRepositoriesAllowList: deltaBuildRepositoriesAllowList, 961 973 deltaShardNumberFallbackThreshold: deltaShardNumberFallbackThreshold, 974 + repositoriesSkipSymbolsCalculationAllowList: reposShouldSkipSymbolsCalculation, 962 975 }, err 963 976 } 964 977