From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id OMrYEJXngWC9ggEAgWs5BA (envelope-from ) for ; Thu, 22 Apr 2021 23:16:05 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id MG1gDJXngWD4ZgAAbx9fmQ (envelope-from ) for ; Thu, 22 Apr 2021 21:16:05 +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 9E1491A621 for ; Thu, 22 Apr 2021 23:16:04 +0200 (CEST) Received: from localhost ([::1]:33972 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lZgg7-0004Nd-HW for larch@yhetil.org; Thu, 22 Apr 2021 17:16:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49766) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZgfn-0004L4-4G for guix-devel@gnu.org; Thu, 22 Apr 2021 17:15:44 -0400 Received: from mira.cbaines.net ([212.71.252.8]:54794) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lZgfj-0003jz-OC for guix-devel@gnu.org; Thu, 22 Apr 2021 17:15:42 -0400 Received: from localhost (unknown [IPv6:2a02:8010:68c1:0:8ac0:b4c7:f5c8:7caa]) by mira.cbaines.net (Postfix) with ESMTPSA id 092F627BC7C; Thu, 22 Apr 2021 22:15:37 +0100 (BST) Received: from capella (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id 1b36e292; Thu, 22 Apr 2021 21:15:37 +0000 (UTC) References: <20210421152914.461bbdbb@lubrito> <87bla6iwli.fsf@cbaines.net> <20210422170040.37941083@lubrito> <875z0ehyl3.fsf@cbaines.net> <20210422180208.28473e41@lubrito> User-agent: mu4e 1.4.15; emacs 27.1 From: Christopher Baines To: Luciana Lima Brito Subject: Re: Outreachy - Guix Data Service: questions about improving the data for derivation comparisons. In-reply-to: <20210422180208.28473e41@lubrito> Date: Thu, 22 Apr 2021 22:15:34 +0100 Message-ID: <87zgxqggw9.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=1619126164; 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=xGUXeQgno+rSGHK/VmtCmdhRD2Fk7fP1ETQ8N1Yu3zk=; b=CfDZo37dWlTPejESMB+g4ugFAlUzequmF8hIDkEsOnegomJ1S2vDIa63r+oM9Y7HXgpS/o fv/QQ4hf3VS/vGjnrNxdonGmOCNsPCQ44L7LKeq42zepHqOmrlC8rTb72H3giARDGDg2P/ qJDdy5geuZ0g68cRINTxy0jlUmPP/uc8i3yofi8mDuI49VKBe3U1/O45/yEKdj6tl+83jz hP+dGfwVawbxDKjrqPt72/l/lC9eqWQWEHqB482WaaV1At/9v2q1vhOrK+Ty4zG/sqZoyq kO5hh06HxNWFL9HB5jltdY6eh6dQ6Re6rELiiqeIVUz0L0WUCIuoAwViCL7nBg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1619126164; a=rsa-sha256; cv=none; b=lyTOXX9pTjQsCmgwnGZof8DqJSVb+rRCL0tqr8jB1mvtDCgn2dxi8aSQcTkn7gbntsF7aq P/VWbdtS139mXCEJayErjFkbcT+8wd+zfLvhwI1MXIxdnM0zp4Qpy4Jt3BoOEGFCjc3BzF u7nmj8rZ+ZMGTOt/X0G85RQevnZM+1C1LrG7EDchZWsvMqRABTd/Awblj+Op06177747Wh 3nEfX8p71VUSovqoaOi6VU/JeWnzT6q8jdeWPIWRCsJg2hlymQ79uEGBX2CMXZf9mglLf7 O893Qu+w7pwXXgi8RWb/fzp84ek7odLCU9753nVUmS7AFRQePSIJsvXREcKEtA== 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.55 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: 9E1491A621 X-Spam-Score: -4.55 X-Migadu-Scanner: scn0.migadu.com X-TUID: F/kEwvsUrDlB --=-=-= Content-Type: text/plain Luciana Lima Brito writes: > On Thu, 22 Apr 2021 21:08:08 +0100 > Christopher Baines wrote: > >> I'm not quite sure what you mean by empty fields in the JSON here? > > I mean now it appears like this in the json > > hash-alg: {} > > Before, it was entirely omitted. Right, OK. I'd call that an empty object. >> It sounds like you're roughly on the right track, do share what >> changes you're making and then I can have a look. > > This is the part I've changed on comparison.scm in the function > derivation-outputs-differences-data: > > (map (match-lambda > ((output-name path hash-algorithm hash recursive > derivation_ids) > (let ((parsed-derivation-ids > (map string->number > (parse-postgresql-array-string derivation_ids)))) > (list output-name > path > (if (string? hash-algorithm) > hash-algorithm > '()) > (if (string? hash) > hash > '()) > (string=? recursive "t") > (append (if (memq base-derivation-id > parsed-derivation-ids) > '(base) > '()) > (if (memq target-derivation-id > parsed-derivation-ids) > '(target) > '())))))) > (exec-query conn query)) > > Basically, I moved the hash-algorithm, hash, and recursive tests from > controller.scm here. I spent more time familiarizing with this part of > the code and the dataset. I don't have anything ready for the idea I > told you in the last email because I'm not so sure if that is the way > to go, but I can make some experiments in this regard. The bit for the recursive field looks fine. I'd suggest avoiding '() as the value for hash and hash-algorithm when they're NULL in the database. One option here that I've used in some places is to return a alist rather than a list. This can simplify JSON output since it's often a alist that's desired, and can avoid breaking matches when they're matching on the list. Does that make sense? --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmCB53ZfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh aW5lcy5uZXQACgkQXiijOwuE9XeWUg/9HlzeuWL3HqwuqkkwP4OdzJsG9rGimryc XoUSamvOzBZGf07/vzTAoSkcvZeqmxdCVezDTVDg+xgvwBy2tZAdRnKO05eGipbD /j8h7azq8MKVKut+sjm09gU8GXAGUBRpOrv/09NLZ3bkSGew5dRc2ZdDnH0KFraD nkidyI+fbB+nF4Akfg32pqzMiTCMnIJk2o5H0iT+tvg17Ssl+pLEOQOxeF4+Z14d FcMwF9Jurtx9GPrRWlYzZ5X5E3dO/M7WwqTwSGJG+pO42um7AjhMKLC/tMVLwuG2 oomQzfGJLSJ88+rStyHWjoYACzUio/vrAAdowGr7KATwMRI6l/CZ8nZC06D8d9LT Fq3gYVD7JWBNtqtJm0E+Gs99+hEktm1+7LBfxy6CIqEL0k4iWhHCVdH0XSGUgJQU si09epKwmj+Uu6GdRaGebdlHFL31nw4A2KdQcHmSBjXrnPe7pxpYUr5v0nwf8Vpy fM1fudB/FLqYzzJVfkpevCFjfcfI8swLtgYQqy95edFbbfSCwGScDwWZLsea+mwl wTMQDL87yFsWTRIMac7f2lOGzhRYSo4v6Ajl2UXLQfgeXA0S18BNOChJoevWRxjm 12qQPdvyJ3hUoGkDaTdWVJP7kZWv9PzLwI+9x5W+sgr951P5HHnecyytLpKmLSmO /yX46EiJEjk= =JDn5 -----END PGP SIGNATURE----- --=-=-=--