From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33872) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fuI6P-0003G4-EU for guix-patches@gnu.org; Mon, 27 Aug 2018 10:02:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fuHt8-00082Q-46 for guix-patches@gnu.org; Mon, 27 Aug 2018 09:49:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:56911) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fuHt8-00082M-04 for guix-patches@gnu.org; Mon, 27 Aug 2018 09:49:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fuHt7-0005F6-U9 for guix-patches@gnu.org; Mon, 27 Aug 2018 09:49:01 -0400 Subject: bug#32424: [PATCH] database: Add a Checkouts table. Resent-To: guix-patches@gnu.org Resent-Message-ID: References: <20180811222636.5198-1-clement@lassieur.org> <876004bvzi.fsf@gnu.org> From: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur In-reply-to: <876004bvzi.fsf@gnu.org> Date: Mon, 27 Aug 2018 15:47:50 +0200 Message-ID: <877ekbc455.fsf@lassieur.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 32424-done@debbugs.gnu.org Ludovic Court=C3=A8s writes: > Hello, > > Cl=C3=A9ment Lassieur 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): R= ename >> '#: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 argu= ment >> 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 const= raint >> of the Checkouts table: call "evaluate" only when DB-ADD-EVALUATION is t= rue, >> which means that at least one checkout was added. Change the EVALUATE a= nd >> BUILD-PACKAGES arguments accordingly. >> * src/cuirass/database.scm (db-add-stamp, db-get-stamp): Remove procedur= es. >> (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 checkou= t 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 databa= se. >> * tests/database.scm (make-dummy-eval): Remove procedure. >> (make-dummy-checkouts): New procedure. >> ("sqlite-exec"): Remove the 'commits' column. Add the 'in_progress' col= umn. >> ("db-update-build-status!", "db-get-builds", "db-get-pending-derivations= "): >> Update the arguments of DB-ADD-EVALUATION accordingly. >> * tests/http.scm (hash-table=3D?): Add support for lists of hash tables. >> (evaluations-query-result): Replace '#:commits' with '#:checkouts'. Ret= urn 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. Upd= ate >> the arguments of DB-ADD-EVALUATION accordingly. >> ("/api/queue?nr=3D100"): Take the CAR of the EVALUATIONS-QUERY-RESULT li= st to >> make it symmetrical with the other argument of HASH-TABLE=3D?. > > Woow! I really like the result (nice screenshot ;-)). I took only a > cursory look at the code, but you=E2=80=99re the expert now anyway, so if= it > works for you, got for it! The new =E2=80=98Checkouts=E2=80=99 table mak= e sense to me. > >> + (log-message "Evaluation ~a for '~a' completed" eval-id spec-n= ame) > > Nitpick: I prefer not to capitalize log messages because these are not > full sentences. (No big deal though.) > > Thank you! > > Ludo=E2=80=99. Pushed with that change. Thanks!