Skip to content

Search backend: split up repo resolution

Warren Gifford requested to merge backend-integration/cc/clean-repos-3 into main

Created by: camdencheek

This splits up the logic in repo resolution a bit to make the Resolve function a bit less...much. Basically, it takes the big, parallel for loop over resolved repos and splits it into two consecutive steps:

  1. Associate revisions with repos. This can be pretty expensive, so we parallelize it across 8 goroutines.
  2. Filter the associated revisions. After we've re-associated revisions into a representation like the user requested, we can then filter the set of revisions to ensure that the revisions exist and that the repo/rev pairs should not be filtered out by any other filters (e.g. repo:has.commit.after())

I did my best to keep this change as small as possible (see previous PRs), but the diff is still pretty opaque. Would recommend just reviewing the "after" code directly.

Okay, done with refactoring this for now. Next step is to move repo:contains.file() code into here!

Test plan

All unit tests pass, and there is decent coverage here. Did some manual testing, including light perf testing for the changes in parallelism.

Merge request reports

Loading