[Git][qa/jenkins.debian.net][master] rdn stats: support pull-184
Holger Levsen (@holger)
gitlab at salsa.debian.org
Sun Aug 24 10:22:18 BST 2025
Holger Levsen pushed to branch master at Debian QA / jenkins.debian.net
Commits:
add556f0 by Jochen Sprickerhof at 2025-08-24T11:22:04+02:00
rdn stats: support pull-184
(cherry picked from commit 11b5afcfe2cd07a1fde8fdeed2554b85fce5727f)
Signed-off-by: Holger Levsen <holger at layer-acht.org>
- - - - -
1 changed file:
- bin/rebuilderd_stats.py
Changes:
=====================================
bin/rebuilderd_stats.py
=====================================
@@ -39,6 +39,11 @@ def main() -> None:
default=Path(),
help="Cache file (will be ignored when this script changes).",
)
+ parser.add_argument(
+ "--release",
+ type=Path,
+ help="Release name to filter for",
+ )
parser.add_argument(
"output_dir",
type=Path,
@@ -144,11 +149,24 @@ def main() -> None:
messages_packages: dict[str, list] = {k: [] for k in error_messages.keys()} # Preserve keys order
total = 0
- for name, src_name, build_id, build_log, diffoscope in cu.execute(
- "SELECT p.name, s.name, p.build_id, b.build_log, b.diffoscope"
- " FROM packages p JOIN pkgbases s ON s.id = p.pkgbase_id LEFT JOIN builds b ON b.id = p.build_id"
- " WHERE p.status ='BAD' ORDER BY p.build_id"
- ):
+ filter_release = ""
+ if args.release:
+ filter_release = f"AND s.release = {args.release}"
+ if cu.execute("SELECT COUNT(name) FROM sqlite_schema WHERE name = 'rebuild_artifacts'").fetchall()[0][0] == 1:
+ sql = (
+ "SELECT a.name, s.name, r.id, r.build_log, a.diffoscope"
+ " FROM rebuild_artifacts a JOIN rebuilds r ON a.rebuild_id = r.id JOIN build_inputs i ON r.build_input_id = i.id JOIN source_packages s ON i.source_package_id = s.id"
+ f" WHERE a.status = 'BAD' {filter_release} group by a.name HAVING r.id = MAX(r.id) ORDER BY a.id"
+ )
+ api = v1
+ else:
+ sql = (
+ "SELECT p.name, s.name, p.build_id, b.build_log, b.diffoscope"
+ " FROM packages p JOIN pkgbases s ON s.id = p.pkgbase_id LEFT JOIN builds b ON b.id = p.build_id"
+ " WHERE p.status = 'BAD' ORDER BY p.build_id"
+ )
+ api = v0
+ for name, src_name, build_id, build_log, diffoscope in cu.execute(sql):
total += 1
if build_id in cache:
@@ -251,9 +269,9 @@ def output(outfile, arch, db_size, total, messages_packages, size_sort):
if not bug_break and not (pkg["src"] in rn_bugs and "bugs" in rn_bugs[pkg["src"]]):
bug_break = True
print("</span></p><p><span>", file=outfile)
- print(f'<a href="../api/v0/builds/{pkg["id"]}/log">{pkg["name"]}</a> ', end='', file=outfile)
+ print(f'<a href="../api/{api}/builds/{pkg["id"]}/log">{pkg["name"]}</a> ', end='', file=outfile)
if pkg["diff"]:
- print(f'<a href="../api/v0/builds/{pkg["id"]}/diffoscope">💠</a>', end='', file=outfile)
+ print(f'<a href="../api/{api}/builds/{pkg["id"]}/diffoscope">💠</a>', end='', file=outfile)
print(f'<a href="https://tracker.debian.org/pkg/{pkg["src"]}">🍥</a>', end='', file=outfile)
print(f'<a href="https://tests.reproducible-builds.org/debian/rb-pkg/trixie/{ci_arch}/{pkg["src"]}.html">🔬</a>', end='', file=outfile)
if pkg["src"] in rn_bugs and "bugs" in rn_bugs[pkg["src"]]:
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/add556f06d0cbd335aa8cc15c6a6f554e14bebc4
--
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/add556f06d0cbd335aa8cc15c6a6f554e14bebc4
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/qa-jenkins-scm/attachments/20250824/b232a7cb/attachment-0001.htm>
More information about the Qa-jenkins-scm
mailing list