Skip to content

ARCH-4643 Add org-wide CODEOWNERS enforcement workflow#4

Open
NielsDoucet wants to merge 1 commit intomainfrom
feature/ARCH-4643
Open

ARCH-4643 Add org-wide CODEOWNERS enforcement workflow#4
NielsDoucet wants to merge 1 commit intomainfrom
feature/ARCH-4643

Conversation

@NielsDoucet
Copy link
Copy Markdown
Member

Description of your changes

Introduces an organisation-wide policy that disallows individual GitHub user accounts in CODEOWNERS files — only @collibra/<team> references (or no owner at all, to explicitly mark files as unowned) are permitted.

What's added:

  • org-workflows/enforce-codeowners-teams.yml — GitHub Actions Required Workflow that runs on every PR across the entire org. Checks out the target repo and runs the validation script. Must be registered under Org Settings → Actions → Required workflows pointing to collibra/.github/org-workflows/enforce-codeowners-teams.yml@main.
  • scripts/check-codeowners.sh — Shell script with two testable functions: find_codeowners (locates the CODEOWNERS file per GitHub's priority order) and extract_individuals (detects bare @username entries while ignoring teams, email addresses, comments, and pattern-only/no-owner lines).
  • scripts/check-codeowners.bats — 16 BATS unit tests covering all edge cases.
  • .github/workflows/test-scripts.yml — Repo-local workflow that runs the BATS suite on every push/PR touching scripts/.
  • README.md — Documents the purpose and structure of org-workflows/, .github/workflows/, and scripts/.

JIRA reference

ARCH-4643


Impact Analysis

The Required Workflow will need to be registered by an org admin after merge. Until registered it has no effect on other repositories. The check is non-destructive: it only fails PRs that introduce new individual-user CODEOWNERS entries. Repositories that already have individual entries will surface failures only on their next PR.


Checklist

  • I have performed a self-review of my code
  • My code follows the contribution guidelines of this project
  • My changes generate no new warnings

@NielsDoucet NielsDoucet requested a review from a team as a code owner April 27, 2026 14:40
Comment thread .github/workflows/test-scripts.yml Outdated
Comment thread .github/workflows/test-scripts.yml Outdated
Comment thread org-workflows/enforce-codeowners-teams.yml Outdated
Comment thread org-workflows/enforce-codeowners-teams.yml Outdated
Comment thread scripts/check-codeowners.sh
@NielsDoucet NielsDoucet force-pushed the feature/ARCH-4643 branch 3 times, most recently from 3de48a4 to 0b7ac0e Compare April 28, 2026 08:04
Introduces a Required Workflow (org-workflows/enforce-codeowners-teams.yml)
that blocks PRs across the entire organisation when CODEOWNERS entries name
individual GitHub users instead of @org/team references. Logic is extracted
to a testable shell script (scripts/check-codeowners.sh) with 16 BATS tests.
A repo-local workflow (.github/workflows/test-scripts.yml) runs the BATS suite
on changes to scripts/.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@NielsDoucet NielsDoucet requested a review from rathpc April 29, 2026 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants