-
Notifications
You must be signed in to change notification settings - Fork 71
Added support for paused status in stages that are waiting for input #1068
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?
Changes from 11 commits
fdea504
bb3e1eb
82b0bb6
8894ffa
a8c3093
c063d88
ea480b6
0f36e99
ec00207
9744231
7eadf51
0d4b320
22ed4cc
cc945d7
a2c9140
e08ddb0
25917da
ec60184
b9b21c4
337faa3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,6 +19,7 @@ class PipelineStageInternal { | |
| private boolean synthetic; | ||
| private TimingInfo timingInfo; | ||
| private String agent; | ||
| private PipelineStepBuilderApi builder; | ||
|
|
||
| public PipelineStageInternal( | ||
| String id, | ||
|
|
@@ -113,7 +114,43 @@ public void setAgent(String aAgent) { | |
| this.agent = aAgent; | ||
| } | ||
|
|
||
| public void setBuilder(PipelineStepBuilderApi builder) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this could be avoided by doing the refactoring mentioned in |
||
| this.builder = builder; | ||
| } | ||
|
|
||
| /** | ||
| * Checks if this stage or any of its children are waiting for input. | ||
| * A stage is waiting for input if any of its steps have a non-null inputStep | ||
| * and the step state is PAUSED. | ||
| */ | ||
| private boolean isWaitingForInput(List<PipelineStage> children) { | ||
| // Check if any child stages are waiting for input | ||
| if (children != null && !children.isEmpty()) { | ||
| for (PipelineStage child : children) { | ||
| if (child.waitingForInput) { | ||
| return true; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we get some test coverage for this please? A pipeline that sets an input step on it and validates the stage is now paused. |
||
| } | ||
| } | ||
| } | ||
|
|
||
| // Check steps for this stage | ||
| if (builder != null && id != null) { | ||
| List<FlowNodeWrapper> steps = builder.getStageSteps(id); | ||
| if (steps != null) { | ||
| for (FlowNodeWrapper step : steps) { | ||
| // Check if step has an input and is paused | ||
| if (step.getInputStep() != null && step.getStatus().state == BlueRun.BlueRunState.PAUSED) { | ||
| return true; | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| return false; | ||
| } | ||
|
|
||
| public PipelineStage toPipelineStage(List<PipelineStage> children, String runUrl) { | ||
| boolean waitingForInput = isWaitingForInput(children); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we only do this check if there is an InputAction attached to the WorkflowRun? I think that should be optimisable so this check is only run over stages that could be waiting for input? |
||
| return new PipelineStage( | ||
| id, | ||
| name, | ||
|
|
@@ -128,6 +165,7 @@ public PipelineStage toPipelineStage(List<PipelineStage> children, String runUrl | |
| synthetic && name.equals(Messages.FlowNodeWrapper_noStage()), | ||
| timingInfo, | ||
| agent, | ||
| runUrl); | ||
| runUrl, | ||
| waitingForInput); | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.