Summary
We propose adding a new configuration flag (e.g., allow_unowned_files: true) to config/code_ownership.yml.
This flag would allow the gem to run successfully even if some files do not have an owner, without interfering with other ownership mechanisms like File-Annotation Based Ownership (# @team MyTeam).
Problem: Current Workaround Conflicts with Annotations
Our team does not enforce 100% code ownership coverage. We only assign owners to critical files, and most of our files are intentionally left unowned.
To prevent code_ownership from failing, we tried setting unowned_globs to cover all files:
# config/code_ownership.yml
unowned_globs:
- '**/*'
This successfully prevents errors about unowned files.
However, we discovered that setting unowned_globs: ['**/*'] appears to disable File-Annotation Based Ownership. Files that have a # @team MyTeam annotation are no longer recognized as being owned by that team (presumably because unowned_globs takes precedence and stops further processing).
Desired Behavior
We want to achieve two goals at the same time:
- Allow unowned files: The build should not fail if many files have no owner assigned.
- Respect file annotations: Files that do have a
# @team MyTeam annotation should still be correctly recognized and owned by that team.
Proposed Solution
We suggest adding a new boolean flag to config/code_ownership.yml, such as allow_unowned_files:
# config/code_ownership.yml
allow_unowned_files: true
# We would remove the unowned_globs: ['**/*']
How this flag would work:
- When
allow_unowned_files: true, code_ownership would not raise an error if it finds files that have no owner (from any source: owned_globs, package_owners, or annotations).
- However, it would still process all files to identify owners for files that do have annotations or match other rules.
This would allow teams like ours to use code_ownership to manage owners for the files we care about, without being forced to achieve 100% coverage.
Thank you for considering this feature!
Summary
We propose adding a new configuration flag (e.g.,
allow_unowned_files: true) toconfig/code_ownership.yml.This flag would allow the gem to run successfully even if some files do not have an owner, without interfering with other ownership mechanisms like File-Annotation Based Ownership (
# @team MyTeam).Problem: Current Workaround Conflicts with Annotations
Our team does not enforce 100% code ownership coverage. We only assign owners to critical files, and most of our files are intentionally left unowned.
To prevent
code_ownershipfrom failing, we tried settingunowned_globsto cover all files:This successfully prevents errors about unowned files.
However, we discovered that setting
unowned_globs: ['**/*']appears to disable File-Annotation Based Ownership. Files that have a# @team MyTeamannotation are no longer recognized as being owned by that team (presumably becauseunowned_globstakes precedence and stops further processing).Desired Behavior
We want to achieve two goals at the same time:
# @team MyTeamannotation should still be correctly recognized and owned by that team.Proposed Solution
We suggest adding a new boolean flag to
config/code_ownership.yml, such asallow_unowned_files:How this flag would work:
allow_unowned_files: true,code_ownershipwould not raise an error if it finds files that have no owner (from any source:owned_globs,package_owners, or annotations).This would allow teams like ours to use
code_ownershipto manage owners for the files we care about, without being forced to achieve 100% coverage.Thank you for considering this feature!