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

Bugfix: when looking for a match in CODEOWNERS, do not emit error message for commented out paths #5366

Merged
merged 5 commits into from
Feb 13, 2023

Conversation

konrad-jamrozik
Copy link
Contributor

@konrad-jamrozik konrad-jamrozik commented Feb 8, 2023

Before this change, commented out paths in CODEOWNERS violated the rule that the paths should start with /. As a result, the Console.Err was spammed with error messages, resulting in Console.Out truncation for azure-sdk-for-js and azure-sdk-for-java repos, making it impossible to deserialize the result written to Console.Out into valid json. This broke CodeownersManualAnalysisTests with OutOfMemoryException upon getting value from Console.Err.

This bug was introduced by:

as that PR stopped prepending missing / and instead started outputting message to Console.Err if they were missing.

Secondary fix

This PR also fixes a bug related to validating paths.

@konrad-jamrozik konrad-jamrozik added the Central-EngSys This issue is owned by the Engineering System team. label Feb 8, 2023
@konrad-jamrozik konrad-jamrozik self-assigned this Feb 8, 2023
@konrad-jamrozik konrad-jamrozik requested a review from a team as a code owner February 8, 2023 04:35
@konrad-jamrozik konrad-jamrozik requested a review from benbp February 8, 2023 04:35
@konrad-jamrozik konrad-jamrozik changed the title When looking for a match, exclude CODEOWNERS paths that are commented out. Bugfix: when looking for a match, exclude CODEOWNERS paths that are commented out. Feb 8, 2023
@konrad-jamrozik konrad-jamrozik changed the title Bugfix: when looking for a match, exclude CODEOWNERS paths that are commented out. Bugfix: when looking for a match in CODEOWNERS, do not emit error message for commented out paths Feb 8, 2023
Konrad Jamrozik added 2 commits February 9, 2023 18:43
@@ -352,6 +352,7 @@ private void WriteLangRepoOwnersDiffToCsv(string langName)
outputLines.AddRange(PathsWithMissingPrefixSlash(entries));
outputLines.AddRange(PathsWithMissingSuffixSlash(targetDir, entries, paths));
outputLines.AddRange(InvalidPaths(entries));
// TODO: add a check here for CODEOWNERS paths that do not match any dir or file.
Copy link
Member

Choose a reason for hiding this comment

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

Do we need an issue tracking this?

Copy link
Contributor Author

@konrad-jamrozik konrad-jamrozik Feb 13, 2023

Choose a reason for hiding this comment

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

@benbp not really. I put it here more as a reminder that this validation is currently missing, in the unlikely scenario I (or somebody else) will have to use it again. I forgot at first to include it. But I kind of expect for it to be actually picked up when working on:

This kind of validation is mentioned here:

@konrad-jamrozik konrad-jamrozik merged commit 2c09d93 into main Feb 13, 2023
@konrad-jamrozik konrad-jamrozik deleted the users/kojamroz/fox_comment_warn branch February 13, 2023 19:33
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