Files
werkator/src/main/kotlin/de/hoennig/gittally/build/RunningBuild.kt
T
mhoennigandClaude Fable 5 56aa306481 Separate queue wait from build duration
BuildResult gains runningSince, set when a build leaves the queue; the
recorded duration now measures pure build time from that point, so build
runtimes can be tracked without queue wait. A build cancelled while still
queued records neither. The UI shows the live wait time in italics while
pending and switches to the real build time once the build runs; the Gitea
"after mm:ss" descriptions now also report pure build time.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-10 15:55:36 +02:00

26 lines
851 B
Kotlin

package de.hoennig.gittally.build
import java.nio.file.Path
import java.time.Instant
/** Handle to a build accepted by the [BuildExecutor]; log paths become valid once the build runs. */
data class RunningBuild(
val branch: String,
val commit: String,
val artifactKey: String,
val startedAt: Instant,
/** Working directory for build output; handed to the [ArtifactStore] when the build ends. */
val stagingDir: Path,
/** Combined stdout+stderr log, written live while the build runs. */
val liveLogFile: Path,
) {
/** Set by the executor when the build leaves the queue and starts executing. */
@Volatile
var runningSince: Instant? = null
}
/** Published via Spring's `ApplicationEventPublisher` on every persisted status transition. */
data class BuildStatusChangedEvent(
val result: BuildResult,
)