-
Notifications
You must be signed in to change notification settings - Fork 183
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
Enable the new, regex-based, wildcard-supporting CODEOWNERS matcher #5088
Conversation
@weshaggard as I mentioned in this PR description - a review of the listed CODEOWNERS files is necessary, to see how support of wildcards changes the owners. Could you provide me with guidance what algorithm I should apply here? Should I reach out first to all the folks who will now start getting ADO notifications for build failures because of wildcards now matching, and ask them if they want to opt out before I deploy this change? Or maybe I should comment out all wildcard-supporting paths and ask the assigned owners to let me know if I should uncomment them? Due to wildcards now matching possibly some set of people will stop getting notifications, but I think figuring this set out would be a lot of work, so I am not sure if I should try to do it. I would have to check if each wildcard path would match against any path listed above it, and if so, if there is at least one file matching both these paths, and if so, if the owners are different, and if so, if the owner change is in fact a problem. Thanks! |
My biggest concern is the **/ci.yml and **/test.yml patterns that are setup at the bottom of the files which point to engsys folks. That is going to cause all pipeline notifications to come to those folks instead of the service teams which is not what we want to happen. I suggest we simply remove those patterns from the Codeowners files. I would suggest doing a test where you look at the owners of all the *.yml files in the repo before and after your changes and compare the results to see what changed. Might consider that for any other patterns you see in the codeowners where ** patterns exist. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't want this merged until we verify the yml file mappings as I believe this will break all our notification mappings.
@weshaggard OK, cool. I am going to make all the tests as you proposed. My plan is to augment the I will then run this tool with the old and new parser and report here the ownership diff here. |
…r all paths matching given glob path. (#5134) This PR implements for the `retrieve-codeowners` tool the ability to return not only owners for a single path, but a list of all owners for all paths resolved when matching a glob path given as input. As such, this PR contributes to: - #5135 This work is necessary to be able to compare and diff the owners of all files in repository before and after the regex matcher is turned on, per this comment: - #5088 (review) In other words, this PR contributes to unblocking to the following PR: - #5088 And as such, also contributes to: - #2770 This PR will require some upstream changes, which are captured by: - #5103 ### Additional changes - Removed logger from `CodeOwnersParser`; replaced with `Console.Out` and `Console.Error`. This addresses the following comment: - #5063 (comment) - Prevented the new regex matcher from matching paths that have `*` in them - such paths are malformed anyway (at least on Windows). - A lot of assorted changes to surrounding production & test code - please see the file diff for details. ### Implementation notes This PR leverages [`Microsoft.Extensions.FileSystemGlobbing`](https://www.nuget.org/packages/Microsoft.Extensions.FileSystemGlobbing). Doc: https://learn.microsoft.com/en-us/dotnet/core/extensions/file-globbing
I have confirmed that commenting out the following lines in
results in exactly the same owners being matched using the new regex matcher as the obsolete prefix-based matcher. I'll add more details here and link to the tool I used a bit later. |
I think it is fine to remove the **/*.yml entries for engsys but we should talk with the mgmt folks about those before we remove them. We could also consider moving some of these wildcard entries to the top of the file so they will still catch anything missed but allow the more specific paths to override. |
@weshaggard the diff is actually more complex, as I discovered when working on: Sorry about the confusion. I think dealing with paths having wildcards in them is a bit tricky: if I move the rules around, it will change the owners as interpreted by GitHub itself. For the same reason I also cannot just comment-out all wildcard paths to allow graceful, gradual migration to the regex-based matcher. Not sure yet what is the best way to approach this. I could ask the affected folks to review the owners diff I get from #5165 and ask all of them if they are OK with getting the build failure notifications now. In the meantime I made this PR: Here is the full diff on the |
Looks like that diff still has the **/ci.yml and **/tests.yml paths in the codeowners file going to EngSys I know that is definitely going to be wrong so I would like to see a diff with those patterns removed. As for the mgmt codeowners entries I think it is probably safe to keep those and let the folks still be labeled as the owners for all the mgmt libraries. |
With our new approach we might also want to consider removing the /sdk/ pattern which was all about having the leads be the owners so they can push to get any missing owners figured out but once we get our pipeline setup we can have the pipeline identify new code paths that don't have owners. |
@weshaggard I added the diff you requested to the Excel diff, in the tab named
You mean only the the line with exactly Here is my thinking:
Re the removal of So, in a separate PR, I could remove Thoughts? |
db4062c
to
7f9973a
Compare
As part of ongoing work of enabling wildcard support for `CODEOWNERS`: - Azure/azure-sdk-tools#2770 - Azure/azure-sdk-tools#5088 and enabling stricter validation: - Azure/azure-sdk-tools#4859 this PR: - fixes invalid paths, to match rules explained [here](https://github.com/Azure/azure-sdk/blob/main/docs/policies/opensource.md#codeowners); - removes `/**/tests.yml` and `/**/ci.yml`, to avoid all build failure notifications being routed to it once we enable the new regex-based, wildcard-supporting `CODEOWNERS` matcher, per: Azure/azure-sdk-tools#5088 (comment) Once this PR is merged, I will enable the new `CODEOWNERS` matcher, similar to how it was done for `net` repo by these two PRs: - Azure/azure-sdk-tools#5241 - Azure/azure-sdk-tools#5240 Related PRs: - Similar PR fixing invalid paths, but for `net` repo: Azure/azure-sdk-for-net#33584 - Similar PR deprioritizing the Azure SDK EngSys team ownership, but for `python` repo: Azure/azure-sdk-for-python#28534
As part of ongoing work of enabling wildcard support for `CODEOWNERS`: - Azure/azure-sdk-tools#2770 - Azure/azure-sdk-tools#5088 and enabling stricter validation: - Azure/azure-sdk-tools#4859 this PR: - fixes invalid paths, to match rules explained [here](https://github.com/Azure/azure-sdk/blob/main/docs/policies/opensource.md#codeowners); - removes `/**/tests.yml` and `/**/ci.yml`, to avoid all build failure notifications being routed to it once we enable the new regex-based, wildcard-supporting `CODEOWNERS` matcher, per: Azure/azure-sdk-tools#5088 (comment) Once this PR is merged, I will enable the new `CODEOWNERS` matcher, similar to how it was done for `net` repo by these two PRs: - Azure/azure-sdk-tools#5241 - Azure/azure-sdk-tools#5240
As part of ongoing work of enabling wildcard support for `CODEOWNERS`: - Azure/azure-sdk-tools#2770 - Azure/azure-sdk-tools#5088 and enabling stricter validation: - Azure/azure-sdk-tools#4859 this PR: - fixes invalid paths, to match rules explained [here](https://github.com/Azure/azure-sdk/blob/main/docs/policies/opensource.md#codeowners); - removes `/**/tests.yml` and `/**/ci.yml`, to avoid all build failure notifications being routed to it once we enable the new regex-based, wildcard-supporting `CODEOWNERS` matcher, per: Azure/azure-sdk-tools#5088 (comment) Once this PR is merged, I will enable the new `CODEOWNERS` matcher, similar to how it was done for `net` repo by these two PRs: - Azure/azure-sdk-tools#5241 - Azure/azure-sdk-tools#5240
- Azure/azure-sdk-tools#5088 and enabling stricter validation: - Azure/azure-sdk-tools#4859 this PR: - fixes invalid paths, to match rules explained [here](https://github.com/Azure/azure-sdk/blob/main/docs/policies/opensource.md#codeowners); - removes `/**/tests.yml` and `/**/ci.yml`, to avoid all build failure notifications being routed to it once we enable the new regex-based, wildcard-supporting `CODEOWNERS` matcher, per: Azure/azure-sdk-tools#5088 (comment) Once this PR is merged, I will enable the new `CODEOWNERS` matcher, similar to how it was done for `net` repo by these two PRs: - Azure/azure-sdk-tools#5241 - Azure/azure-sdk-tools#5240
As part of ongoing work of enabling wildcard support for `CODEOWNERS`: - Azure/azure-sdk-tools#2770 - Azure/azure-sdk-tools#5088 and enabling stricter validation: - Azure/azure-sdk-tools#4859 this PR: - fixes invalid paths, to match rules explained [here](https://github.com/Azure/azure-sdk/blob/main/docs/policies/opensource.md#codeowners); - removes `/**/tests.yml` and `/**/ci.yml`, to avoid all build failure notifications being routed to it once we enable the new regex-based, wildcard-supporting `CODEOWNERS` matcher, per: Azure/azure-sdk-tools#5088 (comment) Once this PR is merged, I will enable the new `CODEOWNERS` matcher, similar to how it was done for `net` repo by these two PRs: - Azure/azure-sdk-tools#5241 - Azure/azure-sdk-tools#5240
As part of ongoing work of enabling wildcard support for `CODEOWNERS`: - Azure/azure-sdk-tools#2770 - Azure/azure-sdk-tools#5088 and enabling stricter validation: - Azure/azure-sdk-tools#4859 this PR: - fixes invalid paths, to match rules explained [here](https://github.com/Azure/azure-sdk/blob/main/docs/policies/opensource.md#codeowners); - removes `/**/tests.yml` and `/**/ci.yml`, to avoid all build failure notifications being routed to it once we enable the new regex-based, wildcard-supporting `CODEOWNERS` matcher, per: Azure/azure-sdk-tools#5088 (comment) Once this PR is merged, I will enable the new `CODEOWNERS` matcher, similar to how it was done for `net` repo by these two PRs: - Azure/azure-sdk-tools#5241 - Azure/azure-sdk-tools#5240
As part of ongoing work of enabling wildcard support for `CODEOWNERS`: - Azure/azure-sdk-tools#2770 - Azure/azure-sdk-tools#5088 and enabling stricter validation: - Azure/azure-sdk-tools#4859 this PR: - fixes invalid paths, to match rules explained [here](https://github.com/Azure/azure-sdk/blob/main/docs/policies/opensource.md#codeowners); - removes `/**/tests.yml` and `/**/ci.yml`, to avoid all build failure notifications being routed to it once we enable the new regex-based, wildcard-supporting `CODEOWNERS` matcher, per: Azure/azure-sdk-tools#5088 (comment) Once this PR is merged, I will enable the new `CODEOWNERS` matcher, similar to how it was done for `net` repo by these two PRs: - Azure/azure-sdk-tools#5241 - Azure/azure-sdk-tools#5240
@weshaggard I have updated all the I do have few outstanding questions about ownership, but I don't think they should be blocking. Here is the full list of unanswered questions:
|
As part of ongoing work of enabling wildcard support for `CODEOWNERS`: - Azure/azure-sdk-tools#2770 - Azure/azure-sdk-tools#5088 and enabling stricter validation: - Azure/azure-sdk-tools#4859 this PR: - fixes invalid paths, to match rules explained [here](https://github.com/Azure/azure-sdk/blob/main/docs/policies/opensource.md#codeowners); - removes `/**/tests.yml` and `/**/ci.yml`, to avoid all build failure notifications being routed to it once we enable the new regex-based, wildcard-supporting `CODEOWNERS` matcher, per: Azure/azure-sdk-tools#5088 (comment) Once this PR is merged, I will enable the new `CODEOWNERS` matcher, similar to how it was done for `net` repo by these two PRs: - Azure/azure-sdk-tools#5241 - Azure/azure-sdk-tools#5240
- Azure/azure-sdk-tools#5088 and enabling stricter validation: - Azure/azure-sdk-tools#4859 this PR: - fixes invalid paths, to match rules explained [here](https://github.com/Azure/azure-sdk/blob/main/docs/policies/opensource.md#codeowners); - removes `/**/tests.yml` and `/**/ci.yml`, to avoid all build failure notifications being routed to it once we enable the new regex-based, wildcard-supporting `CODEOWNERS` matcher, per: Azure/azure-sdk-tools#5088 (comment) Once this PR is merged, I will enable the new `CODEOWNERS` matcher, similar to how it was done for `net` repo by these two PRs: - Azure/azure-sdk-tools#5241 - Azure/azure-sdk-tools#5240
…e-reports.yml` path (#24841) For context, see: - #24621 (review) Related PR: - Azure/azure-sdk-tools#5088
As part of ongoing work of enabling wildcard support for `CODEOWNERS`: - Azure/azure-sdk-tools#2770 - Azure/azure-sdk-tools#5088 and enabling stricter validation: - Azure/azure-sdk-tools#4859 this PR: - fixes invalid paths, to match rules explained [here](https://github.com/Azure/azure-sdk/blob/main/docs/policies/opensource.md#codeowners); - removes `/**/tests.yml` and `/**/ci.yml`, to avoid all build failure notifications being routed to it once we enable the new regex-based, wildcard-supporting `CODEOWNERS` matcher, per: Azure/azure-sdk-tools#5088 (comment) Once this PR is merged, I will enable the new `CODEOWNERS` matcher, similar to how it was done for `net` repo by these two PRs: - Azure/azure-sdk-tools#5241 - Azure/azure-sdk-tools#5240
* Update `CODEOWNERS` paths: fix invalid paths As part of ongoing work of enabling wildcard support for `CODEOWNERS`: - Azure/azure-sdk-tools#2770 - Azure/azure-sdk-tools#5088 and enabling stricter validation: - Azure/azure-sdk-tools#4859 this PR: - fixes invalid paths, to match rules explained [here](https://github.com/Azure/azure-sdk/blob/main/docs/policies/opensource.md#codeowners); - removes `/**/tests.yml` and `/**/ci.yml`, to avoid all build failure notifications being routed to it once we enable the new regex-based, wildcard-supporting `CODEOWNERS` matcher, per: Azure/azure-sdk-tools#5088 (comment) Once this PR is merged, I will enable the new `CODEOWNERS` matcher, similar to how it was done for `net` repo by these two PRs: - Azure/azure-sdk-tools#5241 - Azure/azure-sdk-tools#5240 Related PRs: - Similar PR fixing invalid paths, but for `net` repo: Azure/azure-sdk-for-net#33584 - Similar PR deprioritizing the Azure SDK EngSys team ownership, but for `python` repo: Azure/azure-sdk-for-python#28534 * Update .github/CODEOWNERS Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com> --------- Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>
…ers` executable + add some tests; make assorted refactorings (#5103) This PR is part of work required in preparation to merge: - #5088 Specifically, to enable review of ownership changes due to upcoming wildcards support, as explained in: - #5088 (comment) As such, this PR contributes to: - #2770 This PR is a prerequisite for following PRs: - #5431 ### Merging prerequisite This PR can be merged only after the following PRs are merged and relevant NuGet package published - #5437 - #5104 This is because this PR depends on that NuGet package.
This PR enables the parser introduced in:
And as such, this PR contributes to:
Before a package published out of this PR is depended upon, a review of affected
CODEOWNERS
files is necessary, as explained inBehavior change of existing CODEOWNERS paths with wildcards
section of this comment:Full behavior difference between the old and new parser can be determined by comparing the two rightmost columns of this test battery.
This parser will be executed by the
automation - build-failure-notification-subscriptions
pipeline, once the package it depends on is published and updated, similar as it is done in this PR:RetrieveCodeOwners
,NotificationConfiguration
andPipelineOwnersExtractor
to most recent as of 1/8/2023 #5085As a result, the following
CODEOWNERS
files are expected to be affected, and thus require a review:Following files won't be affected, as they are not triggered by the pipeline, whose source is
notifications.yml
:In addition, following work needs to be implemented and applied to the CODEOWNERS files before we can enable support for wildcards:
Related work