<?xml version="1.0" encoding="UTF-8" standalone="yes"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-us"><id>https://blog.pgxn.org/tags/jifty/</id><title>Jifty</title><updated>2010-09-17T17:33:00Z</updated><link rel="self" type="application/atom+xml" href="https://blog.pgxn.org/tags/jifty/feed.xml"/><link rel="alternate" type="text/html" href="https://blog.pgxn.org/tags/jifty/"/><author><name>The PGXN Maintainers</name></author><generator uri="https://gohugo.io/" version="0.167.0">Hugo</generator><entry><id>https://blog.pgxn.org/post/1138292188</id><title type="html">Architecture, New Extension JSON Format</title><link rel="alternate" type="text/html" href="https://blog.pgxn.org/2010/arch-and-extension-json/"/><updated>2026-10-07T16:13:48Z</updated><published>2010-09-17T17:33:00Z</published><author><name>David E. Wheeler</name></author><category scheme="https://blog.pgxn.org/tags" term="pgxn-manager" label="PGXN Manager"/><category scheme="https://blog.pgxn.org/tags" term="pgxnmanager" label="PGXN::Manager"/><category scheme="https://blog.pgxn.org/tags" term="plack" label="Plack"/><category scheme="https://blog.pgxn.org/tags" term="catalyst" label="Catalyst"/><category scheme="https://blog.pgxn.org/tags" term="dancer" label="Dancer"/><category scheme="https://blog.pgxn.org/tags" term="jifty" label="Jifty"/><category scheme="https://blog.pgxn.org/tags" term="extension" label="Extension"/><category scheme="https://blog.pgxn.org/tags" term="metadata" label="Metadata"/><summary type="html"><![CDATA[<p>I&rsquo;m making good progress on <a href="https://github.com/theory/pgxn-manager">PGXN Manager</a>. Hopefully I can start alpha
testing it next week. As I mentioned <a href="https://blog.pgxn.org/post/1082188310/db-status-update">previously</a>, I had estimated 40 hours of
work to create it, but was hoping to get it done in around 30 (because I spent
10 extra hours on the database design). So far I&rsquo;m at 23 hours, so it&rsquo;s
looking pretty good.</p>
<p>Architecturally, I&rsquo;ve gone for a very minimal <a href="https://plackperl.org/">Plack</a>-based app. No
<a href="https://www.catalystframework.org/">Catalyst</a>, <a href="https://jifty.org/">Jifty</a>, or even <a href="https://perldancer.org/">Dancer</a>. Just a very simple <a href="https://github.com/theory/pgxn-manager/blob/master/lib/PGXN/Manager/Router.pm">Plack app</a> that
uses <a href="https://search.cpan.org/perldoc?Router::Simple::Sinatraish">Router::Simple::Sinatraish</a> to route URIs to the appropriate
<a href="https://github.com/theory/pgxn-manager/blob/master/lib/PGXN/Manager/Controller.pm">controller</a> actions (which are just class methods). The controller just
dispatches to <a href="https://search.cpan.org/perldoc?Template::Declare">Template::Declare</a>-based <a href="https://github.com/theory/pgxn-manager/blob/master/lib/PGXN/Manager/Templates.pm">templates</a> for the HTML rendering. I
guess I&rsquo;ve kind of created my own framework here, but really, there ain&rsquo;t much
to it. This app is simple enough that I couldn&rsquo;t see the use of adding all the
overhead of a framework.</p>]]></summary><content type="html" xml:base="https://blog.pgxn.org/" xml:space="preserve"><![CDATA[<p>I&rsquo;m making good progress on <a href="https://github.com/theory/pgxn-manager">PGXN Manager</a>. Hopefully I can start alpha
testing it next week. As I mentioned <a href="https://blog.pgxn.org/post/1082188310/db-status-update">previously</a>, I had estimated 40 hours of
work to create it, but was hoping to get it done in around 30 (because I spent
10 extra hours on the database design). So far I&rsquo;m at 23 hours, so it&rsquo;s
looking pretty good.</p>
<p>Architecturally, I&rsquo;ve gone for a very minimal <a href="https://plackperl.org/">Plack</a>-based app. No
<a href="https://www.catalystframework.org/">Catalyst</a>, <a href="https://jifty.org/">Jifty</a>, or even <a href="https://perldancer.org/">Dancer</a>. Just a very simple <a href="https://github.com/theory/pgxn-manager/blob/master/lib/PGXN/Manager/Router.pm">Plack app</a> that
uses <a href="https://search.cpan.org/perldoc?Router::Simple::Sinatraish">Router::Simple::Sinatraish</a> to route URIs to the appropriate
<a href="https://github.com/theory/pgxn-manager/blob/master/lib/PGXN/Manager/Controller.pm">controller</a> actions (which are just class methods). The controller just
dispatches to <a href="https://search.cpan.org/perldoc?Template::Declare">Template::Declare</a>-based <a href="https://github.com/theory/pgxn-manager/blob/master/lib/PGXN/Manager/Templates.pm">templates</a> for the HTML rendering. I
guess I&rsquo;ve kind of created my own framework here, but really, there ain&rsquo;t much
to it. This app is simple enough that I couldn&rsquo;t see the use of adding all the
overhead of a framework.</p>
<p>Meanwhile, I&rsquo;ve been hacking on the <a href="https://github.com/theory/pgxn-manager/blob/master/lib/PGXN/Manager/Distribution.pm">distributon class</a>. This will be the core
class of the app. It takes a <a href="https://search.cpan.org/perldoc?Plack::Request::Upload">Plack upload</a> object and a username and does all
the rest, analyzing an uploaded archive, normalizing it if necessary,
registering it with the database, and indexing it by updating all the
appropriate JSON files on the mirrors. It&rsquo;s nearly finished, but I have one
other thing to do in the database, first.</p>
<p>In my <a href="https://blog.pgxn.org/post/1082188310/db-status-update">last update</a>, I asked for advice on whether or not PGXN
should allow an extension with the same version number to appear in multiple
distributions. And thanks to a <a href="https://blog.pgxn.org/post/1082188310/db-status-update#comment-75931198">comment from Aristotle</a>, I&rsquo;m changing it to
allow that. But it also means that my <a href="https://blog.pgxn.org/post/988613682/restful-directory#extension-json">original extension json spec</a> needs to
change.</p>
<p>Here&rsquo;s an example of what I&rsquo;m thinking. Say that there are three versions of
an extension named &ldquo;trip&rdquo;, and that they appear in distributions as follows:</p>
<pre tabindex="0"><code>trip 0.2.6
  pair-0.3.0
<p>trip 0.2.5
trip-0.2.2
pair-0.2.2rc
pair-0.2.1
trip-0.1.1</p>
<p>trip 0.2.4
pair-0.1.1rc
pair-0.1.0
</code></pre><p>So sometimes it’s in the “trip” distribution and other times it’s in the
“pair” distribution. My thought is that, for a given version, it would list
the distributions it’s in in reverse chronological order (by upload date). So
the format would be:</p></p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-json" data-lang="json"><span class="line"><span class="cl"><span class="p">{</span>
</span></span><span class="line"><span class="cl">   <span class="nt">&#34;latest&#34;</span><span class="p">:</span> <span class="s2">&#34;stable&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">   <span class="nt">&#34;stable&#34;</span><span class="p">:</span> <span class="p">{</span> <span class="nt">&#34;dist&#34;</span><span class="p">:</span> <span class="s2">&#34;pair&#34;</span><span class="p">,</span> <span class="nt">&#34;version&#34;</span><span class="p">:</span> <span class="s2">&#34;0.3.0&#34;</span> <span class="p">},</span>
</span></span><span class="line"><span class="cl">   <span class="nt">&#34;testing&#34;</span><span class="p">:</span> <span class="p">{</span> <span class="nt">&#34;dist&#34;</span><span class="p">:</span> <span class="s2">&#34;pair&#34;</span><span class="p">,</span> <span class="nt">&#34;version&#34;</span><span class="p">:</span> <span class="s2">&#34;0.2.2rc&#34;</span> <span class="p">},</span>
</span></span><span class="line"><span class="cl">   <span class="nt">&#34;distributions&#34;</span><span class="p">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl">      <span class="nt">&#34;0.2.6&#34;</span><span class="p">:</span> <span class="p">[</span>
</span></span><span class="line"><span class="cl">         <span class="p">{</span> <span class="nt">&#34;dist&#34;</span><span class="p">:</span> <span class="s2">&#34;pair&#34;</span><span class="p">,</span> <span class="nt">&#34;version&#34;</span><span class="p">:</span> <span class="s2">&#34;0.3.0&#34;</span> <span class="p">}</span>
</span></span><span class="line"><span class="cl">      <span class="p">],</span>
</span></span><span class="line"><span class="cl">      <span class="nt">&#34;0.2.5&#34;</span><span class="p">:</span> <span class="p">[</span>
</span></span><span class="line"><span class="cl">         <span class="p">{</span> <span class="nt">&#34;dist&#34;</span><span class="p">:</span> <span class="s2">&#34;trip&#34;</span><span class="p">,</span> <span class="nt">&#34;version&#34;</span><span class="p">:</span> <span class="s2">&#34;0.2.2&#34;</span> <span class="p">},</span>
</span></span><span class="line"><span class="cl">         <span class="p">{</span> <span class="nt">&#34;dist&#34;</span><span class="p">:</span> <span class="s2">&#34;pair&#34;</span><span class="p">,</span> <span class="nt">&#34;version&#34;</span><span class="p">:</span> <span class="s2">&#34;0.2.2rc&#34;</span><span class="p">,</span> <span class="nt">&#34;status&#34;</span><span class="p">:</span> <span class="s2">&#34;testing&#34;</span> <span class="p">},</span>
</span></span><span class="line"><span class="cl">         <span class="p">{</span> <span class="nt">&#34;dist&#34;</span><span class="p">:</span> <span class="s2">&#34;pair&#34;</span><span class="p">,</span> <span class="nt">&#34;version&#34;</span><span class="p">:</span> <span class="s2">&#34;0.2.1&#34;</span> <span class="p">},</span>
</span></span><span class="line"><span class="cl">         <span class="p">{</span> <span class="nt">&#34;dist&#34;</span><span class="p">:</span> <span class="s2">&#34;trip&#34;</span><span class="p">,</span> <span class="nt">&#34;version&#34;</span><span class="p">:</span> <span class="s2">&#34;0.1.1&#34;</span> <span class="p">}</span>
</span></span><span class="line"><span class="cl">      <span class="p">],</span>
</span></span><span class="line"><span class="cl">      <span class="nt">&#34;0.2.4&#34;</span><span class="p">:</span> <span class="p">[</span>
</span></span><span class="line"><span class="cl">         <span class="p">{</span> <span class="nt">&#34;dist&#34;</span><span class="p">:</span> <span class="s2">&#34;pair&#34;</span><span class="p">,</span> <span class="nt">&#34;version&#34;</span><span class="p">:</span> <span class="s2">&#34;0.1.1rc&#34;</span><span class="p">,</span> <span class="nt">&#34;status&#34;</span><span class="p">:</span> <span class="s2">&#34;testing&#34;</span> <span class="p">},</span>
</span></span><span class="line"><span class="cl">         <span class="p">{</span> <span class="nt">&#34;dist&#34;</span><span class="p">:</span> <span class="s2">&#34;pair&#34;</span><span class="p">,</span> <span class="nt">&#34;version&#34;</span><span class="p">:</span> <span class="s2">&#34;0.1.0&#34;</span> <span class="p">}</span>
</span></span><span class="line"><span class="cl">      <span class="p">]</span>
</span></span><span class="line"><span class="cl">   <span class="p">}</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span>
</span></span></code></pre></div><p>This way, every distribution it&rsquo;s included in is listed, and clients can
quickly tell where to find the latest stable, testing, and unstable versions,
and which of those is the most recent. This is a bit more convoluted than <a href="https://blog.pgxn.org/post/988613682/restful-directory#extension-json">the
original</a>, but I think is a good choice, in that
it&rsquo;s comprehensive but also easy to figure out what&rsquo;s the latest.</p>
<p>Unless you can think of a better format, this is what I&rsquo;m going with.
Comments?</p>
<p>Look for a post next week announcing an alpha program!</p>
]]></content></entry></feed>