Skip to content

Use namespace to generate traversal_id in note index

What does this MR do and why?

I made this change after a discussion on the previous MR because the namespace should have been used instead of the project to generate the traversal_id field. I changed the SCHEMA_VERSION to make sure any new records that have been updated will be re-updated during the backfill. The backfill MR is dependent on this MR being merged.

AI Summary

This change updates how notes (comments) are indexed in Elasticsearch. The main modification is that traversal IDs (used for hierarchical searching) are now retrieved from the note's namespace instead of the project. This allows for more accurate searching across the GitLab hierarchy. The code also increments the schema version from 25_22 to 25_23 to reflect this structural change, and removes a project existence check since it's no longer needed. Additionally, the test file was updated to match this new behavior and its table formatting was improved for better readability.

References

Screenshots or screen recordings

Before After

How to set up and validate locally

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Terri Chu

Merge request reports

Loading