Draft: Only check index integrity when commit_count is > 0
1 unresolved thread
1 unresolved thread
Compare changes
Files
3+ 1
− 1
Related to #214601 (closed)
We introduced index integrity check and when reviewing kibana logs, I suspect that the index integrity check is not using the repository methods correctly.
Advanced Search only indexes the default branch, so we should only check projects when:
This change adds the commit_count
check. The commit_count
method checks that a root_ref exists, and gets a commit_count for the root_ref
(Default branch). This should ensure that in most cases there are files in the repository for the default branch. I also removed the call to repository.exists?
since repository.empty?
checks that the repository exists, so we don't need to call that twice.
N/A
I'm not sure how to setup a non-empty repository with a default branch that is empty and has no commits, but you can setup empty branches.
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.