From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id MIcgDyfKeGCf8AAAgWs5BA (envelope-from ) for ; Fri, 16 Apr 2021 01:20:07 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id SILcCCfKeGDCaQAAB5/wlQ (envelope-from ) for ; Thu, 15 Apr 2021 23:20:07 +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 BA87EDDBC for ; Fri, 16 Apr 2021 01:20:06 +0200 (CEST) Received: from localhost ([::1]:57654 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lXBHJ-0005Iu-Tt for larch@yhetil.org; Thu, 15 Apr 2021 19:20:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60676) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lXBH7-0005IY-4d for guix-devel@gnu.org; Thu, 15 Apr 2021 19:19:53 -0400 Received: from mira.cbaines.net ([212.71.252.8]:46532) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lXBH5-0005hD-87 for guix-devel@gnu.org; Thu, 15 Apr 2021 19:19:52 -0400 Received: from localhost (unknown [IPv6:2a02:8010:68c1:0:8ac0:b4c7:f5c8:7caa]) by mira.cbaines.net (Postfix) with ESMTPSA id CF83727BC76; Fri, 16 Apr 2021 00:19:49 +0100 (BST) Received: from capella (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id 186890b7; Thu, 15 Apr 2021 23:19:49 +0000 (UTC) References: <20210414164859.7acc631f@lubrito> <87wnt4x7e3.fsf@cbaines.net> <20210415130947.7387a546@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: <20210415130947.7387a546@lubrito> Date: Fri, 16 Apr 2021 00:19:46 +0100 Message-ID: <87o8efxhil.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Received-SPF: pass client-ip=212.71.252.8; 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=1618528806; 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=3AIzcAlm2vTONN/22dI6VFZCMlTb7zJ/f+SLi2iPozY=; b=D81qJwHb1Ae75BTwDSoKFXPc4dkyYvDEdDzv+fwTcBTF9HDLF+QxRm882CyPdkJthlqA02 aYS3lUVycFxlujBVEotFdaT/8oO1eB4wRlPVsyiOsU+sW09jmDxpyHwmZyTjSvOnnBXfZx VuL9TWepFT18LLyVaOgOObMJuM7PGMLc2h028mePcMgOBxC5+jsDV4yNtWMKmCfB+O1CgI GDz5fUmGio2+tMy4hiFzSjgzB+fqBo6I1ooCNWE4zzMBQw5Rs7hImHcIQh6xqj4jyb0kzJ 9atMEWcvI70GaiBEptP5M4+BtnuyoA/XAIP4aX7jFly76yrS38VLT8OS9EcCBw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1618528806; a=rsa-sha256; cv=none; b=J/BTxWLtIQOcFydQxTcNQ9lF1hfeS8kPDFEufMIEdBptfTlyLg89UX98AFBt/FLeqzFyuf M8E3vAjUYomzVoNQPaN9dhU9yDkBhEC5VgiTJTiXuzYKQni/bC79Ny19w7MLIVGcnCb1zH B29NN0oUjPAPgUiVQs2EyrgKvWDjQFLLwHSK7qqtZGVf+WJrA+YS9HaZkEp9dAIvmqPKEX 2w5juhnTTtkbirJsKkYoUtyxj9VJ49/eWVTJI5j29TpY6gKuQ0or5EB/OnI9WqT7mc422I /kEpKYKRoQvogk3nsqH/ba+bvJi6G68RpCbV5CnoHgRBWN1OLpU7ab5zJ/XHnQ== 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: BA87EDDBC X-Spam-Score: -4.54 X-Migadu-Scanner: scn0.migadu.com X-TUID: v+c9Uzadnj/V --=-=-= Content-Type: text/plain Luciana Lima Brito writes: > On Thu, 15 Apr 2021 09:46:12 +0100 > Christopher Baines wrote: > > Hi, > >> I'm not quite sure how to apply this, I'd suggest using git >> format-patch to generate the file next time as I think there would >> normally be some metadata along with the diff. > > I tried using git format-patch and I got 7 patches from my 7 commits, > then I generate a single patch output, which is attached. > The last commit before my modifications is this: > 410f58cb43f083623885a430700c6818a187cadc Ok, I looked at the overall diff, and it looks to me like these changes should probably be one commit. >> I would consider whether it's useful to have all these let blocks, and >> whether here is the right place for them. > >> Taking a binding like outputs, it's only used in a later let. You can >> do something like this (with let*) to remove the need to have >> multiple let blocks. > >> Also, since matched-outputs is only used when rendering the JSON, I'd >> move all the bindings that are only used for the JSON output within >> that part of the case statement, so that it's clearer that they only >> apply to that bit of the code. >> >> Does that make sense? > > I did it, I used the let* and this helped a lot. I also moved > everything into the case branch of the json. > >> I'm not sure what revision here referrs to. > > It was a placeholder, but now I removed it. > >> I hope that helps, just let me know if you have any questions, > > The function get-derivation-data does not depend on anything, don't you > think it goes better in another place outside render-compare/derivation? On the get-derivation-data function, I wouldn't use the same function to process the inputs, outputs and sources. The data for each is different, so I would separate the code as well. To avoid having to call a procedure three times, on the base, target and common items, I'd consider following the same pattern in the HTML generating code, map over a list of the lists, so something like: (map (lambda (name data) (cons name (match data ((name path hash-alg hash recursive) ...)))) '(base target common) (list (assq-ref outputs 'base) (assq-ref outputs 'target) (assq-ref outputs 'common))) Does that make sense? --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmB4yhJfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh aW5lcy5uZXQACgkQXiijOwuE9Xd1gxAAjuAdJKrLqqE5XjCpVvoPfWPve/VzBi3W tx+qBtq76xvnc/6YmTaI4hmPl1kkBnruoE4gt7rMcWgkmEfEgefMDNS50pj1HkxM yBqD7xCxSiDSmN0jNu64RDR5eg4KDxUEGzkbcW8OgoKWM9KB2MH+va+G2tzDJm06 8PsW/VCRjxabveQlZowKm+GrXO2u9XwQUMyyPdoXLGkdAXG/CeCgFJ35/GFJj4uU 28nCusMXnr/4SOBaPwQz49sEIse8cv5mnOFlv2XIv/+TmHYBwI8MB/0o3UC8+Web nu7lKp9C4X/1V/FhO7Si3BytYgICVeT3fSNTZ8vHTQ2zYUsN6HZb4281GL+HtHHP 1Id5fQ4E4MbFipN2nUOA1z5XLhKXEE6qeE+BFJFgtvjOjKfm1AjH1qxUdQSxGjbX wCCTp3uzhrRJrdhwioOdbadllArZD+GI7QqZwz/VYshSq1qfomWzwTz6lX2a5TWw jyj5yq2kDd6du5hdgMcjOQ6JQa7UKzAIPuoOA7lxQ4/9c9u+s8p+SjrceWF6EqAv O/BtDeuTzUI9Fi2yGNEsO1wRS+tpLfF2X8rcIUUPdAqNw0krjqbJesBqbUa1+Y0b QF/UruFPu09bfbHyWVqNvpb2Iex089PlnflEk7Fe9uYLEWQHajPpE4S8zWnaKe+M OfF9fs+aZ+c= =rHLW -----END PGP SIGNATURE----- --=-=-=--