Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

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

miyagawa opened this issue Nov 3, 2011 · 5 comments

Comments

@miyagawa
Copy link

@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
Copy link
Contributor

@monken 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
Copy link
Member

@rwstauner rwstauner commented Nov 4, 2011

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

@kentfredric
Copy link

@kentfredric kentfredric commented Feb 14, 2012

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
Copy link

@kentfredric kentfredric commented Feb 14, 2012

Seems like #98 is a blocker here.

@monken
Copy link
Contributor

@monken 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
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants