Implement Trending Packages into Backend - #318
confused-Techie wants to merge 6 commits into
Conversation
|
Love to see it, some notes:
I'm sure there are a ton of other cases but these were just some quick notes I thought worth adding. |
|
I do think that it would count as telemetry if we had |
|
Also: in the long-term, the “featured” list is something we probably don't have the bandwidth to maintain. But until such time as we retire it, we might as well swap in some packages that are more likely to be among the most common packages a user would want to install. Maintaining such a list is a high-effort task overall, but changing the current fixed list of featured packages is a low-effort task. |
|
Thanks a ton for your thoughts at @Daeraxa & @savetheclocktower! So for the point about telemetry. The uninstall endpoint was inherited from Atom. We still have it, we just don't ever do anything with it. So if we worry that this counts as telemetry, then we can continue to do absolutely nothing with it (the endpoint just immediately returns success to keep PPM happy). As for calculating trending, you make some wonderful points on how we should determine what trending means, and the cool thing, is with these changes we still can. All we have right now is a table that tracks downloads of a package per day. That's the basis for any of your other suggestions. So we could currently say any of the following without much hassle:
The only point, if we are wanting to do this more complex calculation of trending, we likely won't be able to do it in real time. We'd likely want to run a scheduled task that does these calculations then saves the results somewhere. Maybe only updating every week or something, especially since anything other than "lots of recent downloads" as trending would require more than one somewhat expensive query. But I do love the ideas you're coming up with here, and I think they'd be a bit more valuable than what I had in mind. |
Since we reference the pointer of the package, this also must be deleted on any package deletion
Per popular request, this PR finally implements a "Trending" feature into the backend.
Since currently we only have a simple "download" count per package, there's never been any way to track when a package is downloaded (or even if those downloads happened pre-Pulsar). But this PR finally implements what we need to do just that.
This PR creates a new table, that tracks the download download of each package. Creating an entry for a package per day as it's download. Allowing us an aggregate count of how many times a day a package is downloaded.
Which we can then in turn use SQL to get the total download count over any arbitrary time interval.
Although, this PR just contains some of the first steps, a more complete look of what we need to do between this PR and having this feature live looks like:
settings-viewSome key questions we may want to consider now that this is being worked on: