Skip to content

Fix the lingering outdated codeowner rules issue

What does this MR do and why?

Fix the lingering outdated codeowner rules issue

When a sectional codeowner rule had the same pattern as the default codeowner rule, default code owner rule was not being removed even if it was no longer applicable.

We fix that by using approval rule id instead of just relying on the pattern.

Database query plans

Before(with not_matching_pattern)

https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/25838/commands/81409

After(with not_matching_id)

https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/25838/commands/81408

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

  1. Set up codeowner rules to something like below in the target branch
* @user1
README.md @user2

[Doc section]
* @user3
  1. Create MR by updating README.md. At this point, only the README.md and [Doc section] CODEOWNER rules are showing up.
  2. Add a new file TEST.md to the source branch of the MR. At this point, * CODEOWNER rule is also showing up.
  3. Add TEST.md to the target branch with the same content as the one in the MR.
  4. Check MR approval rules. At this point, the * CODEOWNER rule should not be showing up anymore.

Related to #427214 (closed)

Edited by Sincheol (David) Kim

Merge request reports