diff options
author | Christopher Baines <mail@cbaines.net> | 2025-01-12 20:48:24 +0000 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2025-01-12 21:51:39 +0000 |
commit | af97c8501489aec5831600dbf5ddac34aded5a8e (patch) | |
tree | 4ba9667effd33bd86e14bf9d586536e0413a2d25 | |
parent | 3fbf9676840a8634a2ae00668e8335e952b5867e (diff) | |
download | qa-frontpage-af97c8501489aec5831600dbf5ddac34aded5a8e.tar qa-frontpage-af97c8501489aec5831600dbf5ddac34aded5a8e.tar.gz |
Avoid repeatedly recreating issue branches if the branch doesn't exist
At least in the data service.
-rw-r--r-- | guix-qa-frontpage/manage-patch-branches.scm | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/guix-qa-frontpage/manage-patch-branches.scm b/guix-qa-frontpage/manage-patch-branches.scm index 634cefe..4142e7d 100644 --- a/guix-qa-frontpage/manage-patch-branches.scm +++ b/guix-qa-frontpage/manage-patch-branches.scm @@ -24,6 +24,7 @@ #:use-module (guix-qa-frontpage database) #:use-module (guix-qa-frontpage git-repository) #:use-module (guix-qa-frontpage patchwork) + #:use-module (guix-qa-frontpage branch) #:use-module (guix-qa-frontpage guix-data-service) #:export (create-branch-for-issue @@ -325,7 +326,10 @@ #:args `(#:count ,(+ series-count series-count-buffer)) #:ttl 120)) (get-latest-processed-branch-revision* - (memoize get-latest-processed-branch-revision))) + (memoize get-latest-processed-branch-revision)) + (branches + (cons "master" + (map car (list-non-master-branches))))) ;; Several series can use the same base revision, so memoize looking up ;; the changes compared to master @@ -344,6 +348,7 @@ (simple-format #t "checking for branches to delete (looking at ~A branches)\n" (length issue-numbers)) + (simple-format #t "all branches: ~A\n" branches) (for-each (lambda (issue-number) (when (or (if (not (mumi-issue-open? issue-number)) @@ -376,7 +381,11 @@ "query_parameters" "base_commit" "message") (lambda (message) - (string=? message "unknown commit")))) + (string=? message "unknown commit"))) + ;; Don't treat the base revision + ;; as gone if the branch is + ;; unknown + (member branch branches)) (begin (simple-format (current-error-port) |