diff options
Diffstat (limited to 'buildbot-client.el')
-rw-r--r-- | buildbot-client.el | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/buildbot-client.el b/buildbot-client.el index 0d4cf41..1aaf55f 100644 --- a/buildbot-client.el +++ b/buildbot-client.el @@ -30,7 +30,12 @@ (defvar-local buildbot-host nil "Buildbot instance host.") (defvar-local buildbot-builders nil "Buildbot builders. -Can be generated with `(buildbot-get-all-builders)'.") +Can be generated with `buildbot-get-all-builders'.") +(defgroup buildbot () "A Buildbot client." :group 'web) +(defcustom buildbot-default-host nil + "The default Buildbot instance host." + :group 'buildbot + :type 'string) (defun buildbot-api-change (attr) "Call the Changes API with ATTR." @@ -39,6 +44,13 @@ Can be generated with `(buildbot-get-all-builders)'.") "%s/api/v2/changes?%s" buildbot-host (buildbot-format-attr attr)))) +(defun buildbot-api-change-builds (change-id) + "Call the Changes API with CHANGE-ID to get all builds." + (buildbot-url-fetch-json + (format + "%s/api/v2/changes/%s/builds" + buildbot-host change-id))) + (defun buildbot-api-log (stepid) "Call the Logs API with STEPID." (buildbot-url-fetch-json @@ -120,8 +132,18 @@ Can be generated with `(buildbot-get-all-builders)'.") (defun buildbot-get-changes-by-revision (revision) "Get the changes from a REVISION." - (alist-get 'changes - (buildbot-api-change `((revision . ,revision))))) + (let ((changes + (alist-get 'changes + (buildbot-api-change `((revision . ,revision)))))) + (mapcar + (lambda (change) + (if (assq 'builds change) + change + (cons + (assq 'builds (buildbot-api-change-builds + (alist-get 'changeid change))) + change))) + changes))) (defun buildbot-get-build-by-buildid (buildid) "Get a build with BUILDID." |