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

fix: avoid creating blobs for UTF-8 text files #133

Merged
merged 3 commits into from
Sep 4, 2023

Conversation

rmartine-ias
Copy link
Contributor

To open a pull request using GitHub's API, it's necessary to create a tree, where you can either specify file contents as a string, or the hash of a blob that's already been pushed to GitHub. Creating blobs requires an API call, while specifying file contents does not. GitHub has a low secondary rate limit for creating blobs.

This PR makes it so fewer files are sent as binary blobs. UTF-8 files do not need to be sent up as blobs, they can be included in the tree as their literal contents.

The fixture update is a bit of a mess but I'm not sure if I can do it better.

See also: #121

Copy link
Owner

Choose a reason for hiding this comment

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

any chance you could just remove the blob creation request instead of updating the whole fixture?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@gr2m
Copy link
Owner

gr2m commented Aug 31, 2023

GitHub has a low secondary rate limit for creating blobs

How do you know? I'm not aware this is the case

@rmartine-ias
Copy link
Contributor Author

GitHub has a low secondary rate limit for creating blobs

How do you know? I'm not aware this is the case

Experience, I looked for docs on the secondary rate limits but didn't find anything concrete. Others are also unable to find documentation. The secondary limit doesn't appear to be returned in headers, either -- tested with an app and user token :/

@gr2m gr2m changed the title Make UTF-8 files less API-Intensive fix: avoid creating blops for UTF-8 text files Sep 4, 2023
Copy link
Owner

@gr2m gr2m left a comment

Choose a reason for hiding this comment

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

great pull request, thanks a bunch 💐

@gr2m gr2m merged commit 445e847 into gr2m:main Sep 4, 2023
5 checks passed
@github-actions
Copy link

github-actions bot commented Sep 4, 2023

🎉 This PR is included in version 5.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@rmartine-ias rmartine-ias changed the title fix: avoid creating blops for UTF-8 text files fix: avoid creating blobs for UTF-8 text files Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants