github-readme-stats
github-readme-stats copied to clipboard
Implement github action that adds the `rate-limited` label to 1471 automatically when the PATs are failing
Describe the solution you'd like
I think a simple GitHub action that runs periodically to check if the PATs are failing and adds the rate-limited
label to #1471 if the PATs fall more than a certain number of times in 24 hours would let people know that we are aware of the problem and working on it. We could then update https://github.com/anuraghazra/github-readme-stats/issues/1772 to explain this behavoir.
Hey, can I work on this?
Great I assigned you! Take your time.
I have a few questions:
- By 1471, you mean 14:71 (hh:mm) right?
- Where do we post the comment?
- Where can I find the PATs?
@mohitsaxenaknoldus Ah, sorry for being unclear. With 1471 I meant #1471. We use this issue to check if the card throws a Maximum retries exceeded
error.
This GitHub action I had in mind would periodically check (e.g. every hour) whether the action throws this error and post a comment in #1471 if the error is thrown more than N times in 24 hours. However, thinking more about it π€, I now realise that this action could potentially empty @anuraghazra's GitHub action budget. I, therefore, think it is not wise to implement this action at the current time. Sorry for the inconvenience. π Another valuable action you can work on is https://github.com/anuraghazra/github-readme-stats/issues/1659.
@mohitsaxenakno I added an E2E test GitHub action last week (see https://github.com/anuraghazra/github-readme-stats/blob/master/.github/workflows/e2e-test.yml) and now think that implementing the action in #1989 is possible. The E2E test will call the server and fail if the card that is returned is not equal to the local card. We can, however, use this same mechanism to test whether the card that is returned is equal to the value returned by the renderError
function:
https://github.com/anuraghazra/github-readme-stats/blob/acbc03dc0f2e70da946fbb75822bbe9d041fb729/src/common/utils.js#L12
Running this action every hour while caching the dependencies would keep it relatively low on resources (see https://github.com/anuraghazra/github-readme-stats/blob/94d0978d2bf7c5324513ac924cb42afe1e7774cc/.github/workflows/e2e-test.yml#L19-L23).
If you still want to take on this feature, that would be great π! Maybe for Hacktoberfest?
Or maybe it is better to create a new issue with an explanation of what happened and that we are working on it. From experience, I noticed that people don't search for old issues when a problem occurs.
@mohitsaxenaknoldus I just thought of a better way. I plan to add a status/up
Vercel cloud function that will return true
if the PATs are still functioning and false
if they are not. I think we can call this function a simple bash action and create an issue if the PATs are failing. I am done with this function already but still have to complete the tests (see https://github.com/anuraghazra/github-readme-stats/blob/add_uptime_monitor/api/status/up.js).
Hey can you assign this issue to me?
@Jaya-sys Thanks a lot for wanting to implement this feature. I already implemented a cloud function that can be used to check whether the public instance is up (See https://github.com/anuraghazra/github-readme-stats/pull/2178).
https://github-readme-stats-git-monitoring-github-readme-stats-team.vercel.app/api/status/up
I use this cloud function to create a graph in grafana.com that shows every 15 min whether the instance is down. I can give you access to this graph if you want to check it out.
Therefore, we already have enough information to track our public instance. One thing that could still be improved is that we could create an action that adds the https://github.com/anuraghazra/github-readme-stats/labels/rate-limited label to #1471 when the instance has been down more than N times in the last 24 hours. We already have this data in the grafana.com Prometheus database, so maybe it is possible to fetch this data in the action? If this is impossible, we can also store this value in a database (see https://vercel.com/docs/concepts/solutions/databases#providers).
Are you interested in adding this functionality? I am happy to work with you on this feature.
Other issues that are still available to be worked on for Hacktoberfest are:
- https://github.com/anuraghazra/github-readme-stats/issues/1649
- https://github.com/anuraghazra/github-readme-stats/issues/1708
@rickstaa Yes i'd would like to work upon this
@Jaya-sys, great I assigned you to this issue. Do you need access to the grafana.com instance?
Yes
@Jaya-sys Of course, can you send me your grafana.com account email over discord?
Is this issue solved
i would like to work upon this issue if it isn't solved
"Hey, I would like to work on this issue. I have checked out #1470 after some research, deployed my own Vercel instance to test the PAT exhaustion. It's my first issue, so I am not sure how to reproduce PAT exhaustion in order to test whether PATs are failing or not.
want to work on this issue
@Lavishmunjal, @AvinashReddy19, @mohit-negi, @crocmons, sorry for the late reply I was on holiday π΄π. This issue hasn't been solved yet. I have thought a bit about it, and I think we can do the following:
- Create a small GitHub action that pings the https://github.com/anuraghazra/github-readme-stats/blob/master/api/status/up.js endpoint every 5 min to see if the instance is limited. This action can then attach and remove the
rate-limited
label from #1471. Since the response is cached on Vercels servers, this will not cause any more GraphQL points to be used.
@mohit-negi Since you already started on this issue, I assigned you if you still want to work on it. However, let's first check with @qwerty541 and @anuraghazra about this solution. Another possible solution would be to add the uptime badge to the readme under the #important-notice- section (see #3350).
<img alt="Custom badge" src="https://img.shields.io/endpoint?url=https%3A%2F%2Fgithub-readme-stats-git-monitoring-github-readme-stats-team.vercel.app%2Fapi%2Fstatus%2Fup%3Ftype%3Dshields">
@Lavishmunjal, @AvinashReddy19, @mohit-negi, @crocmons, sorry for the late reply I was on holiday π΄π. This issue hasn't been solved yet. I have thought a bit about it, and I think we can do the following:
- Create a small GitHub action that pings the https://github.com/anuraghazra/github-readme-stats/blob/master/api/status/up.js endpoint every 5 min to see if the instance is limited. This action can then attach and remove the
rate-limited
label from [Down Time] Card throws 'maximum retries exceeded' errorΒ #1471. Since the response is cached on Vercels servers, this will not cause any more GraphQL points to be used.@mohit-negi Since you already started on this issue, I assigned you if you still want to work on it. However, let's first check with @qwerty541 and @anuraghazra about this solution. Another possible solution would be to add the uptime badge to the readme under the #important-notice- section (see #3350).
<img alt="Custom badge" src="https://img.shields.io/endpoint?url=https%3A%2F%2Fgithub-readme-stats-git-monitoring-github-readme-stats-team.vercel.app%2Fapi%2Fstatus%2Fup%3Ftype%3Dshields">
@rickstaa I think that adding and removing label from some issue would be unnecessary, i can't imagine how users would notice this, it's not quite obvious that it's worth paying attention to. I already approved and merged into master pull request with addition of uptime badge into readme https://github.com/anuraghazra/github-readme-stats/pull/3350, i think it's enought.
@Lavishmunjal, @AvinashReddy19, @mohit-negi, @crocmons, sorry for the late reply I was on holiday π΄π. This issue hasn't been solved yet. I have thought a bit about it, and I think we can do the following:
- Create a small GitHub action that pings the https://github.com/anuraghazra/github-readme-stats/blob/master/api/status/up.js endpoint every 5 min to see if the instance is limited. This action can then attach and remove the
rate-limited
label from [Down Time] Card throws 'maximum retries exceeded' errorΒ #1471. Since the response is cached on Vercels servers, this will not cause any more GraphQL points to be used.@mohit-negi Since you already started on this issue, I assigned you if you still want to work on it. However, let's first check with @qwerty541 and @anuraghazra about this solution. Another possible solution would be to add the uptime badge to the readme under the #important-notice- section (see #3350).
<img alt="Custom badge" src="https://img.shields.io/endpoint?url=https%3A%2F%2Fgithub-readme-stats-git-monitoring-github-readme-stats-team.vercel.app%2Fapi%2Fstatus%2Fup%3Ftype%3Dshields">
@rickstaa I think that adding and removing label from some issue would be unnecessary, i can't imagine how users would notice this, it's not quite obvious that it's worth paying attention to. I already approved and merged into master pull request with addition of uptime badge into readme #3350, i think it's enought.
I agree. Let's close this down. Sorry for the inconvenience @mohit-negi π .