Gate commit traversal_ids behind AddTraversalIdsToCommits migration
What does this MR do and why?
Pass --commit-traversal-ids-enabled to gitlab-elasticsearch-indexer
only after the AddTraversalIdsToCommits mapping migration has finished.
Until that migration completes, the commits index does not have a
traversal_ids field in its mapping. Because GitLab Advanced Search uses
strict mapping, Elasticsearch/OpenSearch rejects any commit document that
includes an unmapped field, causing all commit indexing to fail with a
strict_dynamic_mapping_exception.
The Go indexer already conditionally writes traversal_ids onto commit
documents when the flag value is non-empty. This MR adds the gate on the
Ruby side so the flag is only passed once the mapping is ready.
References
- Issue: #599628 (closed)
- Mapping migration:
ee/elastic/migrate/20260216152309_add_traversal_ids_to_commits.rb - Backfill migration:
ee/elastic/migrate/20260216153009_backfill_traversal_ids_on_commits.rb
Screenshots or screen recordings
N/A — backend only change.
How to set up and validate locally
- Ensure
AddTraversalIdsToCommitsmigration has not finished. - Push to a repository with Advanced Search enabled.
- Confirm no
strict_dynamic_mapping_exceptionerrors in the indexer logs. - Mark the migration as finished and re-index — confirm
traversal_idsis now written to commit documents.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist.