Refactor channel handling in the load-new-guix-revision module
To allow for passing the channel to channel-news-for-commit.
This commit is contained in:
parent
7c611402a0
commit
66d726f1fd
2 changed files with 21 additions and 24 deletions
|
|
@ -897,21 +897,6 @@ WHERE job_id = $1"
|
||||||
(lambda (key . args)
|
(lambda (key . args)
|
||||||
(display-backtrace (make-stack #t) (current-error-port)))))))
|
(display-backtrace (make-stack #t) (current-error-port)))))))
|
||||||
|
|
||||||
|
|
||||||
(define (store-item-for-git-repository-id-and-commit
|
|
||||||
conn git-repository-id commit)
|
|
||||||
(with-store store
|
|
||||||
(set-build-options store
|
|
||||||
#:fallback? #t)
|
|
||||||
(channel->guix-store-item
|
|
||||||
conn
|
|
||||||
store
|
|
||||||
(channel (name 'guix)
|
|
||||||
(url (git-repository-id->url
|
|
||||||
conn
|
|
||||||
git-repository-id))
|
|
||||||
(commit commit)))))
|
|
||||||
|
|
||||||
(define (update-package-versions-table conn git-repository-id commit)
|
(define (update-package-versions-table conn git-repository-id commit)
|
||||||
;; Lock the table to wait for other transactions to commit before updating
|
;; Lock the table to wait for other transactions to commit before updating
|
||||||
;; the table
|
;; the table
|
||||||
|
|
@ -1044,10 +1029,22 @@ ORDER BY packages.name, packages.version"
|
||||||
|
|
||||||
#t)
|
#t)
|
||||||
|
|
||||||
|
(define (store-item-for-channel conn channel)
|
||||||
|
(with-store store
|
||||||
|
(set-build-options store #:fallback? #t)
|
||||||
|
(channel->guix-store-item conn
|
||||||
|
store
|
||||||
|
channel)))
|
||||||
|
|
||||||
(define (load-new-guix-revision conn git-repository-id commit)
|
(define (load-new-guix-revision conn git-repository-id commit)
|
||||||
(let ((store-item
|
(let* ((channel-for-commit
|
||||||
(store-item-for-git-repository-id-and-commit
|
(channel (name 'guix)
|
||||||
conn git-repository-id commit)))
|
(url (git-repository-id->url
|
||||||
|
conn
|
||||||
|
git-repository-id))
|
||||||
|
(commit commit)))
|
||||||
|
(store-item
|
||||||
|
(store-item-for-channel conn channel-for-commit)))
|
||||||
(if store-item
|
(if store-item
|
||||||
(and
|
(and
|
||||||
(extract-information-from conn git-repository-id
|
(extract-information-from conn git-repository-id
|
||||||
|
|
|
||||||
|
|
@ -22,8 +22,8 @@
|
||||||
#t
|
#t
|
||||||
(mock
|
(mock
|
||||||
((guix-data-service jobs load-new-guix-revision)
|
((guix-data-service jobs load-new-guix-revision)
|
||||||
store-item-for-git-repository-id-and-commit
|
store-item-for-channel
|
||||||
(lambda (conn git-repository-id commit)
|
(lambda (conn channel)
|
||||||
"/gnu/store/test"))
|
"/gnu/store/test"))
|
||||||
|
|
||||||
(mock
|
(mock
|
||||||
|
|
@ -46,8 +46,8 @@
|
||||||
#f
|
#f
|
||||||
(mock
|
(mock
|
||||||
((guix-data-service jobs load-new-guix-revision)
|
((guix-data-service jobs load-new-guix-revision)
|
||||||
store-item-for-git-repository-id-and-commit
|
store-item-for-channel
|
||||||
(lambda (conn git-repository-id commit)
|
(lambda (conn channel)
|
||||||
#f))
|
#f))
|
||||||
|
|
||||||
(match (enqueue-load-new-guix-revision-job
|
(match (enqueue-load-new-guix-revision-job
|
||||||
|
|
@ -64,8 +64,8 @@
|
||||||
#f
|
#f
|
||||||
(mock
|
(mock
|
||||||
((guix-data-service jobs load-new-guix-revision)
|
((guix-data-service jobs load-new-guix-revision)
|
||||||
store-item-for-git-repository-id-and-commit
|
store-item-for-channel
|
||||||
(lambda (conn git-repository-id commit)
|
(lambda (conn channel)
|
||||||
"/gnu/store/test"))
|
"/gnu/store/test"))
|
||||||
|
|
||||||
(mock
|
(mock
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue