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

Closed
miyagawa opened this Issue Nov 3, 2011 · 5 comments

Projects

None yet

4 participants

@miyagawa
miyagawa commented Nov 3, 2011

/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.

@monken
Member
monken commented Nov 3, 2011

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.

@rwstauner
Member

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

@kentfredric

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

@kentfredric

Seems like metacpan/metacpan-api#98 is a blocker here.

@monken
Member
monken commented Apr 11, 2012

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

@monken monken closed this Apr 11, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment