From 57bab27e26627d17f40cd52fceee641d3e1ef825 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Fri, 27 Oct 2023 14:55:35 +0100 Subject: Delete the create branch for issue logs When looking at creating the branch, to ensure the log inserted (if any) is fresh. --- guix-qa-frontpage/database.scm | 22 +++++++++++++++++++++- guix-qa-frontpage/manage-patch-branches.scm | 2 ++ 2 files changed, 23 insertions(+), 1 deletion(-) (limited to 'guix-qa-frontpage') 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 (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 -- cgit v1.2.3