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

add workflow status rest endpoint #138

Merged
merged 3 commits into from
Mar 22, 2023
Merged

add workflow status rest endpoint #138

merged 3 commits into from
Mar 22, 2023

Conversation

anludke
Copy link
Contributor

@anludke anludke commented Mar 22, 2023

No description provided.

@openshift-ci
Copy link

openshift-ci bot commented Mar 22, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: anludke

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

List<WorkFlowWorkDefinition> masterWorkFlowWorkDefinitions = workFlowWorkRepository
.findByWorkFlowDefinitionIdOrderByCreateDateAsc(masterWorkFlowDefinition.getId());
masterWorkFlowWorkDefinitions.forEach(workFlowWorkDefinition -> {
if (workFlowWorkDefinition.getWorkDefinitionType().equals(WorkType.WORKFLOW)) {
Copy link
Collaborator

@eloycoto eloycoto Mar 22, 2023

Choose a reason for hiding this comment

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

Could you move this to an external method somehow? All these WFdefinitions are getting hard to understand due to the multiple if conditions in there?

Also, all this code is repeated after in the loop

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@eloycoto I believe it's the same comment as @pkliczewski.

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.

overall looks good, 2 small comments

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.*;
Copy link
Collaborator

Choose a reason for hiding this comment

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

please expand the asterisk

Copy link
Contributor Author

@anludke anludke Mar 22, 2023

Choose a reason for hiding this comment

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

Good catch! Fixed

@@ -130,6 +139,140 @@ public synchronized WorkFlowExecution updateWorkFlow(WorkFlowExecution workFlowE
return workFlowRepository.save(workFlowExecution);
}

@Override
public WorkFlowStatusResponseDTO getWorkFlowStatus(UUID workFlowExecutionId) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This method seems to be long. Do you think it makes sense to split it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@pkliczewski I'll find a way split further.

RichardW98 and others added 2 commits March 22, 2023 08:29
* avoid null pointer exception when subWorkflow not executed

* add tests
@pkliczewski
Copy link
Collaborator

/lgtm
We agree with @anludke to improve the method in the next PR

@openshift-ci openshift-ci bot added the lgtm label Mar 22, 2023
@RichardW98 RichardW98 merged commit d49e516 into main Mar 22, 2023
@RichardW98 RichardW98 deleted the FLPATH-184 branch March 22, 2023 12:55
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.

4 participants