Skip to content

search: db no longer part of job interface

Administrator requested to merge backend-integration/rvt/no-db-job-intf into main

Created by: rvantonder

Removes database.DB as a required argument to job Run method. Two reasons why I strongly think this is the right move now:

  • I'm hard blocked on creating a ZoektJob (which doesn't need DB, wip branch here) where the Zoekt package is used in searcher (for structural search). This because we don't allow a DB handle in searcher (lint). I could make the ZoektJob live in a different package but:

    • (a) we actually want to be able to use this ZoektJob from searcher for structural search, and it would allow creating it statically at some point
    • (b) it's not good to include DB and give the impression that it can be used, when it can't (e.g., in a ZoektJob)
  • Second big reason: almost all current uses of DB are just for repo resolution/pager. It often appears with repoOptions for jobs. We should instead pass the repo pager (which requires both) to these jobs, and not the DB handle.

I'll have to check back on CI to see that I caught everything but please review so long.

Test plan

Semantics-preserving.

Merge request reports

Loading