Skip to content

Code ownership: Add codeownership.Job to filter post-search results

Warren Gifford requested to merge ps/code-ownership-filter-job into main

Created by: philipp-spiess

Closes #39156 (closed)

This PR adds scaffolding for a new filter Job for the code ownership RFC.

The job will be used to do post-search filtering based on the new file:has.owner() predicate. I've added it quite at the end of the job list (with only a few more jobs that run afterwards.

Conceptually, as we do not have added a code ownership information source yet, this will filter out all results if a code owner is selected: no files have any owners yet.

There's an open question that's specific to the predicate infra that I explained inline (let me know if anything is unclear).

Test plan

  • I've added debug logging to various places to ensure that:
    • The zoekt search is equivalent to the same query without the file:has.owner() predicate.
    • We indeed get the right number of results piped into the Job.
  • I've also added tests in Go to:
    • Verify the job is added at the right place when a code ownership predicate is found in the query.
    • Test the implementation of the post-search filtering (right now this filters out everything if any code owner is specified)

Merge request reports

Loading