Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adds support for user-less rules in sections with default owners #213

Merged
merged 5 commits into from
Jun 4, 2024

Conversation

sverweij
Copy link
Owner

@sverweij sverweij commented Jun 4, 2024

Description

  • adds support for user-less rules in sections with default owners in the parser
  • adds support for 'inherited' default owners in the labeler generator
  • refactors the (virtual) codeowners parser a bit to make it easier to maintain
  • drive-by: removes the src/virtual-code-owners/virtual-teams.schema.ts. It's used nowhere now the validations are done by ryo instead of by ajv.

Motivation and Context

In GitLab CODEOWNERS it's possible to assign default owners in sections, and put no owners in rules in that section:

[some section] @team-gitlab @maintainers
src/important-stuff
tools/
.gitlab/

The rules src/important-stuff, tools/ and .gitlab will then 'inherit' the
owners declared in the section heading (in this case @team-gitlab and @maintainers).

Before this PR these rules would be labeled as unknown rules and treated as erroneous lines. After this PR they're treated as 'normal' rules, but with inherited users.

I haven't seen this in the GitHub documentation yet, but CODEOWNER files that use this construct aren't flagged as illegal either, so it might already work and/ or be a future feature there.

How Has This Been Tested?

  • green ci
  • additional and updated automated non-regression tests

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Documentation only change
  • Refactor (non-breaking change which fixes an issue without changing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • 📖

    • My change doesn't require a documentation update, or ...
    • it does and I have updated it
  • ⚖️

    • The contribution will be subject to The MIT license, and I'm OK with that.
    • The contribution is my own original work.
    • I am ok with the stuff in CONTRIBUTING.md.

@github-actions github-actions bot added documentation Improvements or additions to documentation vco labels Jun 4, 2024
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@sverweij sverweij requested a review from McMeadow June 4, 2024 11:26
McMeadow
McMeadow previously approved these changes Jun 4, 2024
@sverweij sverweij merged commit f7d1946 into main Jun 4, 2024
7 checks passed
@sverweij sverweij deleted the feature/adds-support-for-user-less-rules-in-sections branch June 4, 2024 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation vco
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants