Skip to content

Commit

Permalink
fix(core): add flow revision to failed execution in case of trigger e…
Browse files Browse the repository at this point in the history
…valuation failure
  • Loading branch information
brian-mulier-p authored and fhussonnois committed Sep 12, 2024
1 parent 5b431bf commit 6f01732
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ default Optional<Flow> findByIdFromFlowTask(String tenantId, String namespace, S
}

default Optional<Flow> findByExecution(Execution execution) {
if (execution.getFlowRevision() == null) {
return Optional.empty();
}

return this.findById(
execution.getTenantId(),
execution.getNamespace(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ else if (f.getPollingTrigger() instanceof Schedule schedule) {
.tenantId(f.getTriggerContext().getTenantId())
.namespace(f.getTriggerContext().getNamespace())
.flowId(f.getTriggerContext().getFlowId())
.flowRevision(f.getTriggerContext().getFlowRevision())
.flowRevision(f.getFlow().getRevision())
.labels(f.getFlow().getLabels())
.state(new State().withState(State.Type.FAILED))
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ void failedEvaluationTest() throws Exception {

assertThat(queueCount.getCount(), is(0L));
assertThat(last.get(), notNullValue());
assertThat(last.get().getFlowRevision(), notNullValue());
assertThat(last.get().getState().getCurrent(), is(State.Type.FAILED));
}
}
Expand Down

0 comments on commit 6f01732

Please sign in to comment.