WorkItem Elastic reference
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 inee/lib/search/elastic/types/work_item.rb
-
ee/lib/gitlab/elastic/helper.rb
is updated to look for a definition inee/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)
fromInstanceProxyUtil
so we can use it foras_indexed_json
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist.
How to set up and validate locally
- Run the migration to create the index:
Elastic::MigrationWorker.new.perform
- Create/update/delete a work item
- Perform bulk indexing:
Elastic::ProcessBookkeepingService.new.execute
- 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