Add context to zoekt AST queries

What does this MR do and why?

Add context to zoekt AST queries

This will allow us to more easily debug query components.

AI Summary

This change adds debugging context information to search filters in a code search system. The modifications allow each search filter to include a "context" label that identifies what type of search operation is being performed (like "project_id_search", "public_branch", "admin_branch", etc.).

The main changes include:

  • Adding an optional context parameter to all filter methods
  • Creating a with_context helper function that attaches context information to filters when provided
  • Updating all the places where filters are created to include descriptive context names
  • Modifying test fixtures to reflect the new context information in the expected output

This enhancement helps with debugging and monitoring by making it easier to understand what each part of a complex search query is doing, without changing the actual search functionality. It's like adding labels to different parts of a recipe so you can better understand what each ingredient is for.

References

Closes #557450 (closed)

Screenshots or screen recordings

Before After

How to set up and validate locally

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports

Loading