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 8JzTCICidGCLDgAAgWs5BA (envelope-from ) for ; Mon, 12 Apr 2021 21:41:52 +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 WEe9AoCidGDdXgAA1q6Kng (envelope-from ) for ; Mon, 12 Apr 2021 19:41:52 +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 A419929FA9 for ; Mon, 12 Apr 2021 21:41:51 +0200 (CEST) Received: from localhost ([::1]:56786 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lW2RS-0004IM-Km for larch@yhetil.org; Mon, 12 Apr 2021 15:41:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59572) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lW2R6-0004FA-2M for guix-devel@gnu.org; Mon, 12 Apr 2021 15:41:28 -0400 Received: from mira.cbaines.net ([212.71.252.8]:42542) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lW2R3-0003zR-Ap for guix-devel@gnu.org; Mon, 12 Apr 2021 15:41:27 -0400 Received: from localhost (unknown [IPv6:2a02:8010:68c1:0:8ac0:b4c7:f5c8:7caa]) by mira.cbaines.net (Postfix) with ESMTPSA id 9450C27BC72; Mon, 12 Apr 2021 20:41:21 +0100 (BST) Received: from capella (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id 71c727d8; Mon, 12 Apr 2021 19:41:20 +0000 (UTC) References: <20210412121425.628b8260@lubrito> User-agent: mu4e 1.4.15; emacs 27.1 From: Christopher Baines To: Luciana Lima Brito Subject: Re: Guix Data Service - Outreachy: questions about render-compare/derivation In-reply-to: <20210412121425.628b8260@lubrito> Date: Mon, 12 Apr 2021 20:41:18 +0100 Message-ID: <87sg3vz3xd.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=1618256511; 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=TRRkQUOpeCHe02nxI1PwckE6lP7bK8G0dttkrsDw8JM=; b=n8krrDEbeeekLGudu5UOgl5Ayz+YZ0vwD/P/WRY9mug8M28t4snnXskoztzEgUM7K9HzHj 88jjVT+Thq+e3eTK6GyUJ5EtUorTQNwbToGioXeUAxRXVUyZ7msSQPhgKJH4GIhUPCB7L6 bCGQwmsRqb7nlOWanDx2aWh16gmrjnZjCN+1rmirm13D2Gwu4ijU9OyH6g1I57WfCjEOzw srRB6UsEauECv2FW9hYl+oQaS+7rpF+m03NLrM+Z2yOckXVMS1nGtX8YzepE47SHJ29ky0 NDQVZbpi7iQdxQfHwE2YSHlxR80lnXqR9TbcMs+hCFNrloHplF1TUJlLzJ5sEQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1618256511; a=rsa-sha256; cv=none; b=eZ+MNf37oXLc7m5pSY+7Tk2x4zBhGGElRQOI/NvAhE8szmvge0re5IDHITspNNcW/ULSQ1 ZfVPMbFn++MFqHhnr0OMIOYmGboGLTmsE+OO4KTu9LfzCfO7fBzh+n1sD84A2PNz9GSlfs zBZiL9bXOtjFZ1haoq2AHvi7uMJUYptK9Qdv+AKkodZXmAf1hM/xT0pZAKXQ9ZsGg0o+p4 /fCNPLvo+X4D4IMCh86nQmK8Og82UDG/umO3nslzJTJqLvTJ+VS1HVLXJWGh2q2X2VuuYS xPqtWkReBfErDIOIgx1kNbP+AGDKaJfintjea24Ih1/AHWwjIb+G2hE8/Mssug== 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: A419929FA9 X-Spam-Score: -4.54 X-Migadu-Scanner: scn0.migadu.com X-TUID: t8UScWDfyq3l --=-=-= Content-Type: text/plain Luciana Lima Brito writes: > I'm lubrito on Guix IRC, the Outreachy applicant. > > I'm working on the json output for the render-compare/derivation > procedure (controller.scm). Hi lubrito, Good to hear from you. > I would like to know if I am on the right path with what I've > accomplished until now. You've got some JSON being rendered, so you're definitely on the right path :) > The attached .ppm file shows the json I have so far. The json is > showing only the data for the "outputs", but I already got the data for > the rest and I could do the same to them. I am still thinking about how > to make the code cleaner, because the way I'm doing could produce many > redundancies. > > I also would like to know if the general structure of the json is > correct or if it should be different. For example, under "outputs" "0" > is denoting base and "1" is denoting target. > > The current code for the function is here http://sprunge.us/mKkzX2 So, there's no "correct" structure for the JSON, but some structures might better represent the data than others, there's a number of factors to balance. I think an object with base and target names would easier to understand than using an array. Some of the types in the JSON are a bit off as well, part of this is the query processing is not working quite right, but that's a different issue. For the JSON you've got so far, I'd specifically look at the hash, hash-algorithm and recursive fields. hash and hash-algorithm are only set for some outputs (only for fixed output derivations), it would probably be better to have these fields set to null if they don't have a string value, or not included in the object. For recursive, that's a boolean, so it should be a boolean in the JSON too. Hope that helps! Chris --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmB0ol5fFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh aW5lcy5uZXQACgkQXiijOwuE9XefERAApYH1pciHCJZKJHboFRyjJ9qcIYwgz0a/ 5ZdjwCnX/yCohib+n27r5pgRt+grWwFpG2ChZAtGRksodfMKjF604VtwRP9As+nb 2k8jeH3wPcUfAZZKlM7Bh8yxzDMoIzKKVmLE/emqZ406aerUBm1JbzhnoAytwN63 rRl20bXU3vzWQNGEwMAmr5X+lBuAkJXLIuMI0XkWLBXi5FQMur2+eW9JLxK6s4ve lvELa50ZNo2wo+BA4K1kfRk0pqfEPey99kAvqT/FtRwYolQLemOFStLRENPNm2t1 RVIyortbUdxs0Xk3wfjBMMAIwmsZzHOI+x3xR5DOTgeFyKSFLK3cWIUH4tLHlAWR opjWA1WiIUT94jJ+PebiKNCD6biXHIWcjK9HSEY4br1LbmLCp9FYYTARJSWvUDo9 RpJbKVwilcFrZVb9dLpb4d0wEvTaAQg8pbvHbVrulnkMaL+kTaNEJD8X3QUw62Xc iHwIup58523RFrs6dKLKFJR0kaP01OdVISCXxa8KyRdMYCkKuMQXoARMo6PbSkrs BgxbzU4nivqW9ixy3cb7B9utuL08mDpVb48kWfdDp4qaVzV+SadP4nM3+7RBanxD 5H4pL5NWFgqzLbkzS6M4PdwSSHEMn5xpajyuBILZIVuisixa52c3N2tyuujIpruI SR/7E4GlCOQ= =8skt -----END PGP SIGNATURE----- --=-=-=--