Investigate how Code Owners interacts with suggestions
From !34149 (comment 370946525)
Are suggestions passing through code owner validations? Should they? The suggestion itself is a commit targeting the source branch, but what if the source branch is a protected branch with code owners enabled? What would/should happen in that case?
🤔
We check if the user can apply in the
SuggestionEntity
and when applying suggestions as well. TheSuggestionPolicy
usesGitlab::UserAccess#can_push_to_branch?
to determine that. I don't think that part uses code owners at all. This seems an area for improvement. WDYT?🙂 When applying a suggestion though, it creates a commit, that will go through the usual checks in pre-receive hook and that will involve code owner validation via
Gitlab::Checks::DiffCheck
.
-
confirm the UX of applying a suggestion when the source branch is code owner-enabled and the change would match a rule -
explore if checking for Code Owner violations is useful when applying suggestions