Skip to content

WorkItem Elastic reference

Madelein van Niekerk requested to merge 457724-workitems-reference into master

What does this MR do and why?

Adds a new Elastic Reference and a new index for WorkItems.

  • ee/elastic/migrate/20240501134252_create_work_items_index.rb creates the index using the mappings and settings in ee/lib/search/elastic/types/work_item.rb
    • ee/lib/gitlab/elastic/helper.rb is updated to look for a definition in ee/lib/search/elastic/types/, otherwise fallback to the proxies.
  • ee/lib/search/elastic/references/work_item.rb creates the reference for work items.
    • If the feature flag is enabled, a record will be added to the WorkItems index, otherwise to the Issues index
  • I copied safely_read_attribute_for_elasticsearch(target, attr_name) from InstanceProxyUtil so we can use it for as_indexed_json

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist.

How to set up and validate locally

  1. Run the migration to create the index: Elastic::MigrationWorker.new.perform
  2. Create/update/delete a work item
  3. Perform bulk indexing: Elastic::ProcessBookkeepingService.new.execute
  4. Note that the index was created with the correct mappings and settings, and that work items were indexed

Related to #457724 (closed) and #454046 (closed)

Edited by Siddharth Dungarwal

Merge request reports