Skip to content

Search backend: do not apply `DNF` to `or` expressions

Warren Gifford requested to merge backend-integration/cc/dnf-to-basic into main

Created by: camdencheek

This modifies the DNF step to only distribute or expressions that contain parameters. This allows us to maintain the tree structure of patterns in basic queries so that we can generate optimized or queries for our backends. The Zoekt backend already takes advantage of this, and the commit search backend will be able to as well. Comments inline.

Test plan

Added many tests, checked that each changed test is expected, and verified from traces that we do, in fact, send optimized or queries to zoekt (the query camden or cheek generates (and (or substr:"camden" substr:"cheek") branch="HEAD" rawConfig:RcOnlyPublic\|RcNoForks\|RcNoArchived)). Also ran backend integration tests on this branch.

Merge request reports

Loading