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(rubygems): support GitHub Packages #11107
Conversation
GitHub Packages doesn't seem to expose neither /api/v1/gems or /versions endpoints. It instead uses /api/v1/dependencies to answer queries from bundler. See https://andre.arko.net/2014/03/28/the-new-rubygems-index-format/ for the differences between these APIs. This commit adds fallback from /api/v1/gems/*.json to /api/v1/dependencies to support GitHub Packages. It involves parsing Ruby's Marshal format, so I created @qnighy/marshal for the purpose.
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.
Use official marshal
package.
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Then I'll use |
Will work on |
It seems getBuffer() returns an empty Buffer for an empty response.
Moved to |
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.
needs deconflicting
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Unfortunately, I don't know a public one... |
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 this is good to go now
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.
no further comments
🎉 This PR is included in version 26.3.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Thanks a lot for the follow-ups! |
GitHub Packages doesn't seem to expose either
/api/v1/gems
or/versions
endpoints. It instead uses/api/v1/dependencies
to answer queries from bundler.See https://andre.arko.net/2014/03/28/the-new-rubygems-index-format/ for the differences between these APIs.
This PR adds fallback from
/api/v1/gems/*.json
to/api/v1/dependencies
to support GitHub Packages.It involves parsing Ruby's Marshal format, so I created @qnighy/marshal for the purpose.
Note on marshal: I found a clear bug in
_getLength
and thought I can build better libraries myself. However, when writing this PR, I revisited the code and found_getLength
is used less often (there is a redundant correct implementation elsewhere) and the bug's effect is fairly limited. It turned out to be well-written than I expected. I still think mine can compete and at least have a TypeScript definition wheremarshal
doesn't. Ifmarshal
is preferred, I'm willing to rewrite the code to usemarshal
.Changes:
When updating RubyGems artifacts and if it uses registries other than
rubygems.org
, Renovate used to inquiry/api/v1/gems/*.json
for the package info. After this change, it falls back to/api/v1/dependencies
if the former API is not available (returns 404). As a result, Renovate will be able to update dependencies from GitHub Packages RubyGems registry.Context:
Trying to use Renovate with private dependencies in GitHub Packages, but it could not update them.
Documentation (please check one with an [x])
How I've tested my work (please tick one)
I have verified these changes via: