Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion core/environment/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -413,13 +413,15 @@ func newEnvironment(userVars map[string]string, newId uid.ID) (env *Environment,

env.handlerFunc()(e)

eventState := e.Dst // we set the destination state here instead of the current for the event write, if the tasks have transitioned
if e.Err != nil {
errorMsg = e.Err.Error()
eventState = e.Src
}

the.EventWriterWithTopic(topic.Environment).WriteEvent(&pb.Ev_EnvironmentEvent{
EnvironmentId: env.id.String(),
State: e.Dst, // exceptionally we take the destination state here instead of the current, because the tasks have transitioned
State: eventState,
RunNumber: env.currentRunNumber,
Error: errorMsg,
Message: "transition step finished",
Expand Down