In our new design, the package score has three components:
We currently expose these via several APIs:
For likes: https://pub.dev/api/packages/pana/likes
For popularity: https://pub.dev/api/packages/pana/metrics?pretty
For points https://pub.dev/api/packages/pana/metrics?pretty & https://pub.dev/api/packages/pana/score
I suggest we expand the metrics and score APIs to have all three score components:
{
"grantedPoints":60,
"maxPoints":110,
"popularityScore": 0.6633297696569151,
"likes": 7,
"lastUpdated":"2020-09-03T22:11:22.940284Z"
}
@isoos do we know roughly when this will be deployed?
We have a planned deploy today with traffic migration tomorrow.
@isoos any chance we can also expose this on /metrics as I had mentioned in https://github.com/dart-lang/pub-dev/issues/3996#issue-694875174 ? We have some internal tools that call /metrics to get it's various information, and would like to avoid a second call to /score just to get the the likes (it already has popularity and points).
It would be easy to add the output of /score to /metrics too, but I wouldn't add the likeCount to the ScoreCard object internally - it requires different caching (analysis is once-in-a-while and is cached for a longer time, vs. likes which can change any time and cached for shorter time).
Added in #4025, will be available in the next release.
Most helpful comment
We have a planned deploy today with traffic migration tomorrow.