Skip to content
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;
}
}