implemented 04-build-executor.md incl. concurrency amendment: async builds in per-branch worktrees, builds.maxConcurrent, cancellation, live logs; fix .gitignore build/ rule that silently excluded the de.hoennig.gittally.build package (also recovers the step-01 domain files)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Michael Hoennig
2026-07-07 08:43:28 +02:00
co-authored by Claude Fable 5
parent ae3ae7aa04
commit b379bc0a6b
31 changed files with 1790 additions and 12 deletions
@@ -0,0 +1,38 @@
package de.hoennig.gittally.build
import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.shouldBe
import io.kotest.matchers.shouldNotBe
import io.kotest.matchers.string.shouldContain
import io.kotest.matchers.string.shouldMatch
import java.time.Instant
class ArtifactKeysTest : FunSpec() {
private val startedAt = Instant.parse("2026-07-07T10:00:00Z")
init {
test("branchKey sanitizes unsafe characters and appends a 12-char hash") {
ArtifactKeys.branchKey("feature/x") shouldMatch "feature_x-[0-9a-f]{12}"
}
test("branches with the same sanitized name get different keys") {
ArtifactKeys.branchKey("feature/x") shouldNotBe ArtifactKeys.branchKey("feature_x")
}
test("buildKey is stable for the same input") {
ArtifactKeys.buildKey("main", startedAt) shouldBe ArtifactKeys.buildKey("main", startedAt)
}
test("buildKey differs per start time") {
ArtifactKeys.buildKey("main", startedAt) shouldNotBe
ArtifactKeys.buildKey("main", startedAt.plusSeconds(1))
}
test("buildKey contains the branch key and the sanitized start timestamp") {
val key = ArtifactKeys.buildKey("main", startedAt)
key shouldContain ArtifactKeys.branchKey("main")
key shouldContain "2026-07-07T10_00_00Z"
}
}
}