Skip to content

Release GLQL Advanced Search integration

Summary

  • Promote glql_work_items feature flag from WIP → beta (default enabled)
  • Promote glql_es_integration feature flag from gitlab_com_derisk → beta (default enabled)
  • Add critical safety check to prevent Elasticsearch usage before reindex_labels_in_work_items migration completes
  • Comprehensive spec coverage for migration dependency check

Changes

Feature Flag Rollout

  • Move glql_work_items from wip/ to beta/ with default_enabled: true
  • Move glql_es_integration from gitlab_com_derisk/ to beta/ with default_enabled: true

Safety Guard Implementation

  • Added migration completion check in WorkItemsFinder#use_elasticsearch_finder? (EE)
  • Consolidated all ES enablement checks into single method with migration gate
  • Respects CE/EE boundary - no EE classes referenced in CE code
  • Prevents Elasticsearch queries when reindex_labels_in_work_items migration is incomplete

Architecture

The migration safety check is properly placed in the EE finder's use_elasticsearch_finder? method, which already validates:

  • URL parameter enabled
  • Elasticsearch enabled globally
  • Elasticsearch enabled for namespace
  • Fields supported
  • Migration completed ← NEW safety check

This ensures CE code remains clean while the EE-specific migration check gates all Elasticsearch usage.

Test Coverage

  • CE specs: Tests for WorkItemsResolver#choose_finder - validates correct delegation to advanced finder
  • EE specs: Tests for WorkItemsFinder#use_elasticsearch_finder? - validates migration check gates ES usage
  • Covers both "migration complete" and "migration incomplete" scenarios
  • Tests verify fallback to PostgreSQL when migration is not ready

Benefits

  • Broader rollout: GLQL search features available to beta users
  • Data consistency: Prevents ES queries before labels are reindexed
  • System reliability: Avoids query failures from incomplete indexing
  • Clean architecture: Respects CE/EE boundaries, single source of truth for ES checks
  • Safety first: Falls back to PostgreSQL when migration is not ready

Testing

All new specs passing:

  • spec/graphql/resolvers/work_items_resolver_spec.rb - 42 examples, 0 failures
  • ee/spec/lib/ee/search/advanced_finders/work_items_finder_spec.rb - includes migration completion checks

Related to #527280

Changelog: changed

Edited by Dmitry Gruzd

Merge request reports

Loading