-
Notifications
You must be signed in to change notification settings - Fork 7.4k
[vcpkg_from_github]: add support for fine-grained GH tokens #44241
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
Merged
BillyONeal
merged 6 commits into
microsoft:master
from
globusmedical:vcpkg_from_github/github-fine-grained-tokens
Apr 25, 2025
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
cd9c024
[vcpkg_from_github]: add support for fine-grained GH tokens
rressi-at-globus 333d705
[vcpkg_from_github]: add option USE_TARBALL_API
rressi-at-globus e6f28af
[vcpkg_from_github]: add option USE_TARBALL_API
rressi-at-globus e6d5546
Merge branch 'master' into vcpkg_from_github/github-fine-grained-tokens
rressi-at-globus d280365
Merge branch 'master' into vcpkg_from_github/github-fine-grained-tokens
rressi-at-globus eaf61bf
Merge branch 'master' into vcpkg_from_github/github-fine-grained-tokens
rressi-at-globus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't seem correct for every port to need to be explicitly told to do this.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am 100% open for alterantive solutions.
The name
USE_TARBALL_APIrelates to the implementation and not to the purpose.Do you have better ideas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe,
USE_FINE_GRAINED_ACCESS_TOKENS, the feature is documented here:The fact is that is the tarball API that produces tarballs whith a slightly different content, but their content are 100% equivalent after unpacking them with VCPKG's CMake code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did some digging on this and it looks like the token goes in a header rather than the URI? https://docs.github.com/en/rest/repos/contents?apiVersion=2022-11-28#download-a-repository-archive-tar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm also digging a little bit more on the API we use currently here:
Binary stability by the current API is guaranteed only on the tarball package after the decompression (maybe you are already expecting that, not sure):
And late in the same page, the owners of this API are suggesting to rather use the other endpoint I'm introducing with this API:
With these 2 things in mind, I would suggest you to define a deprecation strategy for the older endpoint.
And we can introduce with this PR the first step of this strategy where we add the new feature without breaking all of the existing looking forward for the migration.
But it is, of course, up to you.
Whatever solution you decide, what we need is just supporting fine-grainded tokens and keep our fork of this really nice project as close as possible with upstream.
So far it is almost identical.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that on the REST API, there are rate limits. Unauthenticated users might quickly hit the limit of currently 60 requests per hour.
https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28#primary-rate-limit-for-unauthenticated-users
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think they mean using a commit rather than a head or tag.