From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37608) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f8uCP-0006YR-Hg for guix-patches@gnu.org; Wed, 18 Apr 2018 17:01:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f8uCM-0002wK-HN for guix-patches@gnu.org; Wed, 18 Apr 2018 17:01:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:51821) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f8uCM-0002vT-Dy for guix-patches@gnu.org; Wed, 18 Apr 2018 17:01:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1f8uCM-0003gT-3j for guix-patches@gnu.org; Wed, 18 Apr 2018 17:01:02 -0400 Subject: [bug#31197] [PATCH] http: Add /api/evaluations route. Resent-Message-ID: From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <1523976961-7467-1-git-send-email-m.othacehe@gmail.com> Date: Wed, 18 Apr 2018 23:00:10 +0200 In-Reply-To: <1523976961-7467-1-git-send-email-m.othacehe@gmail.com> (Mathieu Othacehe's message of "Tue, 17 Apr 2018 16:56:01 +0200") Message-ID: <87po2wtelh.fsf@gnu.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: Mathieu Othacehe Cc: 31197@debbugs.gnu.org Hello Mathieu, Mathieu Othacehe skribis: > * src/cuirass/database.scm (db-get-evaluations): New exported procedure. > * src/cuirass/http.scm (url-handler): Add /api/evaluations route. > * tests/http.scm ("http"): Add /api/evaluations test route. > --- > Hi Guix, > > Here's a patch to add /api/evaluations route. It allows to know which > guix commit have been fully evaluated and builded by cuirass before > checkouting them. Awesome, I had been missing it. :-) Hydra doesn=E2=80=99t have such a thing apparently. We should discuss with= Alex Kost to add support for it in Emacs-Guix. > +(define (db-get-evaluations db) > + (let loop ((rows (sqlite-exec db "SELECT * FROM Evaluations;")) > + (evaluations '())) I think we should add a LIMIT and ORDER, like we do for =E2=80=98db-get-bui= lds=E2=80=99, to avoid sending too much data to clients and consing too much. Could you try that? Later we could add =E2=80=9Cfilters=E2=80=9D to select evaluations from one= project or branch. > + (match rows > + (() evaluations) Rather (reverse evaluations). > + (with-critical-section db-channel (db) > + (db-get-evaluations db))))) Rather: (with-critical-section db-channel (db) (db-get-evaluations db)) Normally, =E2=80=98dir-locals.el=E2=80=99 has the right rule for this. Thanks! Ludo=E2=80=99.