Skip to content
This repository

/module/warnings etc. pick up info from wrong files #143

Closed
miyagawa opened this Issue November 03, 2011 · 5 comments

4 participants

Tatsuhiko Miyagawa Moritz Onken Randy Stauner Kent Fredric
Tatsuhiko Miyagawa

/module/warnings returns information from regen/warnings.pl, which seems like a bug. For cpan clients like cpanm to use metacpan, it is critical that It doesn't include 'module' and hence 'version' for a given module.

Known namespaces that have issues like this are:

  • warnings
  • version
  • FCGI
  • bignum (not found - maybe a separate issue?)

In the case of FCGI, the distro doesn't really contain FCGI.pm, so the file is correct, but it does't include 'module' key.

Moritz Onken
Owner

This is the query you want:

curl api.metacpan.org/v0/file -d '{
  "query": {
    "filtered": {
      "query": { "match_all": {} },
      "filter": {
        "and": [
          {
          "nested": {
            "path": "module",
            "query": {
                "bool": {
                    "must": [
                        { "term": { "module.name": "version" } },
                        { "term": { "module.indexed": true } },
                        { "term": { "module.authorized": true } }
                    ]
                }
            }
        }
      }, { "term":{"file.status": "latest"}} ]
    }
  }
} }'

But it throws every now and then an ElasticSearch totalShardFailure error. I guess we'd have to upgrade to a newer version and hope that it's fixed there.

the /module/ endpoint uses a different query because it also catches things like scripts which don't have a package declaration. FCGI is somewhat broken/special in that it is .PL with a package declaration which isn't supported by metacpan yet.

Randy Stauner
Owner

Is this related to CPAN-API/metacpan-web#176 ?

Kent Fredric

The query as proposed above doesn't seem to be always adequate, as in the metadata, there are records that falsely indicate authorized: and indexed: as both being true when they shouldn't be.

For example, replace "version" in that query with "warnings", and you'll get 2 responses, a) perl and b ) Apache-Test-1.37

Kent Fredric

Seems like CPAN-API/cpan-api#98 is a blocker here.

Moritz Onken
Owner

everything but FCGI is resolved, I'm gonna open a new ticket for that

Moritz Onken monken closed this April 11, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.