Skip to content

search: allow job Run method to accept resolved repos

Administrator requested to merge backend-integration/rvt/job-repos into main

Created by: rvantonder

Stacked on https://github.com/sourcegraph/sourcegraph/pull/26749.

This modifies the job.Run(...) interface to accept resolved repositories. Not all jobs require this arg (e.g., structural search can resolve the repos it needs as part of its Run logic). But, for potential jobs that may need it (our global text search, etc. logic), there are interdependencies on previously resolved repos that do need this value. When they do need this value, it's not possible to easily put those static jobs before doResults. I'm currently blocked on creating text search job before doResults if I can't supply it with the args.Repos in doResults at some later point. But, we ran into a similar issue with commit jobs which are also affected by "I want args.Repos how to deal with this".

After trying many things, I'm expanding the job.Run signature to accept repos at doResults time. Later, it will be possible to clean up the repo resolver logic itself so that the Run signature doesn't need resolved repos, but right now it's an acceptable compromise (and I have tried at least 3 other ways to do things, that are more intrusive to pull off. This is another one of those "trust me this is the easiest way" moments).

Merge request reports

Loading