Skip to content

Fix selective code owner removals race condition

Lee Tickett requested to merge 344632-fix-codeowner-removal-race-condition into master

What does this MR do and why?

Fixes a race condition which causes codeowner approvals to not be removed when they should be.

Screenshots or screen recordings

Before

After

How to set up and validate locally

  1. Create 6 users, ax1, ax2, bx1, bx2, cx1, cx2
  2. Create 3 groups, ax (with ax1 + ax2), bx (with bx1 + bc2), cx (with cx1 + cx2)
  3. Add ax, bx, cx groups as developers for a project
  4. Enable selective codeowner removals for the same project
  5. Create a codeowners file like:
    /ax/ @ax
    /bx/ @bx
    /cx/ @cx
    /ab/ @ax @bx
    /bc/ @bx @cx
    /ca/ @cx @ax
    And an empty file in each folder /ax, /bx etc...
  6. Create a new branch and merge request editing the file in /ax as root
  7. Approve the merge request as ax1
  8. Edit each of the other files as root

In master you will find 3 rules approved incorrectly.

In this branch you should find no approvals remain.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #344632 (closed)

Edited by Lee Tickett

Merge request reports