unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: "Clément Lassieur" <clement@lassieur.org>
Cc: 32424@debbugs.gnu.org
Subject: [bug#32424] [PATCH] database: Add a Checkouts table.
Date: Mon, 20 Aug 2018 22:53:37 +0200	[thread overview]
Message-ID: <876004bvzi.fsf@gnu.org> (raw)
In-Reply-To: <20180811222636.5198-1-clement@lassieur.org> ("Clément Lassieur"'s message of "Sun, 12 Aug 2018 00:26:36 +0200")

Hello,

Clément Lassieur <clement@lassieur.org> skribis:

> It is used to know when a new evaluation must be triggered and to display
> input changes.
>
> * Makefile.am (dist_sql_DATA): Add 'src/sql/upgrade-3.sql'.
> * bin/evaluate.in (input-checkout, format-checkouts): Rename '#:name' to
> '#:input'.
> * doc/cuirass.texi (Stamps): Remove section.
> (Checkouts): New section.
> * src/cuirass/base.scm (fetch-input, fetch-inputs, compile-checkouts): Rename
> '#:name' to '#:input'.
> (evaluate): Remove the COMMITS argument.  Add an EVAL-ID argument.  Don't call
> DB-ADD-EVALUATION because it was called sooner.  Remove the EVAL-ID argument
> to AUGMENT-JOB because it's a closure.
> (build-packages): Add an EVAL-ID argument.  Call DB-SET-EVALUATION-DONE once
> all the derivations are registered.
> (process-specs): Replace the stamping mechanism by the primary key constraint
> of the Checkouts table: call "evaluate" only when DB-ADD-EVALUATION is true,
> which means that at least one checkout was added.  Change the EVALUATE and
> BUILD-PACKAGES arguments accordingly.
> * src/cuirass/database.scm (db-add-stamp, db-get-stamp): Remove procedures.
> (db-set-evaluation-done): New exported procedure.
> (db-add-checkout): New procedure that returns #f if a checkout with the same
> revision already exists.
> (db-add-evaluation): Replace the EVAL argument with a SPEC-NAME and a
> CHECKOUTS arguments.  Insert the evaluation only if at least one checkout was
> inserted.  Return #f otherwise.
> (db-get-checkouts): New procedure.
> (db-get-evaluations, db-get-evaluations-build-summary): Handle the
> 'in_progress' column, remove the 'commits' column.  Return the result of
> DB-GET-CHECKOUTS as part of the evaluation.
> * src/cuirass/templates.scm (input-changes, evaluation-badges): New
> procedures.
> (evaluation-info-table): Rename "Commits" to "Input changes".  Use
> INPUT-CHANGES to display the input changes that triggered the evaluation.  Use
> EVALUATION-BADGES to display a message indicating that the evaluation is in
> progress.
> * src/schema.sql (Stamps): Remove table.
> (Checkouts): New table.
> (Evaluations): Remove the 'commits' column.  Add an 'in_progress' column.
> * src/sql/upgrade-3.sql: New file with SQL queries to upgrade the database.
> * tests/database.scm (make-dummy-eval): Remove procedure.
> (make-dummy-checkouts): New procedure.
> ("sqlite-exec"): Remove the 'commits' column.  Add the 'in_progress' column.
> ("db-update-build-status!", "db-get-builds", "db-get-pending-derivations"):
> Update the arguments of DB-ADD-EVALUATION accordingly.
> * tests/http.scm (hash-table=?): Add support for lists of hash tables.
> (evaluations-query-result): Replace '#:commits' with '#:checkouts'.  Return a
> list instead of returning one element, for symmetry.
> ("fill-db"): Add a new input so that the second checkout can refer to it.
> Replace EVALUATION1 and EVALUATION2 with CHECKOUTS1 and CHECKOUTS2.  Update
> the arguments of DB-ADD-EVALUATION accordingly.
> ("/api/queue?nr=100"): Take the CAR of the EVALUATIONS-QUERY-RESULT list to
> make it symmetrical with the other argument of HASH-TABLE=?.

Woow!  I really like the result (nice screenshot ;-)).  I took only a
cursory look at the code, but you’re the expert now anyway, so if it
works for you, got for it!  The new ‘Checkouts’ table make sense to me.

> +         (log-message "Evaluation ~a for '~a' completed" eval-id spec-name)

Nitpick: I prefer not to capitalize log messages because these are not
full sentences.  (No big deal though.)

Thank you!

Ludo’.

  parent reply	other threads:[~2018-08-20 20:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-11 22:26 [bug#32424] [PATCH] database: Add a Checkouts table Clément Lassieur
2018-08-11 22:39 ` Clément Lassieur
2018-08-20 20:53 ` Ludovic Courtès [this message]
2018-08-27 13:47   ` bug#32424: " Clément Lassieur

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=876004bvzi.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=32424@debbugs.gnu.org \
    --cc=clement@lassieur.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).