ARCH-4643 Add CODEOWNERS allowlist mechanism#5
Merged
Conversation
Lets bot/service accounts (e.g. @collibra-cicd-auto-merge) be designated code-owners without violating the org-wide teams-only policy. The allowlist lives in scripts/codeowners-allowlist.txt and is loaded automatically by check-codeowners.sh. Override path via CODEOWNERS_ALLOWLIST_FILE for tests. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
daniel-landowski
approved these changes
May 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of your changes
Adds a maintainable allowlist mechanism to the org-wide team-only CODEOWNERS enforcement (
scripts/check-codeowners.sh), enabling specific bot/service accounts to be designated code-owners without violating the policy. Initial allowlist exempts@collibra-cicd-auto-merge, which is already used as a code-owner across ~20 active edge-family repos for auto-merge flows. Without this exemption, those repos would immediately fail the next PR once enforcement is enabled.Design
scripts/codeowners-allowlist.txt— one@usernameper line,#comments and blank lines ignored. Lives alongside the script in the.githuborg repo so consumer repos cannot ship their own (preserves the policy).check-codeowners.sh:load_allowlistandfilter_against_allowlist. Existingextract_individualsandfind_codeownersare untouched.main()resolves the allowlist viaCODEOWNERS_ALLOWLIST_FILEenv var (defaults to<script_dir>/codeowners-allowlist.txt), filters out exempt entries, and logs which exemptions actually matched in this run for CI transparency.main()integration scenarios. Mutation-tested (disabled the filter, watched integration tests fail) to confirm the new tests catch real behavior rather than incidental code paths.Audit context
A full org-wide audit of CODEOWNERS files was run before this change to identify violators. Results (active, non-archived repos): 491 with CODEOWNERS, 455 passing, 36 violating. Of the 36, 20 are the
@collibra-cicd-auto-mergebot (this allowlist resolves them), 2 are forks of upstream OSS where the CODEOWNERS file mirrors upstream, and 14 contain real human individuals that the respective teams will need to convert to team references before strict enforcement.JIRA reference
ARCH-4643
Impact Analysis
.github-shared/, not from the consumer repo.enforce-codeowners-teams.ymlalready loads the script from the.githuborg checkout;test-scripts.yml'sscripts/**path filter picks up the new file automatically.::error file=...and exits 1, matching prior behavior.Checklist
🤖 Generated with Claude Code