all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Christopher Baines <mail@cbaines.net>
To: Luciana Lima Brito <lubrito@posteo.net>
Cc: guix-devel@gnu.org
Subject: Re: Outreachy - Guix Data Service: implementing basic json output for derivation comparison page
Date: Mon, 19 Apr 2021 09:26:13 +0100	[thread overview]
Message-ID: <87r1j6ist6.fsf@cbaines.net> (raw)
In-Reply-To: <20210418161230.72ecae02@lubrito>

[-- Attachment #1: Type: text/plain, Size: 2125 bytes --]


Luciana Lima Brito <lubrito@posteo.net> writes:

> Hi,
>
> On Sun, 18 Apr 2021 17:34:13 +0100
> Christopher Baines <mail@cbaines.net> 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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 987 bytes --]

  reply	other threads:[~2021-04-19  8:26 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-14 19:48 Outreachy - Guix Data Service: implementing basic json output for derivation comparison page Luciana Lima Brito
2021-04-15  8:46 ` Christopher Baines
2021-04-15 16:09   ` Luciana Lima Brito
2021-04-15 23:19     ` Christopher Baines
2021-04-16 15:07       ` Luciana Lima Brito
2021-04-16 15:47         ` Christopher Baines
2021-04-16 18:46           ` Luciana Lima Brito
2021-04-16 19:17             ` Christopher Baines
2021-04-16 22:47               ` Luciana Lima Brito
2021-04-17  8:40                 ` Christopher Baines
2021-04-17 12:48                   ` Luciana Lima Brito
2021-04-17 13:11                     ` Christopher Baines
2021-04-17 14:08                       ` Luciana Lima Brito
2021-04-17 17:45                         ` Christopher Baines
2021-04-18 13:12                           ` Luciana Lima Brito
2021-04-18 13:19                             ` Luciana Lima Brito
2021-04-18 16:34                             ` Christopher Baines
2021-04-18 19:12                               ` Luciana Lima Brito
2021-04-19  8:26                                 ` Christopher Baines [this message]
2021-04-19 14:04                                   ` Luciana Lima Brito
2021-04-19 20:20                                     ` Christopher Baines
2021-04-19 20:56                                       ` Luciana Lima Brito

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r1j6ist6.fsf@cbaines.net \
    --to=mail@cbaines.net \
    --cc=guix-devel@gnu.org \
    --cc=lubrito@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.