-
Notifications
You must be signed in to change notification settings - Fork 26
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
Support negation globs #116
Comments
It seems this may be more a limitation of |
Hi @mscrivo! Thanks for filing this issue. You're correct, currently |
This is trickier than I thought. Making it so that it understands EDIT: Actually, I think what we need to do is for any overlapping globs where one team owns it and another team has it in the unowned_globs, we need to make sure the glob for the team that owns it comes, comes last. For example, say you have: name: Bar
owned_globs:
- app/services/bar_stuff/**/**
- '**/team_thing/**/*'
unowned_globs:
- shared/**/team_thing/**/* and name: Foo
owned_globs:
- shared/**/* Then the CODEOWNERS should look like this: app/services/bar_stuff/**/** @bar
**/team_thing/**/* @bar
# needs to come last to take precedence
shared/**/* @foo with this, team bar would own: |
Digging more into this, it seems that CODEOWNERS entries are already sorted by least specific to most specific paths, so we may be able to make the assumption that if you have an unowned_glob defined on a team, you're doing it because both of these are true:
If those assumptions hold, then we don't have to change any logic for the CODEOWNERS generation. Or even if they may not, we can add a validation error an unowned_glob that is less specific then it's owned counterpart? @ashleywillard does that make sense to you? btw I have a PR in progress here |
Negation globs seemingly don't work. For example, I can't do something like this:
to say that I want this team to own any folder that has a "sourcing" subfolder in the path, but not within any "workspaces" folders.
This works just fine when tested with
compgen
.code_ownership
doesn't seem to throw an error when validating, but when checking a path that should be owned under that glob, saylib/sourcing/some_file.rb
, it incorrect states that it's not owned. Interestingly, it still correctly updates theCODEOWNERS
file with the negation glob.So now, instead of having single glob that covers most of this team's ownership, I will have to explicitly map out each folder instead.
The text was updated successfully, but these errors were encountered: