Skip to content

[github] Add CODEOWNERS sync support (#67)#127

Merged
coisa merged 7 commits intomainfrom
codex/67-codeowners-sync
Apr 20, 2026
Merged

[github] Add CODEOWNERS sync support (#67)#127
coisa merged 7 commits intomainfrom
codex/67-codeowners-sync

Conversation

@coisa
Copy link
Copy Markdown
Contributor

@coisa coisa commented Apr 19, 2026

Related Issue

Closes #67

Motivation / Context

  • consumer repositories can already sync workflows, git metadata, funding, hooks, and packaged skills, but they still have to author .github/CODEOWNERS by hand
  • a static packaged CODEOWNERS file would leak the maintainers of this repository into downstream consumers
  • this PR keeps the sync flow useful without hard-coding repository-specific owners into every consumer

Changes

  • add a dedicated codeowners command that generates .github/CODEOWNERS from local composer.json metadata
  • infer GitHub handles from author homepages, fall back to commented suggestions from support metadata, and prompt for owners in --interactive mode when inference is insufficient
  • run codeowners from dev-tools:sync and document CODEOWNERS among synchronized consumer assets
  • add focused PHPUnit coverage for the generator, the command, and the sync orchestration path

Verification

  • composer dev-tools
  • Focused command(s):
    • ./vendor/bin/phpunit tests/CodeOwners/CodeOwnersGeneratorTest.php tests/Console/Command/CodeOwnersCommandTest.php tests/Console/Command/SyncCommandTest.php
    • composer dev-tools changelog:check
    • php bin/dev-tools codeowners --help
    • php bin/dev-tools codeowners --dry-run
    • git diff --check
  • Manual verification:
    • confirmed codeowners --dry-run reports the generated .github/CODEOWNERS diff without writing a file
    • confirmed sync documentation and README now describe CODEOWNERS as a generated managed resource

composer dev-tools was also run, but it still fails in this environment during the reports stage because child docs, tests, and metrics subprocesses attempt to open /dev/tty.

Documentation / Generated Output

  • README updated
  • docs/ updated
  • Generated or synchronized output reviewed

Changelog

  • Added a notable CHANGELOG.md entry

Reviewer Notes

  • the implementation intentionally does not copy a static CODEOWNERS file with real owners, because that would leak this repository's ownership rules into consumer repositories
  • when author metadata is not explicit enough, the generated file stays safe by default and --interactive provides a direct path to populate the catch-all rule

@github-actions github-actions Bot added the enhancement New feature or request label Apr 19, 2026
github-actions Bot added a commit that referenced this pull request Apr 19, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 19, 2026

@coisa coisa force-pushed the codex/67-codeowners-sync branch from adb4024 to af56b86 Compare April 20, 2026 00:04
github-actions Bot added a commit that referenced this pull request Apr 20, 2026
@coisa coisa force-pushed the codex/67-codeowners-sync branch from 69320f3 to 5a09f6c Compare April 20, 2026 00:07
github-actions Bot added a commit that referenced this pull request Apr 20, 2026
@coisa coisa force-pushed the codex/67-codeowners-sync branch from abb4aa1 to 14353c2 Compare April 20, 2026 00:10
github-actions Bot added a commit that referenced this pull request Apr 20, 2026
@coisa coisa force-pushed the codex/67-codeowners-sync branch from 97fcfdb to eda666a Compare April 20, 2026 00:11
github-actions Bot added a commit that referenced this pull request Apr 20, 2026
@coisa coisa force-pushed the codex/67-codeowners-sync branch from 74bacda to fa898e6 Compare April 20, 2026 00:15
@coisa coisa merged commit a04e511 into main Apr 20, 2026
1 check passed
@coisa coisa deleted the codex/67-codeowners-sync branch April 20, 2026 00:16
github-actions Bot added a commit that referenced this pull request Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Released

Development

Successfully merging this pull request may close these issues.

Add CODEOWNERS support to dev-tools sync

1 participant