nodiscc / hecat

Generic automation tool around data stored as plaintext YAML files
GNU General Public License v3.0
29 stars 5 forks source link

processors/github_metadata, exporters/markdown_multipage: fetch and display the number of contributors #112

Open nodiscc opened 1 year ago

nodiscc commented 1 year ago

Ref. https://github.com/awesome-selfhosted/awesome-selfhosted-data/issues/35

This information is not directly available from the repository API endpoint, it seems the contributors endpoint must be queried and the length of the returned list must be computed - if the number of contributors is greater than 100, multiple queries must be done, and the length of each page must be summed to get the total number of contributors until an empty page is returned (https://stackoverflow.com/questions/49209146/how-to-find-number-of-contributors-for-a-repository).

This could quickly deplete the number of allowed requests to the API, which is 5000 requests/hour for personal user tokens, and only 1000 requests/hour for Github Actions temporary GITHUB_TOKEN [1] (which is already a probelm in https://github.com/awesome-selfhosted/awesome-selfhosted-data for which we must already wait 7.3 seconds between each call to avoid reaching the rate limit [1]).

However, disabling querying this information during daily/automatic updates, and manually triggering it with a long wait_time from time to time remains a possibility.

nodiscc commented 6 months ago

An alternative option is to display the number of contributors in the last N months