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

CI(Preview): add retries to find PR script #20

Merged
merged 2 commits into from
Jun 14, 2024

Conversation

ugtthis
Copy link
Contributor

@ugtthis ugtthis commented Jun 12, 2024

To my understanding this is so pose to help by increasing the rate limit since I added the Github Token. I also added a retry mechanism instead of trying to rerun actions manually. I noticed that Cameron also ran into the secondary rate limit so hopefully this would help us not hit that limit anymore.

I'm not entirely confident this would help so feel free to close this. My previous PRs are now able to generate the Preview Link.

Reference Link: docs.github.com

Copy link

github-actions bot commented Jun 12, 2024

Welcome to new-connect! Make sure to:

  • read the contributing guidelines
  • mark your PR as a draft until it's ready to review
  • post the preview on Discord; feedback from users will speedup the PR review

deployed preview: https://20.connect-d5y.pages.dev

@ugtthis
Copy link
Contributor Author

ugtthis commented Jun 12, 2024

Meant to run this PR on my fork to see if it fixed the secondary rate limit problem I was hitting with my other PRs. My bad

@ugtthis ugtthis changed the title TEST PR | Preview link: Better handeling for secondary rate limit with added retry Preview link: Better handeling for secondary rate limit with added retry Jun 12, 2024
const pullRequestNumber = items[0].number
console.info("Pull request number is", pullRequestNumber)
return pullRequestNumber
return findPR();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason to wrap this in a function?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe wrapping it in a function is not needed here, but the intention was to make it easier to manage, to debug, and easier to simulate different scenarios to make sure the retry logic works as expected. But maybe it’s overkill? Let me know if you prefer it a certain way

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to just set retries on the action, it will handle the Retry-After header for us
https://docs.github.com/en/rest/using-the-rest-api/best-practices-for-using-the-rest-api#handle-rate-limit-errors-appropriately

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha. Thanks for the fix!

@incognitojam incognitojam changed the title Preview link: Better handeling for secondary rate limit with added retry CI(Preview): add retries to find PR script Jun 14, 2024
@incognitojam incognitojam merged commit 3f4ed5a into commaai:master Jun 14, 2024
2 checks passed
@ugtthis ugtthis deleted the fix-preview branch July 10, 2024 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants