aboutsummaryrefslogtreecommitdiffstats
path: root/sb_builder/mainwindow.py
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-21 11:36:01 +0200
committerDanilo M. <danix@danix.xyz>2026-10-21 11:36:01 +0200
commit766ce6ff1ea584dfe980a5e0b29251768c4c0726 (patch)
treeeaa047f46fc9b59acae745406a116d2e479239ca /sb_builder/mainwindow.py
parentfb93767351dc0d7d4d4da8068b2f94df6ef44b6d (diff)
downloadsb-builder-766ce6ff1ea584dfe980a5e0b29251768c4c0726.tar.gz
sb-builder-766ce6ff1ea584dfe980a5e0b29251768c4c0726.zip
sbb-remote 0.12.0: named builds, per-package job results, prune
- Packages: named packages run slackrepo build, which also updates outdated ones; update on a named item finds only already-built packages. The per-row Update action is gone, Update all stays. - A real slackrepo job reads its items' buildresults rows into the job's results and is failed when any item failed, aborted or was bad: slackrepo itself exits 0. The notification names the failed items; a Build results dialog lists every item with its log and Retry failed, reopenable from the Jobs ribbon. - slackrepo prune: the helper lists built items whose SlackBuild is gone and runs slackrepo remove on them, without an Update all. stats gives the count; Packages gets a Prune action, the Built tile a 'to prune' note. Remove and prune ask for confirmation at Run it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'sb_builder/mainwindow.py')
-rw-r--r--sb_builder/mainwindow.py21
1 files changed, 18 insertions, 3 deletions
diff --git a/sb_builder/mainwindow.py b/sb_builder/mainwindow.py
index 4b0aca2..aab6093 100644
--- a/sb_builder/mainwindow.py
+++ b/sb_builder/mainwindow.py
@@ -27,9 +27,9 @@ from PyQt6.QtWidgets import (QHeaderView, QLabel, QMainWindow, QMessageBox, QPus
from . import VERSION, config
from .dashboard import Dashboard
-from .fmt import job_title, outcome
+from .fmt import failed_items, job_title, outcome
from .hints_tab import HINT_JOBS, HintResultDialog, HintsTab
-from .jobs import JobsTab, NextStep, is_preview
+from .jobs import BuildResultDialog, JobsTab, NextStep, is_preview
from .packages import PackagesTab
from .repository import RepositoryTab
from .results import ResultsTab
@@ -120,6 +120,7 @@ class MainWindow(QMainWindow):
self.jobs_tab.refresh_requested.connect(self.poll_jobs)
self.jobs_tab.started.connect(self.mine.add)
self.jobs_tab.preview_requested.connect(self.show_next_step)
+ self.jobs_tab.results_requested.connect(self.show_build_result)
self.packages_tab = PackagesTab(self.remote)
self.packages_tab.start_requested.connect(lambda args: self.jobs_tab.start(*args))
self.packages_tab.hints_requested.connect(self.open_hints)
@@ -221,6 +222,7 @@ class MainWindow(QMainWindow):
if err:
return self._failed(err)
self.dashboard.show_stats(data)
+ self.packages_tab.set_prunable(data.get("prunable"))
def _got_version(self, data, err):
if err:
@@ -326,6 +328,8 @@ class MainWindow(QMainWindow):
self.remote.call(lambda d, err: d and self.show_hint_result(d), "job-result", j["id"])
elif is_preview(j):
self.show_next_step(j, auto=True)
+ elif j["kind"] == "slackrepo" and failed_items(j):
+ self.show_build_result(j)
@staticmethod
def _reload(*tabs):
@@ -348,6 +352,17 @@ class MainWindow(QMainWindow):
else:
d.show()
+ def show_build_result(self, job):
+ """A slackrepo run's per-package results: logs, Retry failed."""
+ if job["id"] in self.next_steps:
+ self.next_steps[job["id"]].raise_()
+ return
+ d = BuildResultDialog(self.remote, job, self)
+ d.retry.connect(lambda pkgs: self.jobs_tab.start("slackrepo", "build", "--preview", *pkgs))
+ d.finished.connect(lambda _r: self.next_steps.pop(job["id"], None))
+ self.next_steps[job["id"]] = d
+ d.show()
+
def _badge(self, state):
self.badge = state
i = self.tabs.indexOf(self.jobs_tab)
@@ -364,7 +379,7 @@ class MainWindow(QMainWindow):
return # nothing changed, nothing failed: no news
d = HintResultDialog(self.remote, result, self)
d.build_requested.connect(
- lambda pkgs: self.jobs_tab.start("slackrepo", "update", "--preview", *pkgs))
+ lambda pkgs: self.jobs_tab.start("slackrepo", "build", "--preview", *pkgs))
d.changed.connect(lambda: self._reload(self.packages_tab, self.hints_tab))
d.finished.connect(lambda _r: self.hint_dialogs.remove(d))
self.hint_dialogs.append(d)