diff options
author | Yuchen Pei <hi@ypei.me> | 2023-03-30 00:55:55 +1100 |
---|---|---|
committer | Yuchen Pei <hi@ypei.me> | 2023-03-30 00:55:55 +1100 |
commit | f5a35a82a62612fa8f6537b4da6ebdea8192a196 (patch) | |
tree | 3da25efacb1a76100eff668d0a7b39a9a14310eb /buildbot-client.el | |
parent | f5b97b439a2a1a7d13c60f1b711edf704542a038 (diff) |
started working on builder view
Diffstat (limited to 'buildbot-client.el')
-rw-r--r-- | buildbot-client.el | 18 |
1 files changed, 18 insertions, 0 deletions
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))) |