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

Implement tools for diffing sets of owners of repo paths; update the regex-based CODEOWNERS matching logic #5165

Merged
merged 5 commits into from
Jan 23, 2023

Conversation

konrad-jamrozik
Copy link
Contributor

Overview

This PR implements tools for diffing list of owners for all files in given repository, allowing one to quickly determine how the resolved list of owners for all repository file paths will change if a different CODEOWNERS matcher is used, or the contents of the file are changed.

And as such, this PR contributes to:

And contributes to providing information necessary to unblock this PR:

This PR builds upon the logic implemented in:

Changes made

  • Added CodeownersDiffTests class, a series of tools to be used manually to diff owners of files based on differing sets of settings
  • Fixed a bug in MatchedCodeownersEntry, i.e. the regex-based CODEOWNERS matcher, where the matcher was "eating up slashes too aggressively" when interpreting **, resulting in more matches being made than desired. I added tests to CodeownersFileTests to cover these cases.

@konrad-jamrozik konrad-jamrozik added the Central-EngSys This issue is owned by the Engineering System team. label Jan 19, 2023
@konrad-jamrozik konrad-jamrozik self-assigned this Jan 19, 2023
@konrad-jamrozik konrad-jamrozik requested a review from a team as a code owner January 19, 2023 01:38
@konrad-jamrozik konrad-jamrozik force-pushed the users/kojamroz/co_co2_diff branch 2 times, most recently from 11eaa5d to a2396b2 Compare January 19, 2023 02:20
@konrad-jamrozik
Copy link
Contributor Author

konrad-jamrozik commented Jan 20, 2023

@weshaggard I updated the matcher logic. Please have a look once you have a moment :) Thanks!

Before merging I'll make a pass over comments and PR description to ensure they correctly reflect the new implementation. These comments might be outdated a bit right now.

@konrad-jamrozik konrad-jamrozik changed the title Implement tools for diffing sets of owners of repo paths; fix bug in regex-based CODEOWNERS matching logic Implement tools for diffing sets of owners of repo paths; update the regex-based CODEOWNERS matching logic Jan 20, 2023
Copy link
Member

@weshaggard weshaggard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@konrad-jamrozik konrad-jamrozik force-pushed the users/kojamroz/co_co2_diff branch from 04c6f7e to f17ba9b Compare January 23, 2023 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Central-EngSys This issue is owned by the Engineering System team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants