Skip to content

Feature Request: Add a flag to allow unowned files without disabling file annotations #140

@euglena1215

Description

@euglena1215

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:

  1. Allow unowned files: The build should not fail if many files have no owner assigned.
  2. 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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestquestionFurther information is requested

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    Up for grabs

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions