I'm using the Bitbucket Cloud addon from Mibex Software, and have a CODEOWNERS file in the root of my repo.
I have some merge checks defined for a custom group `@@merge-check-group` which is the owner of one directory path, and the rest of the repo has a different owner `@@no-check-group`
When I push a change to a file owned by the `@@no-check-group` I am still seeing the merge checks being applied and blocking my PR until they are satisfied.
My codeowners looks as below:
# Define single owner groups to avoid _requiring_ approval ALL from these owners
# on every PR but allow them to be relied on as additional approvers for merge checks
@@@steve-d @"Steve D"
@@@steve-k @"Steve K"
@@@thomas @Thomas
# NOTE: bitbucket-repo-admin includes Thomas and Steve D
# from above but not Steve K or Chinh
# Define merge check and no check groups
@@@merge-check-group @@bitbucket-repo-admin @"Steve K" @Chinh
@@@no-check-group @@merge-check-group
# Most files in the repo don't need a merge check from code owners
# we rely on bitbucket built-in merge checks for those.
# The no check group mirrors the merge check group, but simply has no check
# rules defined further down, unlike the merge check group.
* @@no-check-group
# Gitops path requires merge checks to pass
gitops/ @@merge-check-group @@thomas @@steve-k
gitops/**/goff*/ @@merge-check-group @@thomas @@steve-d @@steve-k
# EITHER: 2 approvals from the merge check group,
# OR: one approval from there
# AND an approval from either Thomas and Steve D, or Thomas and Steve K, or
# Steve D and Steve K
# This is intended to be a merge check on the goff path above
(Check(@@merge-check-group >= 2) | (Check(@@merge-check-group >= 1) & ((Check(@@thomas >= 1) & Check(@@steve-d >= 1)) | (Check(@@thomas >= 1) & Check(@@steve-k >= 1)) | (Check(@@steve-d >= 1) & Check(@@steve-k >= 1)))))
# EITHER: 2 approvals from the merge check group,
# OR: one approval from there
# AND an approval from either Thomas or Steve K
# This is intended to be a merge check on the rest of the gitops path above
(Check(@@merge-check-group >= 2) | (Check(@@merge-check-group >= 1) & (Check(@@thomas >= 1) | Check(@@steve-k >= 1))))