Draft: Only check index integrity when commit_count is > 0
What does this MR do and why?
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:
- repository exists
- repository is not empty
- repository has a commit_count > 0 (commit_count is run against the root_ref so it's only for the default branch)
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.
Screenshots or screen recordings
N/A
How to set up and validate locally
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.
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.
Merge request reports
Activity
changed milestone to %16.1
assigned to @terrichu
added 1 commit
- 33cb68fb - Only check blobs index when commit_count is > 0
- A deleted user
added backend label
2 Warnings a1c4be07: Commits that change 30 or more lines across at least 3 files should describe these changes in the commit body. For more information, take a look at our Commit message guidelines. featureaddition and featureenhancement merge requests normally have a documentation change. Consider adding a documentation update or confirming the documentation plan with the Technical Writer counterpart.
For more information, see:
- The Handbook page on merge request types.
- The definition of done documentation.
1 Message CHANGELOG missing: If you want to create a changelog entry for GitLab FOSS, add the
Changelog
trailer to the commit message you want to add to the changelog.If you want to create a changelog entry for GitLab EE, also add the
EE: true
trailer to your commit message.If this merge request doesn't need a CHANGELOG entry, feel free to ignore this message.
Reviewer roulette
Changes that require review have been detected!
Please refer to the table below for assigning reviewers and maintainers suggested by Danger in the specified category:
Category Reviewer Maintainer backend Siddharth Dungarwal (
@sdungarwal
) (UTC+5.5, 9.5 hours ahead of@terrichu
)Bojan Marjanović (
@bmarjanovic
) (UTC+2, 6 hours ahead of@terrichu
)To spread load more evenly across eligible reviewers, Danger has picked a candidate for each review slot, based on their timezone. Feel free to override these selections if you think someone else would be better-suited or use the GitLab Review Workload Dashboard to find other available reviewers.
To read more on how to use the reviewer roulette, please take a look at the Engineering workflow and code review guidelines. Please consider assigning a reviewer or maintainer who is a domain expert in the area of the merge request.
Once you've decided who will review this merge request, assign them as a reviewer! Danger does not automatically notify them for you.
If needed, you can retry the
danger-review
job that generated this comment.Generated by
DangerAllure report
allure-report-publisher
generated test report!e2e-test-on-gdk:
test report for a1c4be07expand test summary
+-----------------------------------------------------------------------+ | suites summary | +------------------+--------+--------+---------+-------+-------+--------+ | | passed | failed | skipped | flaky | total | result | +------------------+--------+--------+---------+-------+-------+--------+ | Data Stores | 2 | 0 | 0 | 1 | 2 | ❗ | | Create | 8 | 0 | 1 | 0 | 9 | ✅ | | Plan | 4 | 0 | 0 | 0 | 4 | ✅ | | Manage | 1 | 0 | 0 | 0 | 1 | ✅ | | Monitor | 4 | 0 | 0 | 0 | 4 | ✅ | | Govern | 2 | 0 | 0 | 0 | 2 | ✅ | | Framework sanity | 0 | 0 | 1 | 0 | 1 | ➖ | +------------------+--------+--------+---------+-------+-------+--------+ | Total | 21 | 0 | 2 | 1 | 23 | ❗ | +------------------+--------+--------+---------+-------+-------+--------+
removed customer label
removed Next1-3 releases label
added 1 commit
- a1c4be07 - Refactor when index integrity is checked for a project
1081 1081 end 1082 1082 1083 1083 def should_check_index_integrity? 1084 use_elasticsearch? && repository_exists? && !empty_repo? 1084 use_elasticsearch? && !empty_repo? && statistics&.commit_count.to_i > 0