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

Always use regex matcher when determining contacts for build failure notifications #5487

Merged
merged 1 commit into from
Feb 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -120,37 +120,10 @@ private CodeownersEntry GetMatchingCodeownersEntry(
CodeownersEntry matchingCodeownersEntry =
CodeownersFile.GetMatchingCodeownersEntry(
process.YamlFilename,
codeownersEntries,
UseRegexMatcher(repoUrl));
codeownersEntries);

matchingCodeownersEntry.ExcludeNonUserAliases();

return matchingCodeownersEntry;
}

/// <summary>
/// Whether the new regex-based CODEOWNERS matcher that supports wildcards should be used
/// for given repository. This method exists to allow incremental roll-out
/// of the new matcher [1].
///
/// Note that enabling the new matcher will not change the reviewers assigned to
/// PRs, because this is handled by built-in GitHub matcher.
/// But it will change who receives build failure notifications.
///
/// [1] https://github.com/Azure/azure-sdk-tools/pull/5088
/// </summary>
private bool UseRegexMatcher(string repoUrl)
{
// Expected repoUrl: https://github.com/Azure/azure-sdk-for-net
if (repoUrl.Contains("azure-sdk-for-net"))
{
// Work that was done to facilitate enabling the matcher in this repo:
// https://github.com/Azure/azure-sdk-for-net/pull/33584 - Fix invalid paths in CODEOWNERS
// https://github.com/Azure/azure-sdk-for-net/pull/33595 - Remove CODEOWNERS rules /**/ci.yml and /**/tests.yml
// https://github.com/Azure/azure-sdk-for-net/pull/33597 - Add missing /sdk/<dir> rules
return true;
}

return false;
}
}