cpan-testers / cpantesters-web

A new CPAN Testers web application. The primary interface for CPAN Testers data
Other
7 stars 5 forks source link

Create replacement for legacy distribution feeds (RSS, JSON, YAML) #19

Closed preaction closed 4 years ago

preaction commented 6 years ago

The current site has a few APIs that allow authors to see distribution report data via YAML, JSON, or to subscribe to recent reports via RSS. These feeds are advertised as orange buttons near the upper-right of the author's page (example distribution page for Yancy).

For backwards compatibility, we should create these same feeds in this app. We should add a single method to CPAN::Testers::Web::Controller::Legacy called dist_feeds. This method should return either an RSS, JSON, or YAML document based on the format requested (use $c->respond_to() to vary the responses).

JSON Example

[{
  "distribution":"Yancy",
  "status":"PASS",
  "csspatch":"unp",
  "uploadid":"306296",
  "tester":"\"Andreas J. K&ouml;nig (ANDK)\" <andreas.koenig.gmwojprw@franz.ak.mind.de ((Andreas J. Koenig))>",
  "osname":"linux",
  "type":"2",
  "cssperl":"rel",
  "version":"0.014",
  "distversion":"Yancy-0.014",
  "postdate":"201802",
  "perl":"5.26.1",
  "id":"91934758",
  "state":"pass",
  "platform":"x86_64-linux",
  "guid":"f6d043c6-0ddc-11e8-9f3b-659f2dfd206c",
  "dist":"Yancy",
  "osvers":"4.9.0-2-amd64",
  "fulldate":"201802092105",
  "ostext":"GNU/Linux"
}]

YAML

The YAML feed has the exact same structure as the JSON feed, but it is currently not working so I can't provide an example.

RSS

The RSS feed is generated by the same code that generates the author feeds (#18), but it is also currently not working. Here's the example from the author feed:

<?xml version="1.0" encoding="UTF-8"?>

<rss version="2.0"
xmlns:atom="http://www.w3.org/2005/Atom"
 xmlns:blogChannel="http://backend.userland.com/blogChannelModule"
>

<channel>
<atom:link href="http://www.cpantesters.org/distro/Y/Yancy.rss" rel="self" type="application/rss+xml" />
<title>CPAN Testers Reports</title>
<link>http://www.cpantesters.org/</link>
<description>news and updates for the CPAN Testers Reports website</description>
<language>en</language>
<pubDate>Tue, 19 Jun 2018 17:31:43 GMT</pubDate>
<generator>Labyrinth v5.32</generator>
<item>
<title>FAIL Yancy 5.24.1 on linux 4.4.0-81-generic (x86_64-linux)</title>
<link>http://www.cpantesters.org/cpan/report/0e9d34fe-1892-11e8-bb4d-81605a155286</link>
<description>FAIL Yancy 5.24.1 on linux 4.4.0-81-generic (x86_64-linux)</description>
<guid isPermaLink="false">http://www.cpantesters.org/cpan/report/0e9d34fe-1892-11e8-bb4d-81605a155286</guid>
<pubDate>Fri, 23 Feb 2018 12:07:00 GMT</pubDate>
</item>
</channel>
</rss>