Use the git repository fetch with authentication value

This commit is contained in:
Christopher Baines 2020-10-07 18:51:30 +01:00
parent 9f9c23010e
commit 03ea66cf33
2 changed files with 25 additions and 13 deletions

View file

@ -857,7 +857,8 @@ WHERE job_id = $1"
(build-derivations store (list derivation))) (build-derivations store (list derivation)))
(derivation->output-path derivation))) (derivation->output-path derivation)))
(define (channel->derivation-file-names-by-system conn store channel) (define (channel->derivation-file-names-by-system conn store channel
fetch-with-authentication?)
(define use-container? (defined? (define use-container? (defined?
'open-inferior/container 'open-inferior/container
(resolve-module '(guix inferior)))) (resolve-module '(guix inferior))))
@ -967,7 +968,9 @@ WHERE job_id = $1"
(lambda () (lambda ()
(first (first
(latest-channel-instances store (latest-channel-instances store
(list channel))))))) (list channel)
#:authenticate?
fetch-with-authentication?))))))
(inferior-eval '(use-modules (srfi srfi-1) (inferior-eval '(use-modules (srfi srfi-1)
(guix channels) (guix channels)
(guix grafts) (guix grafts)
@ -1007,10 +1010,14 @@ WHERE job_id = $1"
(close-inferior inferior) (close-inferior inferior)
#f)))) #f))))
(define (channel->derivations-by-system conn store channel) (define (channel->derivations-by-system conn store channel
(let* ((derivation-file-names-by-system fetch-with-authentication?)
(let ((derivation-file-names-by-system
(with-time-logging "computing the channel derivation" (with-time-logging "computing the channel derivation"
(channel->derivation-file-names-by-system conn store channel)))) (channel->derivation-file-names-by-system conn
store
channel
fetch-with-authentication?))))
(for-each (for-each
(match-lambda (match-lambda
((system . derivation-file-name) ((system . derivation-file-name)
@ -1255,16 +1262,21 @@ WHERE job_id = $1"
(prevent-inlining-for-tests extract-information-from) (prevent-inlining-for-tests extract-information-from)
(define (load-new-guix-revision conn store git-repository-id commit) (define (load-new-guix-revision conn store git-repository-id commit)
(let* ((channel-for-commit (let* ((git-repository-fields
(select-git-repository conn git-repository-id))
(git-repository-url
(second git-repository-fields))
(fetch-with-authentication?
(fourth git-repository-fields))
(channel-for-commit
(channel (name 'guix) (channel (name 'guix)
(url (git-repository-id->url (url git-repository-url)
conn
git-repository-id))
(commit commit))) (commit commit)))
(channel-derivations-by-system (channel-derivations-by-system
(channel->derivations-by-system conn (channel->derivations-by-system conn
store store
channel-for-commit)) channel-for-commit
fetch-with-authentication?))
(store-item (store-item
(channel-derivations-by-system->guix-store-item (channel-derivations-by-system->guix-store-item
store store

View file

@ -38,7 +38,7 @@
(mock (mock
((guix-data-service jobs load-new-guix-revision) ((guix-data-service jobs load-new-guix-revision)
channel->derivations-by-system channel->derivations-by-system
(lambda (conn store channel) (lambda (conn store channel fetch-with-authentication?)
'((x86_64-linux '((x86_64-linux
. .
((manifest-entry-item . /gnu/store/foo.drv) ((manifest-entry-item . /gnu/store/foo.drv)
@ -96,7 +96,7 @@
(mock (mock
((guix-data-service jobs load-new-guix-revision) ((guix-data-service jobs load-new-guix-revision)
channel->derivations-by-system channel->derivations-by-system
(lambda (conn store channel) (lambda (conn store channel fetch-with-authentication?)
'(x86_64-linux '(x86_64-linux
. .
((manifest-entry-item . /gnu/store/foo.drv) ((manifest-entry-item . /gnu/store/foo.drv)