Add zoekt feature class to check minimum schema versions

What does this MR do and why?

Add zoekt feature class to check minimum schema versions. This is another iteration based on !203016 (comment 2715264309)

AI Summary

This code refactors how search features are managed in the Zoekt search system. Instead of having specific hardcoded logic for checking if "traversal ID queries" are available, it creates a more flexible, reusable system where different search features can be easily added and managed.

The main changes include:

  1. Removed hardcoded feature logic: Deleted the specific use_traversal_id_queries? method and related constants that were tightly coupled to one feature.

  2. Created a flexible feature system: Added a new BaseFeature class that provides a template for any search feature, handling common tasks like caching, version checking, and availability determination across different search scopes (project, group, or global).

  3. Implemented the first feature: Created TraversalIdSearch as a specific implementation of the base feature system, maintaining the same functionality as before but in a more organized way.

  4. Updated all references: Changed all code that previously called the old method to use the new generic feature_available? method instead.

  5. Improved testing: Added helper methods to make it easier to test different feature combinations and created reusable test templates.

The end result is a cleaner, more maintainable system that makes it much easier to add new search features in the future without duplicating code, while preserving all existing functionality.

References

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.

Edited by John Mason

Merge request reports

Loading