cpan-testers / cpantesters-api

An API in to data held by CPAN Testers: Test reports and CPAN uploads
Other
4 stars 4 forks source link

/v3/report returning 404 for guid or numeric report IDs #39

Closed cxw42 closed 5 years ago

cxw42 commented 5 years ago

I appreciate cpantesters more and more as time goes on! I am trying to regress Perl version against Test::Builder version in support of kaoru/Test-Kit2#2. To do so, I need the prereq information from /v3/report. However, I am getting 404s from the API:

$ curl -X GET --header 'Accept: text/html' 'http://api.cpantesters.org/v3/report/f91d2f1e-2b79-11e6-9f34-3169c46c58f4' ; echo
{"errors":[{"message":"Report ID not found","path":"\/id"}]}
$ curl -X GET 'http://api.cpantesters.org/v3/report/69819096' ; echo
{"errors":[{"message":"Report ID not found","path":"\/id"}]}

I get the same if I try through Swagger. But I know this report exists - it is at http://www.cpantesters.org/cpan/report/f91d2f1e-2b79-11e6-9f34-3169c46c58f4 , and it is number 69810196 on http://matrix.cpantesters.org/?dist=Test-Kit%202.15;os=linux;perl=5.14.4;reports=1 .

Am I missing something obvious, or is this a bug? Please let me know. Thanks!

(I do have a workaround, which is to pull and parse from www, but I'd prefer to use the API if possible.)

cxw42 commented 5 years ago

Update: Maybe this is just an age-of-data issue. Very recent report f1f3d538-002b-11e9-9842-7cca62b887d7 works fine -

curl -X GET --header 'Accept: text/html' 'http://api.cpantesters.org/v3/report/f1f3d538-002b-11e9-9842-7cca62b887d7'

I see that the JSON doesn't actually have a parsed-out prerequisites key, so I'll just go with my workaround (and appropriate manual rate-limiting).

preaction commented 5 years ago

None of the current test reporting clients support providing prerequisites, unfortunately, but now that you mention it, it might be possible for the CPAN::Testers::Backend::ProcessReports module to try to find some of the common existing formats for some prereqs (maybe with a flag in the data to say "hey, this list is probably not complete")

cxw42 commented 5 years ago

@preaction That would be pretty nice! I'll see if I can write my parsing code so it will fit ...::ProcessReports.

preaction commented 5 years ago

I should've remembered: The http://analysis.cpantesters.org already has a parser that you might be able to use/extend for your own purposes: https://metacpan.org/release/CPAN-Testers-ParseReport