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

Improve darc UX around merge policy definition #4446

Merged
merged 1 commit into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
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
31 changes: 20 additions & 11 deletions src/Microsoft.DotNet.Darc/Darc/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,30 @@ public class Constants
"Each policy may have a set of required properties." +
"See below for available merge policies:",
"",
$"{MergePolicyConstants.StandardMergePolicyName} - Corresponds to either StandardGitHub or StandardAzureDevOps depending on the target repo type",
"The standard github merge policy is:",
$"- {MergePolicyConstants.AllCheckSuccessfulMergePolicyName} with the 'WIP' and 'license/cla' checks ignored.",
$"- {MergePolicyConstants.NoRequestedChangesMergePolicyName}",
$"- {MergePolicyConstants.DontAutomergeDowngradesPolicyName}",
$"- {MergePolicyConstants.ValidateCoherencyMergePolicyName}",
$"- Name: {MergePolicyConstants.StandardMergePolicyName} - Corresponds to either standard GitHub or AzureDevOps depending on the target repo type",
"The standard GitHub merge policy is:",
$"- Name: {MergePolicyConstants.AllCheckSuccessfulMergePolicyName}",
$" Properties:",
$" ignoreCheckes:",
$" - WIP",
$" - license/cla",
$"- Name: {MergePolicyConstants.NoRequestedChangesMergePolicyName}",
$"- Name: {MergePolicyConstants.DontAutomergeDowngradesPolicyName}",
$"- Name: {MergePolicyConstants.ValidateCoherencyMergePolicyName}",
"The standard Azure DevOps merge policy is:",
$"- {MergePolicyConstants.AllCheckSuccessfulMergePolicyName} with the 'Comment requirements', 'Minimum number of reviewers', 'Required reviewers',",
" and 'Work item linking' checks ignored.",
$"- {MergePolicyConstants.NoRequestedChangesMergePolicyName}",
$"- {MergePolicyConstants.DontAutomergeDowngradesPolicyName}",
$"- Name: {MergePolicyConstants.AllCheckSuccessfulMergePolicyName}",
$" Properties:",
$" ignoreCheckes:",
$" - Comment requirements",
$" - Minimum number of reviewers",
$" - Required reviewers",
$" - Work item linking",
$"- Name: {MergePolicyConstants.NoRequestedChangesMergePolicyName}",
$"- Name: {MergePolicyConstants.DontAutomergeDowngradesPolicyName}",
"YAML format:",
$"- Name: {MergePolicyConstants.StandardMergePolicyName}",
"",
"Explanation for every check:",
$"{MergePolicyConstants.AllCheckSuccessfulMergePolicyName} - All PR checks must be successful, potentially ignoring a specified set of checks.",
"Checks might be ignored if they are unrelated to PR validation. The check name corresponds to the string that shows up",
"in GitHub/Azure DevOps.",
Expand All @@ -81,6 +91,5 @@ public class Constants
$"{MergePolicyConstants.ValidateCoherencyMergePolicyName} - If coherency check failed for the PR, it will not be merged.",
"YAML format:",
$"- Name: {MergePolicyConstants.ValidateCoherencyMergePolicyName}",

];
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ public static bool ValidateMergePolicies(List<MergePolicy> mergePolicies, ILogge
}
else if (policy.Name.Equals(MergePolicyConstants.StandardMergePolicyName, StringComparison.OrdinalIgnoreCase) ||
policy.Name.Equals(MergePolicyConstants.NoRequestedChangesMergePolicyName, StringComparison.OrdinalIgnoreCase) ||
policy.Name.Equals(MergePolicyConstants.DontAutomergeDowngradesPolicyName, StringComparison.OrdinalIgnoreCase))
policy.Name.Equals(MergePolicyConstants.DontAutomergeDowngradesPolicyName, StringComparison.OrdinalIgnoreCase) ||
policy.Name.Equals(MergePolicyConstants.ValidateCoherencyMergePolicyName, StringComparison.OrdinalIgnoreCase))
{
// All good
}
Expand Down