2
0
Fork 0
mirror of git://git.savannah.gnu.org/guix/guix-cuirass.git synced 2023-12-14 06:03:04 +01:00

database: Document the pitfalls of ‘db-get-checkouts’.

* src/cuirass/base.scm (latest-checkouts): Improve docstring.
* src/cuirass/database.scm (db-get-checkouts): Add docstring.
This commit is contained in:
Ludovic Courtès 2023-09-06 23:39:25 +02:00
parent 7a9194b15e
commit a057228492
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
2 changed files with 9 additions and 2 deletions

View file

@ -640,8 +640,9 @@ OUTPUTS, a list of <build-output> records."
(apply latest-channel-instances args)))
(define (latest-checkouts spec eval-id)
"Return the latest checkouts for the EVAL-ID evaluation of the SPEC
specification."
"Return the complete list of checkouts used for the EVAL-ID evaluation of
SPEC (as opposed to 'db-get-checkouts', which only returns checkouts that
different from the previous evaluation of SPEC)."
(let ((name (specification-name spec))
(channels (specification-channels spec)))
(map (lambda (channel)

View file

@ -1613,6 +1613,12 @@ SELECT id FROM pending_dependencies WHERE deps = 0 LIMIT 1;"))
(directory checkout-directory))
(define (db-get-checkouts eval-id)
"Return the list of checkouts *changed* in EVAL-ID.
For example, if channel A moved from one commit to another, triggering
EVAL-ID, then channel A is returned. But perhaps EVAL-ID also depends on
channels B and C, which are not returned here because they haven't changed
compared to the previous evaluation of this jobset."
(with-db-worker-thread db
(let loop ((rows (exec-query/bind
db "SELECT revision, channel, directory FROM Checkouts