Use object exist check for codeowners file
What does this MR do and why?
This MR uses a faster lookup to determine if a project uses
CODEOWNERS
file in the devops adoption report feature. The change is
behind the use_faster_code_owner_file_exist_check
a feature flag.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
How to set up and validate locally
Recording codeowners usage count (project count) should work as before. You can verify it by executing the following steps:
-
Ensure you're on ultimate plan and enable the feature flag
Feature.enable(:use_faster_code_owner_file_exist_check)
-
Create a new group and visit
Analytics > DevOps Adoption
(this create the enabled namespace record) -
Create a project
-
Add a new file named
CODEOWNERS
with some random content -
Start rails console and run:
enabled_namespace = Analytics::DevopsAdoption::EnabledNamespace.last range_end = Date.today Analytics::DevopsAdoption::Snapshots::CalculateAndSaveService.new(enabled_namespace: enabled_namespace, range_end: range_end).execute
-
Notice the
code_owners_used_count: 1
value. It should show 1.
Related to #394831 (closed)