Support per repository configuration for fetching substitutes

This is so that data.qa.guix.gnu.org can be configured only to query the
branches from the main repository.
This commit is contained in:
Christopher Baines 2022-09-09 12:39:38 +01:00
parent 45e25c2436
commit ad39492cf0
6 changed files with 48 additions and 15 deletions

View file

@ -22,6 +22,7 @@
#:use-module (guix-data-service model utils)
#:export (all-git-repositories
select-git-repository
git-repository-query-substitutes?
git-repository-id->url
select-includes-and-excluded-branches-for-git-repository
count-git-repositories-with-x-git-repo-header-values
@ -57,6 +58,14 @@
cgit_url_base
(string=? fetch_with_authentication "t")))))
(define (git-repository-query-substitutes? conn id)
(match (exec-query
conn
"SELECT query_substitutes FROM git_repositories WHERE id = $1"
(list (simple-format #f "~A" id)))
(((query_substitutes))
(string=? query_substitutes "t"))))
(define (git-repository-id->url conn id)
(match
(exec-query