From 54176e05e9391ec3c7e7d5ec50e0a2c2a6d4ef7b Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Sun, 23 Jul 2023 15:39:30 +1000 Subject: Adding indirect branch / revision filtering Most instances seem to not support direct branch / revision filtering in Changes API requests, that is, requests such as /api/v2/changes?revision= timeout or return an error code. In such cases, we issue a more general API request, and filter the response by revision: /api/v2/changes?limit=&order=-changeid We add a new custom var `buildbot-api-changes-direct-filter' to control the relevant behaviour. The mariadb instance seems to be the only instance that work better with direct filtering, whereas python and buildbot seems to work with both, and the remaining instances only supporting indirect filtering. We also add a few more custom vars for limiting in API requests, and fix some regressions introduced in the previous commit, about setting the host. --- buildbot-utils.el | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'buildbot-utils.el') diff --git a/buildbot-utils.el b/buildbot-utils.el index f28ab75..538844e 100644 --- a/buildbot-utils.el +++ b/buildbot-utils.el @@ -97,10 +97,12 @@ With non-nil WITH-HEADER, include the header in the result." (defun buildbot-format-attr (attr) "Format an alist ATTR into a url query string." - (string-join (mapcar (lambda (pair) - (format "%s=%s" (car pair) (cdr pair))) - attr) - "&")) + (string-join + (mapcar + (lambda (pair) + (format "%s=%s" (car pair) (cdr pair))) + (seq-filter #'cdr attr)) + "&")) (defun buildbot-format-epoch-time (epoch) "Format an EPOCH." -- cgit v1.2.3