Skip to content

Commit

Permalink
fix(executions): Correctly populate trigger when rerunning an executi…
Browse files Browse the repository at this point in the history
…on (#7205)
  • Loading branch information
alanmquach authored and anotherchrisberry committed Jul 9, 2019
1 parent f340b02 commit 768c210
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,18 @@ module.exports = angular
// these on a subsequent run.
trigger.artifacts = [];
}
this.command.trigger = trigger || _.head(this.triggers);
if (trigger) {
// Find the pipeline.trigger that matches trigger (the trigger from the execution being re-run)
this.command.trigger = this.triggers.find(t =>
Object.keys(t)
.filter(k => k !== 'description')
.every(k => t[k] === trigger[k]),
);
// If we found a match, rehydrate it with everything from trigger, otherwise just default back to setting it to trigger
this.command.trigger = this.command.trigger ? Object.assign(this.command.trigger, trigger) : trigger;
} else {
this.command.trigger = _.head(this.triggers);
}
};

const updatePipelinePlan = pipeline => {
Expand Down

0 comments on commit 768c210

Please sign in to comment.