Backend merge requests milestone facet: introduce new document field

Introduce new field and populate for new or updated data

field name pulled from &9937 (closed)

  1. introduce an Advanced search migration to add a new field to the merge requests mappings named milestone_id with type of integer.
  2. In MergeRequestInstanceProxy populate milestone_id and bump the schema_version (format is YY_MM)
  • Note: the milestone_id field should only be populated once the migration above is complete. You can use ::Elastic::DataMigrationService.migration_has_finished? to check
  1. add milestone to preload_indexing_data in MergeRequestClassProxy

  2. update the 'does not have N+1 queries for merge_requests' spec for merge request indexing to add different milestones to the merge requests created for testing N+1 in indexing

  3. update the spec for testing as_indexed_json.

  • add milestone_id to the main 'returns json with all needed elements' test
  • add a spec to make sure milestone_id is not populated if the migration is not complete (example spec)
Edited by Terri Chu