From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id GFo2Jb4+fWDwMgAAgWs5BA (envelope-from ) for ; Mon, 19 Apr 2021 10:26:38 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id ULIoIL4+fWB/NwAA1q6Kng (envelope-from ) for ; Mon, 19 Apr 2021 08:26:38 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 093062DBE8 for ; Mon, 19 Apr 2021 10:26:38 +0200 (CEST) Received: from localhost ([::1]:44658 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lYPEr-00021V-3S for larch@yhetil.org; Mon, 19 Apr 2021 04:26:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35780) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lYPEb-00021B-4b for guix-devel@gnu.org; Mon, 19 Apr 2021 04:26:21 -0400 Received: from mira.cbaines.net ([2a01:7e00:e000:2f8:fd4d:b5c7:13fb:3d27]:33823) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lYPEX-0008RR-S7 for guix-devel@gnu.org; Mon, 19 Apr 2021 04:26:20 -0400 Received: from localhost (unknown [IPv6:2a02:8010:68c1:0:8ac0:b4c7:f5c8:7caa]) by mira.cbaines.net (Postfix) with ESMTPSA id 44B0127BC6C; Mon, 19 Apr 2021 09:26:16 +0100 (BST) Received: from capella (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id 251faee6; Mon, 19 Apr 2021 08:26:16 +0000 (UTC) References: <20210414164859.7acc631f@lubrito> <87wnt4x7e3.fsf@cbaines.net> <20210415130947.7387a546@lubrito> <87o8efxhil.fsf@cbaines.net> <20210416120740.05a819ca@lubrito> <87czuuxmdd.fsf@cbaines.net> <20210416154600.62c4a97d@lubrito> <87a6pyxcme.fsf@cbaines.net> <20210416194735.0f4ccaed@lubrito> <877dl1xq15.fsf@cbaines.net> <20210417094857.14599c72@lubrito> <87bladjbsm.fsf@cbaines.net> <20210417110829.03ed516d@lubrito> <875z0kkdp1.fsf@cbaines.net> <20210418101207.3ad239ae@lubrito> <87zgxvimbe.fsf@cbaines.net> <20210418161230.72ecae02@lubrito> User-agent: mu4e 1.4.15; emacs 27.1 From: Christopher Baines To: Luciana Lima Brito Subject: Re: Outreachy - Guix Data Service: implementing basic json output for derivation comparison page In-reply-to: <20210418161230.72ecae02@lubrito> Date: Mon, 19 Apr 2021 09:26:13 +0100 Message-ID: <87r1j6ist6.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Received-SPF: pass client-ip=2a01:7e00:e000:2f8:fd4d:b5c7:13fb:3d27; envelope-from=mail@cbaines.net; helo=mira.cbaines.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: guix-devel@gnu.org Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1618820798; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=o4HcoZ48EF8p+8HewmtJh82PAi1M6W/BZlZ6mxJ8jqc=; b=CK8rRy9vrl7emafd8W3ProUwKFUD0nNpi32q4cc11iNunNI7V+0wdOnPgRRuynMORYdP6a 2HOeYlti4xiofm4ExNjKKwJHNjsV/WLQu8XPDjag4ArxfCIk56GqIyLzzKf1gEunpBqIES kDDkDMzXpRfM/+an3ttVbOVwAnbefItbT4dDPP5WfFWAl9LEi6crDLaSAoLLD4qD3XST0H cFHupFz2CTP8r2Yj2M04kE2GUO1amj1Kg3uZgOUDDMovMejRsE1addfUjFQZtUJZuynMyn TmaklVEx+UszwWlKtmArSZWYEG8oUM3mrAeBANyPR2njkM5teaJnanKqifr4ug== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1618820798; a=rsa-sha256; cv=none; b=LZ54zqLvnxu6MoHlTqmDFf3KHM3cnbcYYbJlETOUmFqmPdPrdNCagyLHrwuXHVbLHm689d Nxg2cVVW29pVzfu+w7QQlsU3BqoChOLcHvzRPeQVhxA22Ilj82xB/mftY2JjaSsf2zpG0f z5SfJsBru0yKAiELSTEGaQnrZFsnKNpMkMX3s9O/HpbbeL6vOi+M2QrQLnUS3iTwKY+yC8 LhSTJNNXPVG/VEHPzseSZslA316L23gIjUwZRvLC0JC18patKAT0FEXqi9Wq+N+Jsf1Wnu 3F5sJJzkxHnvES47FvjHZGa2AqVJDxqEIm0mioP5w5Ctks4cQfYKXufQwz9WRw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Spam-Score: -4.54 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Queue-Id: 093062DBE8 X-Spam-Score: -4.54 X-Migadu-Scanner: scn0.migadu.com X-TUID: gCKNYXp3coMF --=-=-= Content-Type: text/plain Luciana Lima Brito writes: > Hi, > > On Sun, 18 Apr 2021 17:34:13 +0100 > Christopher Baines wrote: > >> I think it might be good to do something, just to narrow the scope. >> The outputs binding is valid for the whole let*, and all the code in >> it, but is only used on three lines, in one single place. Maybe there >> could be a let there that just defines outputs (maybe named >> output-groups so you can use the outputs binding for the overall >> thing). > > I did it. Great :) >> That's a good question, I'd look at the database schema, assuming the >> type of the field is a boolean, the question is whether the field is >> nullable? > > I looked on the database schema, and the "recursive" field is not > nullable, and it is a boolean, so the test I'm doing is working for > this. Cool. >> Hmm, I'm not sure why that is on the HTML page, but I'd generally try >> and keep most bits in the JSON, since it's not as helpful to omit bits >> if they're not that important. > > I added the "common" field for inputs. Ok. >> One other thing I noticed is that the alist for the args is being >> picked apart then reconstructed. Like for the inputs, outputs and >> sources, I'd map over the arguments alist and transform it to the way >> you want it to be. > > This part was a bit more complicated for me to understand. You mean I > should build a function similar to outputs, inputs and sources to map > the arguments, wouldn't it be a lot just to show a vector? As an example, if you have this structure. '((foo . 1) (bar . 2)) and you want the numbers to be strings, you can do something like: (map (match-lambda ((name . number) (cons name (number->string number)))) data) and I think a similar approach for the transformation you're trying to perform to the arguments will more cleanly represent what you're trying to do. One different thing I noticed: ,@(if (not (string? hash-alg)) '() `((hash-algorithm . ,hash-alg))) I'd suggest simplifying this by flipping the different parts of the if, and removing the not. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmB9PqVfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh aW5lcy5uZXQACgkQXiijOwuE9Xfx7RAAjx+GQyWwFbfBkOPXAP49tCvN9m6xlVaB ypsIf2DH5BxitEux5y7bkWYVewJ2RMG4Z9EhjfXg/zjyoiC8xQkgSqw/Dw6f+w1f /p//J5B3q++BNWeFqFdT074CJIHaphE0NjTgc2nCVxfgqY3JwDJ5393gCOhWfHPC OSa88i/76nP8bX0Qt/ApTTqC4KGa5viZIxomq5ecuDe5M2CTmyC2nn/4/i+NgjFx /1GJPynQZFvvouS7sWdzMkt/8B/vr1mJVf8EaMzas1cdV51DsDSbILVjkEHhmk8Y xXatzHPCjNEnjkA4jZzjZmZ9ReSuB8w+t6CGgz3q/TbFlnkYogG4MZk6vyOus/X2 99tILlckcOVGcTMEq43mieSJ1847ZssWmQQY9hIS2eBxudPRTpyC6/BvaCluzZJ2 XSkQWAkVe+Cq74MyFU7RJjVxHP00BG2R30RGTA/bNYM3DEmeynTsn8TESFCPf6Cq XWmCvrPq0E4PTmFfI9mHH3GsWlQXLNv8S1EILvuk1Ueb2gNyiVUCUJIIXceKPBRW FbIbdTn8sR/foYr4aqxrmOFtSxj6WoUjQMWAAy3Ilex+ziq+xkPCqPpOztjQby/d H6ELzRag3IFds9GOd7ojnMXidxZIoT5u/Xn6Nz2TWi5RwU0t3CW6cjeekoAp0u6M yjiEAqQfDbk= =vpv3 -----END PGP SIGNATURE----- --=-=-=--