Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Refactor workflow aspect #194

Merged

Conversation

masayag
Copy link
Collaborator

@masayag masayag commented Apr 2, 2023

WorkFlowExecutionAspect was refactored into several classes to allow separation and encapsulation of pre-execution and post-execution.

.createExecutionHandler(workFlowDefinition, workContext);
WorkFlowExecution workFlowExecution = executionHandler.handlePreWorkFlowExecution();

// @Richard, I think this is the right place to check if the workflow is already
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RichardW98 pls let me know what do you think of this

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if masterWorkFlowExecutionId is null, it means this is the first execution of master workflow, and it is not completed for sure

Copy link
Collaborator Author

@masayag masayag Apr 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RichardW98 in that case,

if (workFlowExecution.getStatus().equals(WorkFlowStatus.COMPLETED)) {
...

is false and it will not be executed.
My question is should this condition be moved to MasterWorkFlowExecutionInterceptor or can it be relevant for any Completed workflow?

Copy link
Contributor

@RichardW98 RichardW98 Apr 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is relevant to all completed workflow, not only master

@masayag masayag removed the request for review from eloycoto April 2, 2023 16:48
Copy link
Collaborator

@pkliczewski pkliczewski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

}

protected WorkFlowExecution getMasterWorkFlowExecution() {
return null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this shouldn't always be null?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is being overridden in MasterWorkFlowExecutionInterceptor and ContinuedWorkFlowExecutionInterceptor

@openshift-ci
Copy link

openshift-ci bot commented Apr 3, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: RichardW98

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved label Apr 3, 2023
WorkFlowExecutionAspect was refactored into several classess to allow
separation between pre-execution and post-execution.

Signed-off-by: Moti Asayag <masayag@redhat.com>
@openshift-ci openshift-ci bot removed the lgtm label Apr 3, 2023
@pkliczewski
Copy link
Collaborator

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Apr 4, 2023
@openshift-merge-robot openshift-merge-robot merged commit 3431361 into parodos-dev:main Apr 4, 2023
@masayag masayag deleted the workflow_aspect_refactor branch May 7, 2023 14:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants