Show the command a build actually runs on its artifact page

The artifact page read `branches.<branch>.buildCommand` from the primary
config only, so for a named build on a branch with its own config it showed
a command that build never ran — on vm4006 it showed the host config's
command for a build that ran the branch definition's `pitestFull`.

Resolving "what does this build run" now has one implementation,
`GitTallyConfig.buildSettings(branch, build)`: the branch entry with the
build definition's overrides applied last. The executor uses it, and the
page resolves it against the branch layer committed at the build's own
commit — the same inputs the executor had.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
mhoennig
2026-08-29 07:52:22 +02:00
co-authored by Claude Opus 5
parent 939d8eeb9c
commit 1a84b1fc1b
6 changed files with 81 additions and 12 deletions
@@ -21,6 +21,22 @@ data class GitTallyConfig(
/** The configured [buildDefinitions] plus the implicit `default` build unless overridden. */
fun effectiveBuildDefinitions(): Map<String, BuildDefinition> =
mapOf(BuildDefinition.DEFAULT to BuildDefinition(onPush = true)) + buildDefinitions
/**
* The settings one build of [build] on [branch] runs with: the branch entry (falling
* back to `branches.default`) with the build definition's overrides applied last.
* A build name without a definition — a job removed from the config since the run —
* falls back to the plain branch settings.
* This must stay the single answer to "what does this build run", used by the
* executor and by everything that displays it.
*/
fun buildSettings(
branch: String,
build: String,
): BranchConfig {
val branchConfig = branches[branch] ?: branches["default"] ?: BranchConfig()
return effectiveBuildDefinitions()[build]?.applyTo(branchConfig) ?: branchConfig
}
}
data class ServerConfig(