From f5a35a82a62612fa8f6537b4da6ebdea8192a196 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Thu, 30 Mar 2023 00:55:55 +1100 Subject: started working on builder view --- buildbot-client.el | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'buildbot-client.el') diff --git a/buildbot-client.el b/buildbot-client.el index 64c308f..ecc5757 100644 --- a/buildbot-client.el +++ b/buildbot-client.el @@ -46,6 +46,12 @@ "%s/api/v2/builders" buildbot-host))) +(defun buildbot-api-builders-builds (builder-id attr) + (buildbot-url-fetch-json + (format + "%s/api/v2/builders/%d/builds?%s" + buildbot-host builder-id (buildbot-format-attr attr)))) + (defun buildbot-api-build (attr) (buildbot-url-fetch-json (format @@ -62,6 +68,12 @@ (buildbot-url-fetch-raw (format "%s/api/v2/logs/%d/raw" buildbot-host logid))) +(defun buildbot-get-recent-builds-by-builder (builder-id limit) + (alist-get 'builds + (buildbot-api-builders-builds + builder-id + `((limit . ,limit) (order . "-number") (property . "revision"))))) + (defun buildbot-get-recent-changes (limit) (buildbot-api-change (list (cons 'order "-changeid") (cons 'limit limit)))) @@ -74,6 +86,12 @@ (= (alist-get 'builderid builder) builderid)) buildbot-builders)) +(defun buildbot-builder-by-name (name) + (cl-find-if + (lambda (builder) + (equal (alist-get 'name builder) name)) + buildbot-builders)) + (defun buildbot-get-logs-by-stepid (stepid) (alist-get 'logs (buildbot-api-logs stepid))) -- cgit v1.2.3