aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2023-10-27 14:55:35 +0100
committerChristopher Baines <mail@cbaines.net>2023-10-27 14:55:35 +0100
commit57bab27e26627d17f40cd52fceee641d3e1ef825 (patch)
tree31fec88bfc3053a5c8a5534572fddb32800b4488
parent4b0b107b7a226909b75b4e2f3735fb1f2bb12bf1 (diff)
downloadqa-frontpage-57bab27e26627d17f40cd52fceee641d3e1ef825.tar
qa-frontpage-57bab27e26627d17f40cd52fceee641d3e1ef825.tar.gz
Delete the create branch for issue logs
When looking at creating the branch, to ensure the log inserted (if any) is fresh.
-rw-r--r--guix-qa-frontpage/database.scm22
-rw-r--r--guix-qa-frontpage/manage-patch-branches.scm2
2 files changed, 23 insertions, 1 deletions
diff --git a/guix-qa-frontpage/database.scm b/guix-qa-frontpage/database.scm
index 7aab813..af2da53 100644
--- a/guix-qa-frontpage/database.scm
+++ b/guix-qa-frontpage/database.scm
@@ -48,7 +48,8 @@
select-from-builds-to-cancel-later
insert-create-branch-for-issue-log
- select-create-branch-for-issue-log))
+ select-create-branch-for-issue-log
+ delete-create-branch-for-issue-log))
(define-record-type <database>
(make-database database-file reader-thread-channel writer-thread-channel
@@ -617,3 +618,22 @@ WHERE issue = :issue"
(sqlite-reset statement)
result)))))
+
+(define (delete-create-branch-for-issue-log database issue)
+ (database-call-with-transaction
+ database
+ (lambda (db)
+ (let ((statement
+ (sqlite-prepare
+ db
+ "
+DELETE FROM create_branch_for_issue_logs
+WHERE issue = :issue"
+ #:cache? #t)))
+ (sqlite-bind-arguments
+ statement
+ #:issue issue)
+
+ (sqlite-step statement)
+ (sqlite-reset statement))))
+ #t)
diff --git a/guix-qa-frontpage/manage-patch-branches.scm b/guix-qa-frontpage/manage-patch-branches.scm
index 693ff65..204e041 100644
--- a/guix-qa-frontpage/manage-patch-branches.scm
+++ b/guix-qa-frontpage/manage-patch-branches.scm
@@ -301,6 +301,8 @@
(insert-log new-results)
#f)))))))))
+ (delete-create-branch-for-issue-log database issue-number)
+
(if (not (assoc-ref patchwork-series "received_all"))
(simple-format
#t