Let auto-build slots run their own build command under their own name
A branches.<name>.autoBuild.times entry is now either a plain HH:MM string or an object with time, its own buildCommand, and a name, so a nightly slot can run a fuller check than the on-commit builds. The watcher passes the slot's command and name to the executor, persisted in the build result — UI restarts, gittally retry, and the startup recovery repeat a build with the command and name it originally ran under. A named slot (e.g. master@nightly) gets its own pool: repository grouping, retention count, branches-view row (sorted after its branch), latest status, and permanent latest-green artifact link are keyed by the build name, while origin lookups, gone-branch pruning, worktrees, and Gitea links/statuses stay keyed by the real branch. Without a name, slot builds share the branch's pool as before. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
f292badac1
commit
8aee3190ea
@@ -258,8 +258,9 @@ function actionButton(symbol, title, className, dataset) {
|
||||
|
||||
function renderBuildRow(build, allowRestart) {
|
||||
const row = document.createElement("tr");
|
||||
const displayName = build.name || build.branch;
|
||||
row.dataset.artifactKey = build.artifactKey || "";
|
||||
row.dataset.branch = build.branch;
|
||||
row.dataset.branch = displayName;
|
||||
row.dataset.startedAt = build.startedAt || "";
|
||||
row.dataset.runningSince = build.runningSince || "";
|
||||
row.dataset.status = build.status || "unknown";
|
||||
@@ -274,8 +275,8 @@ function renderBuildRow(build, allowRestart) {
|
||||
const branchTools = elem("span", "link-tools");
|
||||
branchTools.appendChild(
|
||||
giteaRepoUrl
|
||||
? externalLink(giteaRepoUrl + "/src/branch/" + encodeBranchPath(build.branch), build.branch)
|
||||
: elem("span", null, build.branch),
|
||||
? externalLink(giteaRepoUrl + "/src/branch/" + encodeBranchPath(build.branch), displayName)
|
||||
: elem("span", null, displayName),
|
||||
);
|
||||
branchTools.appendChild(copyButton(build.branch, "branch name"));
|
||||
branchCell.appendChild(branchTools);
|
||||
@@ -332,7 +333,7 @@ function renderBuildRow(build, allowRestart) {
|
||||
const actionsCell = elem("td", "actions-cell");
|
||||
const actions = elem("div", "actions");
|
||||
if (allowRestart) {
|
||||
actions.appendChild(actionButton("↻", "Restart build", null, { action: "restart", branch: build.branch }));
|
||||
actions.appendChild(actionButton("↻", "Restart build", null, { action: "restart", branch: displayName }));
|
||||
}
|
||||
if (build.artifactKey) {
|
||||
actions.appendChild(
|
||||
@@ -386,10 +387,11 @@ function renderBuildCard(build) {
|
||||
const header = elem("header", "build-card-header");
|
||||
header.appendChild(statusBadge(build.status || "running"));
|
||||
const branchTools = elem("span", "branch link-tools");
|
||||
const displayName = build.name || build.branch;
|
||||
branchTools.appendChild(
|
||||
giteaRepoUrl
|
||||
? externalLink(giteaRepoUrl + "/src/branch/" + encodeBranchPath(build.branch), build.branch)
|
||||
: elem("span", null, build.branch),
|
||||
? externalLink(giteaRepoUrl + "/src/branch/" + encodeBranchPath(build.branch), displayName)
|
||||
: elem("span", null, displayName),
|
||||
);
|
||||
header.appendChild(branchTools);
|
||||
const commitCode = elem("code");
|
||||
|
||||
@@ -24,15 +24,15 @@
|
||||
<td class="empty" colspan="7" th:text="${emptyMessage}">No builds recorded yet.</td>
|
||||
</tr>
|
||||
<tr th:each="row : ${rows}"
|
||||
th:attr="data-artifact-key=${row.artifactKey},data-branch=${row.branch},data-started-at=${row.startedAtIso},data-running-since=${row.runningSinceIso},data-status=${row.status}">
|
||||
th:attr="data-artifact-key=${row.artifactKey},data-branch=${row.name},data-started-at=${row.startedAtIso},data-running-since=${row.runningSinceIso},data-status=${row.status}">
|
||||
<td data-label="Status">
|
||||
<span th:class="'status status-' + ${row.status}" th:text="${row.status}">success</span>
|
||||
</td>
|
||||
<td class="branch" data-label="Branch">
|
||||
<span class="link-tools">
|
||||
<a th:if="${row.branchUrl != null}" th:href="${row.branchUrl}" target="_blank"
|
||||
rel="noopener noreferrer" th:text="${row.branch}">main</a>
|
||||
<span th:if="${row.branchUrl == null}" th:text="${row.branch}">main</span>
|
||||
rel="noopener noreferrer" th:text="${row.name}">main</a>
|
||||
<span th:if="${row.branchUrl == null}" th:text="${row.name}">main</span>
|
||||
<button class="copy-button" type="button" th:attr="data-copy=${row.branch}"
|
||||
title="Copy branch name" aria-label="Copy branch name">⧉</button>
|
||||
</span>
|
||||
@@ -65,7 +65,7 @@
|
||||
<td class="actions-cell">
|
||||
<div class="actions">
|
||||
<button th:if="${allowRestart}" class="action-button" type="button" data-action="restart"
|
||||
th:attr="data-branch=${row.branch}" title="Restart build"
|
||||
th:attr="data-branch=${row.name}" title="Restart build"
|
||||
aria-label="Restart build">↻</button>
|
||||
<button th:if="${row.artifactKey != ''}" class="action-button delete-button" type="button"
|
||||
data-action="delete" th:attr="data-artifact-key=${row.artifactKey}"
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
<span th:class="'status status-' + ${build.status}" th:text="${build.status}">running</span>
|
||||
<span class="branch link-tools">
|
||||
<a th:if="${build.branchUrl != null}" th:href="${build.branchUrl}" target="_blank"
|
||||
rel="noopener noreferrer" th:text="${build.branch}">main</a>
|
||||
<span th:if="${build.branchUrl == null}" th:text="${build.branch}">main</span>
|
||||
rel="noopener noreferrer" th:text="${build.name}">main</a>
|
||||
<span th:if="${build.branchUrl == null}" th:text="${build.name}">main</span>
|
||||
</span>
|
||||
<code>
|
||||
<a th:if="${build.commitUrl != null}" th:href="${build.commitUrl}" target="_blank"
|
||||
@@ -30,7 +30,7 @@
|
||||
th:attr="data-artifact-key=${build.artifactKey}" title="Cancel build">× Cancel</button>
|
||||
</span>
|
||||
</header>
|
||||
<pre class="live-log" th:attr="aria-label='live log of ' + ${build.branch}"></pre>
|
||||
<pre class="live-log" th:attr="aria-label='live log of ' + ${build.name}"></pre>
|
||||
</section>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
Reference in New Issue
Block a user