Elastic rake tasks projects_not_indexed and index_projects_status could be confusing
What does this MR do and why?
This change improves how the system handles search indexing for empty code repositories. When a new project is created without any code files, the system now automatically triggers a background CommitIndexerWorker to create an IndexStatus record. The change also updates test files to use consistent formatting (switching from double quotes to single quotes) and adds new tests to verify that the empty repository handling works correctly. Additionally, one test file was removed from a list of files that need code style fixes, indicating it now follows proper formatting standards.
References
Screenshots or screen recordings
| Before | After |
|---|---|
How to set up and validate locally
- Create an empty repo project.
- Run these elastic rake tasks
gitlab:elastic:projects_not_indexedandgitlab:elastic:index_projects_status
bundle exec rake gitlab:elastic:projects_not_indexed
bundle exec rake gitlab:elastic:index_projects_status
- On
master, you will get a message that indexing is incomplete because empty projects are not considered as indexed - On the MR branch, you will see that indexing is completed.
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.
Related to #574758 (closed)