-
Notifications
You must be signed in to change notification settings - Fork 77
Unify back and forward flow merge policies #4691
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this change as it simplifies quite a few things around configuring/running the check
src/Maestro/Maestro.MergePolicies/ForwardFlowMergePolicyInterpreter.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should not merge this as we first need to merge the revert from production to main
FYI, I am working on additional changes to the PR checks , so we are gonna have a bunch of conflicts |
…ks (dotnet#4680) <!-- Link the GitHub or AzDO issue this pull request is associated with. Please copy and paste the full URL rather than using the dotnet/arcade-services# syntax --> dotnet#4612 dotnet#2599 - Allows subscription merge policy updates from the `update-subscription command - Allows adding explicitly adding coherency check policies - Allows specifying `ignore-checks` for the standard automerge policy --------- Co-authored-by: Přemek Vysoký <premek.vysoky@microsoft.com>
45dbfbb
to
e0e6e55
Compare
@dkurepa I pushed here the revert of the revert and then the original content of this PR |
What if you just move the MergePolicyBuilder's from BackFlowMergePolicy and ForwardFlowMergePolicy to their shared base class CodeFlowMergePolicy, without introducing all the new classes and the CodeFlowMergePolicyInterpreterResult? |
@adamzip I kind of like that there is just one codeflow policy for both back/forward flow as it's much easier to use when defining subscriptions. |
I found some missing places where the codeflow policy still wasn't supported, I guess this PR will need a bit more work |
@@ -95,6 +95,16 @@ public override async Task<int> ExecuteAsync() | |||
}); | |||
} | |||
|
|||
if (_options.) // TODO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to handle default branch policies
Isn't it just a difference in naming? You could keep the current class structure as is, and have |
Yeah sure, that also works |
… into dkurepa/MergePolicyEvaluatorFix
Yeah fair point, those |
{ | ||
public override string DisplayName => "Code flow verification"; | ||
|
||
protected static readonly string configurationErrorsHeader = """ | ||
protected static readonly string _configurationErrorsHeader = """ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had looked up the casing convention for protected static fields and the consensus I found was that both underscore and camelcase are acceptable, but it's common to have no underscore.
Not asking this to be changed, just want share the info
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally thought protected static fields are PascalCase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like that is the case, will fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dkurepa before merging this, please try to use darc
locally to add this policy onto a subscription to see how it all works together.
I did run a modified scenario test with a breakpoint where I "corrupted" the source-manifest.json, and then let the service run the code policy check, linked above |
Previously, we had two separate classes for
ForwardFlowMergePolicy
andBackwardFlowMergePolicy
, and they both had the same MergePolicyName:Codeflow consistency check
.Because of this, we had exceptions when we we're registering both here:
arcade-services/src/ProductConstructionService/ProductConstructionService.DependencyFlow/MergePolicyEvaluator.cs
Line 28 in fdb14b5
I personally think that it's a good idea to have these have the same name. That way we can be sure that a subscription will only have one codeflow merge policy, and it will be the correct one, there will be no need for validation
#4612
test: maestro-auth-test/maestro-test-vmr#1353