aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2020-02-01 14:03:26 +0100
committerChristopher Baines <mail@cbaines.net>2020-02-01 14:03:26 +0100
commit381acf312e5efd740cd057312a8b53351d30586b (patch)
treedb3483f7a67ecead4d2d442d4108854a2aa0472d
parent671a85f798ace3b606bd0f83f90774c01e3f97de (diff)
downloaddata-service-381acf312e5efd740cd057312a8b53351d30586b.tar
data-service-381acf312e5efd740cd057312a8b53351d30586b.tar.gz
Warn if process-branch-updated-mbox won't match any emails
-rw-r--r--scripts/guix-data-service-process-branch-updated-mbox.in11
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/guix-data-service-process-branch-updated-mbox.in b/scripts/guix-data-service-process-branch-updated-mbox.in
index 7184e74..0a79f40 100644
--- a/scripts/guix-data-service-process-branch-updated-mbox.in
+++ b/scripts/guix-data-service-process-branch-updated-mbox.in
@@ -28,11 +28,22 @@
(squee)
(email email)
(guix-data-service database)
+ (guix-data-service model git-repository)
(guix-data-service branch-updated-emails))
(with-postgresql-connection
"process-branch-updated-mbox"
(lambda (conn)
+ (let ((count
+ (count-git-repositories-with-x-git-repo-header-values conn)))
+ (when (eq? count 0)
+ (display
+ "\nerror: no git_repositories exist with a value for x_git_repo_header
+error: to match emails to repositories, the git_repositories entry must have
+a x_git_repo_header value\n"
+ (current-error-port))
+ (exit 1)))
+
(for-each
(lambda (file)
(simple-format (current-error-port)