[projects/pld-builder.new] request: one place that knows a final builder status
arekm
arekm at pld-linux.org
Thu Nov 12 00:29:46 CET 2026
commit 79d68abb1265129f9e80346cabcb4b5494f96e7a
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Wed Nov 11 23:12:03 2026 +0100
request: one place that knows a final builder status
The test for OK, SKIP, UNSUPP and FAIL statuses was spelled out four
times: for a finished batch, for a notification, and twice for
queue.html. is_final() now answers it. No change in behaviour.
PLD_Builder/request.py | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/PLD_Builder/request.py b/PLD_Builder/request.py
index 3e69bdf..b78397a 100644
--- a/PLD_Builder/request.py
+++ b/PLD_Builder/request.py
@@ -63,6 +63,10 @@ def iso8601(ts, timezone='UTC'):
dt = datetime.fromtimestamp(ts, tz)
return dt.isoformat()
+def is_final(status):
+ """Is a builder done with a batch: a status with a suffix, such as FAIL_DEPS_INSTALL, counts too"""
+ return status.startswith(("OK", "SKIP", "UNSUPP", "FAIL"))
+
def is_blank(e):
return e.nodeType == Element.TEXT_NODE and e.nodeValue.strip() == ""
@@ -252,7 +256,7 @@ class Batch:
ok = 1
for b in self.builders:
s = self.builders_status[b]
- if not s.startswith("OK") and not s.startswith("SKIP") and not s.startswith("UNSUPP") and not s.startswith("FAIL"):
+ if not is_final(s):
ok = 0
return ok
@@ -301,7 +305,7 @@ class Batch:
c = "black"
link_pre = ""
link_post = ""
- if s.startswith(("OK", "SKIP", "UNSUPP", "FAIL")) and len(self.spec) > 5:
+ if is_final(s) and len(self.spec) > 5:
if self.is_command():
bl_name = "command"
else:
@@ -506,7 +510,7 @@ class Notification:
id = attr(c, "id")
status = attr(c, "status")
buildtime = attr(c, "buildtime", "0")
- if not status.startswith("OK") and not status.startswith("SKIP") and not status.startswith("UNSUPP") and not status.startswith("FAIL"):
+ if not is_final(status):
log.panic(f"xml notification: bad status: {status}")
self.batches[id] = status
self.batches_buildtime[id] = buildtime
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/projects/pld-builder.new.git/commitdiff/2cf988b75f72cba070da99d03d3c3e709f5166bc
More information about the pld-cvs-commit
mailing list