Skip to content

Commit/diff search: remove limits

Administrator requested to merge backend-integration/cc/unlimited-commit into main

Created by: camdencheek

This removes all limits on the number of repositories searched from commit and diff search. Instead, we search repos in a paginated fashion, and continue searching until we hit a timeout.

The diff is a little messy, but each commit is pretty readable if you'd prefer to review more incrementally.

Some background: We currently have a hard cap of 50 repos for commit and diff search. This is because commit and diff search are not currently indexable, and diff search in particular is extremely expensive (diff search over just the sourcegraph/sourcegraph repo currently takes roughly 20s).

Then, a while ago, we added support for streaming the list of repos to search from the db. It adds a non-negligible amount of latency to resolve the full set of searchable repos, so instead, we do it 500 (by default) at a time which lets us start searching much sooner.

However, because code monitors were so expensive, we still needed to enforce limits there in order to keep from overloading the system with bad monitors. Now that all users on sourcegraph.com are using repo-aware monitors, this is no longer a concern and we can just keep searching until we hit the timeout.

Test plan

Manually tested that we run commit and diff search for any number of repositories up to the configured timeout. Also am running backend integration tests on this branch.

Merge request reports

Loading