Add migrations_should_finish on elastic_index_dependant_association
What does this MR do and why?
This MR adds a dependency migrations_should_finish on elastic_index_dependant_association. We can pass an array of the migrations which we should be completed before indexing the association. If we don't pass anything it will neglect this dependency.
Screenshots or screen recordings
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- In the file ee/app/models/ee/project.rbedit the lineelastic_index_dependant_association :notes, on_change: :visibility_leveltoelastic_index_dependant_association :notes, on_change: :visibility_level, migrations_should_finish: ['abc']
- Open the rails console
bundle exec rails c- Open the sidekiqon terminal
sidekiq- Set a new visibility_levelfor any project on the rails console
Project.first.update visibility_level: 10- Verify on the sidekiqterminal thatElasticAssociationIndexerWorkeris called only forissuesandmerge_requestnot fornotes
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
- 
I have evaluated the MR acceptance checklist for this MR. 
Related to #393486 (closed)
Edited  by Ravi Kumar