diff options
| author | Alex Kost <alezost@gmail.com> | 2018-07-14 12:06:29 +0300 |
|---|---|---|
| committer | Alex Kost <alezost@gmail.com> | 2018-07-16 21:37:19 +0300 |
| commit | 43684ea5d4b9e67ef4ca2a9583e5ce7af433a255 (patch) | |
| tree | 3678a406f399dbc32ee9b65a7d81abcd64b36e5b /build-farm-jobset.el | |
| parent | Add interface for projects ('build-farm-projects' command) (diff) | |
| download | emacs-build-farm-43684ea5d4b9e67ef4ca2a9583e5ce7af433a255.tar.gz | |
Use "project/jobset" for jobset ID
* build-farm-url.el (build-farm-jobset-url): Adjust to accept a single
argument.
* build-farm-jobset.el (build-farm-jobset-id): New function.
(build-farm-jobset-filter-id): Use it.
(build-farm-jobset-info-insert-url): Pass only jobset ID to
'build-farm-jobset-url'.
Diffstat (limited to 'build-farm-jobset.el')
| -rw-r--r-- | build-farm-jobset.el | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/build-farm-jobset.el b/build-farm-jobset.el index 705c663..11953e4 100644 --- a/build-farm-jobset.el +++ b/build-farm-jobset.el @@ -36,6 +36,10 @@ (nrfailed . failed) (nrtotal . total))) +(defun build-farm-jobset-id (project jobset) + "Return jobset ID from PROJECT name and JOBSET name." + (concat project "/" jobset)) + (defun build-farm-jobset-get-display (search-type &rest args) "Search for jobsets and show results. See `build-farm-search-url' for the meaning of SEARCH-TYPE and ARGS." @@ -47,7 +51,9 @@ See `build-farm-search-url' for the meaning of SEARCH-TYPE and ARGS." (defun build-farm-jobset-filter-id (entry) "Add 'ID' parameter to 'jobset' ENTRY." - (cons `(id . ,(bui-entry-non-void-value entry 'name)) + (cons `(id . ,(build-farm-jobset-id + (bui-entry-non-void-value entry 'project) + (bui-entry-non-void-value entry 'name))) entry)) @@ -101,9 +107,7 @@ See `build-farm-search-url' for the meaning of SEARCH-TYPE and ARGS." (defun build-farm-jobset-info-insert-url (entry) "Insert URL for the jobset ENTRY." - (bui-insert-button (build-farm-jobset-url - (bui-entry-non-void-value entry 'project) - (bui-entry-non-void-value entry 'name)) + (bui-insert-button (build-farm-jobset-url (bui-entry-id entry)) 'bui-url) (bui-newline)) @@ -155,6 +159,23 @@ for all ARGS." (interactive (list (build-farm-read-project))) (build-farm-jobset-get-display 'project project)) +;; Info returned for multiple jobsets (from "api/jobsets") and for a +;; single jobset (from "jobset") are completely different! Compare: +;; +;; (build-farm-receive-data "https://hydra.nixos.org/jobset/hydra/master") +;; (build-farm-receive-data "https://hydra.nixos.org/api/jobsets?project=hydra") +;; +;; How this duality can be supported? Maybe make another +;; "jobset-configuration" interface? Anyway, `build-farm-jobset' +;; command is not available yet. + +;; (defun build-farm-jobset (project jobset) +;; "Display JOBSET of PROJECT." +;; (interactive (list (build-farm-read-project) +;; (build-farm-read-jobset project))) +;; (build-farm-jobset-get-display +;; 'id (build-farm-jobset-id project jobset))) + (provide 'build-farm-jobset) ;;; build-farm-jobset.el ends here |
