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

feat(GitHubOrgEntityProvider): adds throttling and rate limit handling to GithubOrgEntityProvider #28085

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sonikro
Copy link
Contributor

@sonikro sonikro commented Dec 10, 2024

Hey, I just made a Pull Request!

When using the GithubOrgEntityProvider in organizations with over 14000 users on a GitHub Organization, the EntityProvider was failing 100% of the time with Secondary Rate Limit errors.

This fix adds the official throttling plugin to the graphql client responsible for fetching the data.

  • I extracted the code to instantiate the GraphQL Client into a separate function, so we can re-use this in the other EntityProviders later

I tested this package locally and not only the rate limit consumption went down significantly, but when a rate limit error happened, it successfully retried and moved on.

PS: Using octokit versions on this monorepo is getting complicated, as there are so many different versions installed. I spent most of my time trying to find the exact octokit versions I could use that would not break types everywhere.

✔️ Checklist

  • A changeset describing the change and affected packages. (more info)
  • Added or updated documentation
  • Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)
  • All your commits have a Signed-off-by line in the message. (more info)

@github-actions github-actions bot added the area:catalog Related to the Catalog Project Area label Dec 10, 2024
@backstage-goalie
Copy link
Contributor

Changed Packages

Package Name Package Path Changeset Bump Current Version
@backstage/plugin-catalog-backend-module-github plugins/catalog-backend-module-github patch v0.7.8-next.2

@sonikro sonikro force-pushed the add-throttling-and-rate-limit-github-entity-provider branch 3 times, most recently from ba5204b to 3dbb65a Compare December 10, 2024 20:05
@sonikro sonikro force-pushed the add-throttling-and-rate-limit-github-entity-provider branch from 3dbb65a to b92790e Compare December 10, 2024 20:28
@sonikro sonikro marked this pull request as ready for review December 10, 2024 20:53
@sonikro sonikro requested review from a team and backstage-service as code owners December 10, 2024 20:53
@sonikro sonikro changed the title feat(GitHubOrgEntityProvider): adds throttling and rate limit to GithubOrgEntityProvider feat(GitHubOrgEntityProvider): adds throttling and rate limit handling to GithubOrgEntityProvider Dec 10, 2024
@sonikro
Copy link
Contributor Author

sonikro commented Dec 12, 2024

Something seems flaky in the Windows E2E test. Can someone retry that ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:catalog Related to the Catalog Project Area
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant