diff options
author | Yuchen Pei <id@ypei.org> | 2023-07-23 15:39:30 +1000 |
---|---|---|
committer | Yuchen Pei <id@ypei.org> | 2023-07-23 15:39:30 +1000 |
commit | 54176e05e9391ec3c7e7d5ec50e0a2c2a6d4ef7b (patch) | |
tree | 46f9143850d256e83fcdbf4c8810f326b48e62e4 /buildbot-utils.el | |
parent | f83633a34c54967c35bdc3a1bb157e13c30db64f (diff) |
Adding indirect branch / revision filtering
Most instances seem to not support direct branch / revision filtering
in Changes API requests, that is, requests such as
<host>/api/v2/changes?revision=<revision-id>
timeout or return an error code.
In such cases, we issue a more general API request, and filter the
response by revision:
<host>/api/v2/changes?limit=<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.
Diffstat (limited to 'buildbot-utils.el')
-rw-r--r-- | buildbot-utils.el | 10 |
1 files changed, 6 insertions, 4 deletions
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." |