metacpan-api icon indicating copy to clipboard operation
metacpan-api copied to clipboard

Add GitHub stars to /distribution

Open oalders opened this issue 1 year ago • 2 comments

We're already doing something like this for https://fastapi.metacpan.org/distribution/App-perlimports:

{
   "name" : "App-perlimports",
   "bugs" : {
      "github" : {
         "active" : 10,
         "open" : 10,
         "closed" : 105,
         "source" : "https://github.com/perl-ide/App-perlimports"
      }
   },
   "river" : {
      "total" : 0,
      "bucket" : 0,
      "immediate" : 0,
      "bus_factor" : 1
   }
}

If we could add GitHub stars (and watchers?) to the this endpoint we could easily incorporate that into the front end without the extra GitHub requests. Hopefully that would encourage more people to star the repository in question.

oalders avatar Oct 21 '24 15:10 oalders

The graphql for this:

query {
    repository(owner: %s, name: %s) {
        stargazerCount: stargazerCount
        watchers: watchers {
            totalCount
        }
    }
}

Could be added to the tickets script rather easily.

haarg avatar Oct 21 '24 15:10 haarg

We should be able to add it to the GitHub GraphQL query if it supports this info.

mickeyn avatar Oct 21 '24 15:10 mickeyn