vladkens / ghstats

🤩📈 Self-hosted dashboard for tracking GitHub repos traffic history longer than 14 days.
MIT License
126 stars 2 forks source link

Unclear Issues count #13

Closed t0mmili closed 3 weeks ago

t0mmili commented 2 months ago

Hi, I discovered that Issues counter is not comparable with real issues listed in GitHub web UI. This is, as you probably know, not an API issue, but rather a feature. It returns open issues and PRs combined together.

My proposition of improvement is to:

  1. Fetch just open Issues. Roughly like this:
    https://api.github.com/search/issues?q=repo:{owner}/{repo}+type:issue+state:open [total_count]
  2. And/or add PRs counter in separate column. Roughly like this (reusing API calls):
    https://api.github.com/repos/{user}/{repo} [open_issues_count] - https://api.github.com/search/issues?q=repo:{owner}/{repo}+type:issue+state:open [total_count]
vladkens commented 1 month ago

Hi. Good idea to show this data separately. Unfortunately the repos api I use doesn't have this data.

I don't really want to make a lot of requests to the api to avoid the api rate limit. Instead of several queries, maybe something can be done with graphql api: https://github.com/orgs/community/discussions/61508#discussioncomment-6516292.

Do you wanna try?

t0mmili commented 1 month ago

@vladkens For the time being I prepared changes based on core API approach. It needs only 1 additional request per repo, so I think it's not that much. I will add PR shortly. As for GraphQL. I will look into it 😉

vladkens commented 3 weeks ago

Released in v0.5.0. @t0mmili thank you for contributing!