Replace the glob-based CODEOWNERS parser with regex-based#5063
Merged
konrad-jamrozik merged 9 commits intomainfrom Jan 9, 2023
Merged
Replace the glob-based CODEOWNERS parser with regex-based#5063konrad-jamrozik merged 9 commits intomainfrom
konrad-jamrozik merged 9 commits intomainfrom
Conversation
ebfff5f to
9e188b1
Compare
9e188b1 to
cdfb8b1
Compare
weshaggard
reviewed
Jan 6, 2023
weshaggard
reviewed
Jan 6, 2023
tools/code-owners-parser/CodeOwnersParser/MatchedCodeOwnerEntry.cs
Outdated
Show resolved
Hide resolved
weshaggard
reviewed
Jan 6, 2023
weshaggard
reviewed
Jan 6, 2023
tools/code-owners-parser/CodeOwnersParser/MatchedCodeOwnerEntry.cs
Outdated
Show resolved
Hide resolved
weshaggard
approved these changes
Jan 6, 2023
Member
weshaggard
left a comment
There was a problem hiding this comment.
Except for removing the PackageReference I think we can move my other questions to your main PR. So after removing that reference go ahead and merge this.
cdfb8b1 to
5102e0e
Compare
5aaa156 to
5d55bb5
Compare
225892d to
62f1269
Compare
62f1269 to
ee2a4e1
Compare
added 2 commits
January 8, 2023 19:02
3a4fe53 to
98dbf7d
Compare
This was referenced Jan 9, 2023
weshaggard
reviewed
Jan 10, 2023
tools/code-owners-parser/CodeOwnersParser/Azure.Sdk.Tools.CodeOwnersParser.csproj
Show resolved
Hide resolved
ghost
pushed a commit
that referenced
this pull request
Jan 14, 2023
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is a follow-up to:
CODEOWNERSfile parser (disabled, behind a feature flag) #5030It addresses:
It rewrites the new parser logic to match the rules as outlined in:
The new parser now supports diagnostic logging via
Microsoft.Extensions.Logging.Console. To make this work, I took a dependency on this package, version7.0.0, and updated that package andMicrosoft.Extensions.Loggingto7.0.0in the code that usesCodeOwnersParseras dependency, to avoid the "package version downgrade detected" build failure.