Re: Add versions.json endpoint with latest release information

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Sehrope Sarkuni <sehrope(at)jackdb(dot)com>
Cc: "Jonathan S(dot) Katz" <jkatz(at)postgresql(dot)org>, PostgreSQL WWW <pgsql-www(at)postgresql(dot)org>
Subject: Re: Add versions.json endpoint with latest release information
Date: 2021-05-17 20:32:37
Message-ID: CABUevEw2ayzvAjg=hJyjY2XNHxTwUer3=1KavL2-v+cXtwX5gg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-www

On Tue, May 4, 2021 at 11:49 PM Sehrope Sarkuni <sehrope(at)jackdb(dot)com> wrote:
>
> Updated patch is attached with the renamed field.
>
> Rather than use annotate(...), it defines a separate function to convert the Version model into a dict for serialization. That way the numtree function can be used for the major version (i.e. for 10.0 => 10). I think it ends up being cleaner anyway as all the fields in the resulting JSON are listed in one place.

Thanks, that looks much better, I agree.

> Thanks for updating the sample data. New output is now:

Applied, with a few small changes:

* Didn't pass the pep8 tests we run -- needed some adjustments to
indentations and spacing only
* Made version_to_json return the dict directly instead of building it
incrementally. Probably faster, but the important part being I find
that much more readable.
* renamed eoldate -> eolDate and reldate -> relDate to follow the
pattern Jonathan suggested wrt the latestMinor field

Thanks!

--
Magnus Hagander
Me: https://www.hagander.net/
Work: https://www.redpill-linpro.com/

In response to

Responses

Browse pgsql-www by date

  From Date Subject
Next Message Sehrope Sarkuni 2021-05-17 22:16:33 Re: Add versions.json endpoint with latest release information
Previous Message Magnus Hagander 2021-05-17 20:01:01 Re: Related Projects