-
Notifications
You must be signed in to change notification settings - Fork 76
Description
Description
When creating a dashboard in our repo and using a rule like
file:has.owner(Glovo/growth-martech-ios)I’m seeing files being reported under this owner even though they should belong to a different one according to the CODEOWNERS configuration.
Here’s a simplified excerpt from our CODEOWNERS file:
/GlovoCustomer/Classes/AppServices/Services/IncomingActionsService/ @Glovo/growth-martech-ios @Glovo/growth-ios
/GlovoCustomer/Classes/AppServices/Services/IncomingActionsService/Adjust/ @Glovo/growth-martech-ios @Glovo/growth-ios
/GlovoCustomer/Classes/AppServices/Services/IncomingActionsService/IncomingActions/Deeplinks/Donations @Glovo/spike-ios
/GlovoCustomer/Classes/AppServices/Services/IncomingActionsService/IncomingActions/Deeplinks/LegacyPromotionAppliedAlertView @Glovo/growth-discounts-experience-ios @Glovo/growth-ios
/GlovoCustomer/Classes/AppServices/Services/IncomingActionsService/IncomingActions/Deeplinks/PromotionAppliedAlertView @Glovo/growth-discounts-experience-ios @Glovo/growth-ios
/GlovoCustomer/Classes/AppServices/Services/IncomingActionsService/IncomingActions/Deeplinks/Social @Glovo/trex-ios @Glovo/ordering-ios
/GlovoCustomer/Classes/AppServices/Services/IncomingActionsService/IncomingActions/Notifications/OrderNotificationHandlers @Glovo/contact-ios
/GlovoCustomer/Classes/AppServices/Services/IncomingActionsService/IncomingActions/Notifications/Prime @Glovo/growth-loyalty-ios @Glovo/growth-iosAs shown above, the parent folder (IncomingActionsService/) is assigned to @Glovo/growth-martech-ios, but the subfolder PromotionAppliedAlertView is explicitly assigned to @Glovo/growth-discounts-experience-ios.
However, in the dashboard results, the file
/GlovoCustomer/Classes/AppServices/Services/IncomingActionsService/IncomingActions/Deeplinks/PromotionAppliedAlertView/PromotionAppliedAlertViewController.swift
is being reported as owned by @Glovo/growth-martech-ios instead of @Glovo/growth-discounts-experience-ios.
According to the documentation, "Rules farther down the file take precedence", so the ownership should be inherited from the more specific rule — in this case, PromotionAppliedAlertView.
It seems that Sourcegraph is ignoring this precedence rule when evaluating CODEOWNERS for dashboards or the file:has.owner() filter.
Steps to reproduce
- Create a dashboard using:
file:has.owner(Glovo/growth-martech-ios)
- Include a CODEOWNERS file where a parent directory is owned by team A and a subdirectory by team B
- Observe that files under the subdirectory are reported as owned by team A instead of team B
Expected behavior
Files should be attributed to the most specific matching rule, consistent with GitHub’s CODEOWNERS precedence rules.
Actual behavior
Files under more specific paths are incorrectly reported as belonging to a higher-level owner.
Environment
- Sourcegraph version: 6.9.902
- Repository: Private internal repository
- Query used:
file:has.owner(Glovo/growth-martech-ios)