Code monitors: execute searches from worker, not through GraphQL
Created by: camdencheek
Depends on https://github.com/sourcegraph/deploy-sourcegraph-docker/pull/773
This updates code monitor background jobs to execute searches directly now that we can run searches independently of GraphQL resolvers. This is nice because it lets us use search result types directly rather than going through GraphQL and losing a bunch of information.
More importantly, this unblocks repo-aware code monitors because it will enable me to mutate our search jobs between the Plan
and Execute
steps without injecting code-monitor specific context down through the search stack.
Apologies for the large diff. This one was pretty impossible to split up.
Test plan
Tested manually. Note that this is technically a breaking change because it changes the format of the results stored in the database. However, since the jobs page doesn't show results yet, there should be no practical issues other than maybe some failure logs. It's probably worth wiping the code monitor tables to get a clean start for dev though (cc @limitedmage).