in server/src/main/kotlin/com/jetbrains/teamcity/plugins/unrealengine/server/build/state/AgentBuildStateEventMonitor.kt [20:53]
override suspend fun handleBuildEvent(
buildId: Long,
event: AgentBuildEvent,
) {
if (!(
event is AgentBuildEvent.BuildStepCompleted ||
event is AgentBuildEvent.BuildStepStarted ||
event is AgentBuildEvent.BuildStepInterrupted
)
) {
logger.debug("Skipping agent build event handling since it's not related to build state update")
return
}
val build =
ensureNotNull(
buildManager.findBuildInstanceById(buildId),
"Unable to find a build with the given id $buildId",
)
val serverSideEvent =
when (event) {
is AgentBuildEvent.BuildStepCompleted ->
DistributedBuildEvent.BuildStepCompleted(
build,
event.name,
event.outcome,
)
is AgentBuildEvent.BuildStepStarted -> DistributedBuildEvent.BuildStepStarted(build, event.name)
is AgentBuildEvent.BuildStepInterrupted -> DistributedBuildEvent.BuildStepInterrupted(build, event.name)
}
stateTracker.handleBuildEvent(serverSideEvent)
}