Display GitHub/GitLab stars on apps in search and app details in client
Tags: Suggestion, Feature request
Keywords: Ratings, Stars, Popularity, Metrics
Related issues
About
Currently (as the time of writing version 1.17.0) F-Droid shows no metrics about app in the client interface (only last update and size). This can make it hard to find reputable or popular applications when searching for an application and forces users to do more research outside of F-Droid, such as on Reddit or other social networks, or by inspecting repositories of individual projects manually.
Existing attempts
There is (now 9 years old) issue #53 (closed) about adding support for App ratings and/or comments. This issue saw little action on it, most likely due to complexity requiring implementation of whole infrastructure to support this.
For popularity there is a simpler in scope #396 (closed) that saw a PR for sending metrics, but I wasn't able to find any follow-up about actually presenting such data and option to opt-in into metrics is not well described nor presented at all to users that are not looking for it.
Proposal
Many applications have a public source hosted on GitHub or GitLab, which are services that already have a simple popularity metric: Stars. These offer a very simple way of giving feedback about how popular a package is and for users to star a project they only require having an account (which is also needed for giving feedback through issues; admittedly important aspect of open-source).
Both services provide a public API that (as far as I found) requires no authentication, so the counts can be easily queried by the client itself without any extra functionality being needed on server side of things of F-Droid. This would also mean no additional load for the server, as any infrastructure need for this is already handled by GitHub/GitLab. Relevant API documentation:
-
https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#get-a-repository (
stargazers_count
in result) -
https://docs.gitlab.com/ee/api/projects.html#get-single-project (
star_count
in result)
Using this client can simply use the package's SourceCode
, IssueTracker
, or Repo
url to create a request for the star count, requiring no additional metadata in the F-Droid repositories.
Example requests for F-Droid client:
- https://api.github.com/repos/f-droid/fdroidclient
- https://gitlab.com/api/v4/projects/fdroid%2Ffdroidclient
The queried stars could then be shown in client by, for example, showing icon of star and count next to it in the following places. If this isn't available or request fail, nothing would be shown.
- In app details under the app's name (close to the "Updated ... ago (... MB)" text)
- In app search under the app's name
Potential problems
Privacy
There is little information available about how GitHub or GitLab collect metrics on their APIs. To preserve privacy this feature should be made either opt-out or even opt-in depending on F-Droid's preferences
Stars are "bad metric"
I acknowledge that stars are not the best metric, with several concerns having been raised in the past:
- They are more geared toward developer popularity due to the the very platforms they are on
- They favour old projects with long history (even if popularity was lost), giving new projects disadvantage
- They are not representative of app's "quality"
I, however, believe that while they are not the best possible solution, they are a widely accepted one and the best that is currently available. Also note, that showing the star count doesn't give any information that wasn't already accessible - when user searches for an opensource application chances are they will check the repository themselves - this simply makes this data more conveniently accessible.
Option to star
If a store shows a "rating" in any form, it should also allow users to contribute to it - this could be done by offering option to click on the star to open the project's repository on relevant service to allow users to add star. This would also promote a way for users to give feedback about popularity to app developers (which F-Droid sorely lacks at the moment).
Applications with sources on other platforms
Some application have sourcecode on other platforms than GitHub or GitLab - such as http-hosted mirrors or private GitLab instances. These would not allow showing the star count, as such services either don't have such concept or can't be trusted (self-hosted instances might try to manually inflate such star count to appear more reliable)
This would create a problem of showing favour for GitHub and GitLab. This, however, again is something that already exist - as those star metrics are already available only there - giving anyone search option to view them, while http mirrors don't have any such metric and private GitLab instances tend to have much lower user count and such also lower star count. This could be also partially mitigated by having a curated list of "trusted" GitLab instances.
Applications with multiple repositories
Some applications have repositories on multiple platforms (including F-Droid being on GitLab and having GitHub mirror, with 2.1k and 1.1k stars, respectively). As far as I know there is no way to add multiple repositories to the manifest, which means only one of the repositories would be used to show popularity. Not showing all of these makes application appear less popular than it might be, but while adding more repositories might solve this, but would introduce additional problem of how to combine the counts - as simple sum of stars might or might not be representative, due to single user potentially starring application of multiple repositories.
I believe in the first iteration of this, this problem can be ignored and only the existing source repository link used.