-
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
Replace the glob-based CODEOWNERS parser with regex-based #5063
Merged
Conversation
This file contains 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
konrad-jamrozik
added
the
Central-EngSys
This issue is owned by the Engineering System team.
label
Jan 5, 2023
konrad-jamrozik
changed the title
Add regex-based support for wildcards in CODEOWNERS file parser (disabled, behind a feature flag)
Replace the glob-based CODEOWNERS parser with regex-based.
Jan 5, 2023
konrad-jamrozik
force-pushed
the
users/kojamroz/iss_2770_tests2
branch
from
January 5, 2023 16:10
ebfff5f
to
9e188b1
Compare
konrad-jamrozik
force-pushed
the
users/kojamroz/iss_2770_tests2
branch
from
January 5, 2023 22:25
9e188b1
to
cdfb8b1
Compare
konrad-jamrozik
changed the title
Replace the glob-based CODEOWNERS parser with regex-based.
Replace the glob-based CODEOWNERS parser with regex-based
Jan 6, 2023
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
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.
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.
konrad-jamrozik
force-pushed
the
users/kojamroz/iss_2770_tests2
branch
from
January 7, 2023 05:04
cdfb8b1
to
5102e0e
Compare
konrad-jamrozik
force-pushed
the
users/kojamroz/iss_2770_tests2
branch
from
January 7, 2023 14:30
5aaa156
to
5d55bb5
Compare
konrad-jamrozik
force-pushed
the
users/kojamroz/iss_2770_tests2
branch
2 times, most recently
from
January 7, 2023 15:14
225892d
to
62f1269
Compare
konrad-jamrozik
force-pushed
the
users/kojamroz/iss_2770_tests2
branch
from
January 7, 2023 15:15
62f1269
to
ee2a4e1
Compare
konrad-jamrozik
force-pushed
the
users/kojamroz/iss_2770_tests2
branch
from
January 9, 2023 03:46
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
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:
CODEOWNERS
file 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.Logging
to7.0.0
in the code that usesCodeOwnersParser
as dependency, to avoid the "package version downgrade detected" build failure.