Skip to content

Commit

Permalink
fix(core/pipeline): ExecutionAndtagePicker Fix auto selection of stage (
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherthielen authored and mergify[bot] committed Nov 20, 2019
1 parent 1a7e326 commit dd0e3bb
Showing 1 changed file with 9 additions and 7 deletions.
Expand Up @@ -143,11 +143,13 @@ function findCloseStageFromExecution(pipeline: IPipeline, execution: IExecution,
}

function stageRequisiteStageGraph(stage: IStage, allStages: { [key: string]: IStage }): { [key: string]: any } {
return stage.requisiteStageRefIds.reduce((acc, requisiteStageId) => {
const requisiteStage = allStages[requisiteStageId];
if (!requisiteStage) {
return acc;
}
return { ...acc, [requisiteStageId]: stageRequisiteStageGraph(requisiteStage, allStages) };
}, {});
return stage.requisiteStageRefIds
.filter(ref => /^[0-9]+$/.exec(ref.toString()))
.reduce((acc, requisiteStageId) => {
const requisiteStage = allStages[requisiteStageId];
if (!requisiteStage) {
return acc;
}
return { ...acc, [requisiteStageId]: stageRequisiteStageGraph(requisiteStage, allStages) };
}, {});
}

0 comments on commit dd0e3bb

Please sign in to comment.