Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement github action that adds the rate-limited label to 1471 automatically when the PATs are failing #1989

Closed
rickstaa opened this issue Aug 31, 2022 · 21 comments
Labels
ci CI related features. enhancement New feature or request. good first issue Good for newcomers. hacktoberfest help wanted Extra attention is needed.

Comments

@rickstaa
Copy link
Collaborator

rickstaa commented Aug 31, 2022

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 #1772 to explain this behavoir.

@rickstaa rickstaa added ci CI related features. enhancement New feature or request. help wanted Extra attention is needed. good first issue Good for newcomers. labels Aug 31, 2022
@mohitsaxenaknoldus
Copy link

Hey, can I work on this?

@rickstaa
Copy link
Collaborator Author

rickstaa commented Sep 3, 2022

Great I assigned you! Take your time.

@mohitsaxenaknoldus
Copy link

I have a few questions:

  1. By 1471, you mean 14:71 (hh:mm) right?
  2. Where do we post the comment?
  3. Where can I find the PATs?

@rickstaa
Copy link
Collaborator Author

rickstaa commented Sep 6, 2022

@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 #1659.

@rickstaa rickstaa closed this as completed Sep 6, 2022
@rickstaa rickstaa reopened this Oct 4, 2022
@rickstaa
Copy link
Collaborator Author

rickstaa commented Oct 4, 2022

@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:

const renderError = (message, secondaryMessage = "") => {

Running this action every hour while caching the dependencies would keep it relatively low on resources (see

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: npm
).

If you still want to take on this feature, that would be great 🚀! Maybe for Hacktoberfest?

@rickstaa
Copy link
Collaborator Author

rickstaa commented Oct 4, 2022

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.

@rickstaa rickstaa closed this as completed Oct 4, 2022
@rickstaa rickstaa reopened this Oct 4, 2022
@rickstaa
Copy link
Collaborator Author

rickstaa commented Oct 4, 2022

@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).

@Jaya-sys
Copy link

Hey can you assign this issue to me?

@rickstaa
Copy link
Collaborator Author

rickstaa commented Oct 24, 2022

@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 #2178).

https://github-readme-stats-git-monitoring-github-readme-stats-team.vercel.app/api/status/up

Custom badge

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.

image

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 rate-limited The graphQL API seems to be 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.

@rickstaa rickstaa changed the title Implement github action that posts a comment on 1471 automatically when the PATs are failing Implement github action that adds the rate-limited label to 1471 automatically when the PATs are failing Oct 24, 2022
@rickstaa
Copy link
Collaborator Author

Other issues that are still available to be worked on for Hacktoberfest are:

@Jaya-sys
Copy link

@rickstaa Yes i'd would like to work upon this

@rickstaa
Copy link
Collaborator Author

@Jaya-sys, great I assigned you to this issue. Do you need access to the grafana.com instance?

@Jaya-sys
Copy link

Yes

@rickstaa
Copy link
Collaborator Author

@Jaya-sys Of course, can you send me your grafana.com account email over discord?

@Jaya-sys Jaya-sys removed their assignment Nov 3, 2022
@Lavishmunjal
Copy link

Is this issue solved

@AvinashReddy19
Copy link

i would like to work upon this issue if it isn't solved

@mohit-negi
Copy link

"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.

@crocmons
Copy link

crocmons commented Oct 2, 2023

want to work on this issue

@rickstaa
Copy link
Collaborator Author

rickstaa commented Oct 13, 2023

@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:

@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).

Custom badge

<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">

@qwerty541
Copy link
Collaborator

@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:

@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).

Custom badge

<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.

@rickstaa
Copy link
Collaborator Author

@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:

@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).
Custom badge

<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 😅.

@rickstaa rickstaa closed this as not planned Won't fix, can't repro, duplicate, stale Oct 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci CI related features. enhancement New feature or request. good first issue Good for newcomers. hacktoberfest help wanted Extra attention is needed.
Projects
None yet
Development

No branches or pull requests

8 participants