Skip to content

Commit

Permalink
Fixes #24111: Pending deployment action are completely messed up
Browse files Browse the repository at this point in the history
  • Loading branch information
VinceMacBuche committed Jan 31, 2024
1 parent 20067b0 commit 17cab26
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,9 @@ class TwoValidationStepsWorkflowServiceImpl(
isCreator: Boolean
): WorkflowAction = {

val deployAction = {
def deployAction(action : (ChangeRequestId, EventActor, Option[String]) => Box[WorkflowNodeId]) = {
if (canDeploy(isCreator, selfDeployment))
Seq((Deployed.id, stepValidationToDeployed _))
Seq((Deployed.id, action))
else Seq()
}

Expand All @@ -220,17 +220,13 @@ class TwoValidationStepsWorkflowServiceImpl(
val validatorActions = {
(if (canValidate(isCreator, selfValidation)) {
Seq((Deployment.id, stepValidationToDeployment _))
} else Seq()) ++ deployAction
} else Seq()) ++ deployAction(stepValidationToDeployed)
}
WorkflowAction("Validate", validatorActions)

case Deployment.id =>
val deploymentAction = {
(if (canDeploy(isCreator, selfValidation)) {
Seq((Deployment.id, stepDeploymentToDeployed _))
} else Seq()) ++ deployAction
}
WorkflowAction("Deploy", deploymentAction)
WorkflowAction("Deploy", deployAction(stepDeploymentToDeployed))

case Deployed.id => NoWorkflowAction
case Cancelled.id => NoWorkflowAction
case WorkflowNodeId(x) =>
Expand Down

0 comments on commit 17cab26

Please sign in to comment.