-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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): fallback to info when version fails #7323
Changes from 5 commits
7686839
cca7aa9
ab58b0c
450eda1
d88e287
52f6ef2
cc1f436
a67a545
6e0506d
66def28
95cf3ea
650105d
7307401
12c6c67
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,7 +52,7 @@ export async function getDependency( | |
|
||
const versions = (await fetch(dependency, registry, VERSIONS_PATH)) || []; | ||
|
||
const releases = versions.map( | ||
let releases = versions.map( | ||
({ | ||
number: version, | ||
platform: rubyPlatform, | ||
|
@@ -68,6 +68,19 @@ export async function getDependency( | |
}) | ||
); | ||
|
||
if (versions.length === 0 && info.version) { | ||
logger.warn('falling back to the version from the info endpoint'); | ||
releases = [ | ||
{ | ||
version: info.version, | ||
rubyPlatform: info.platform, | ||
releaseTimestamp: null, | ||
rubyVersion: null, | ||
rubygemsVersion: '\u003e= 0', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the meaning of this value? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it was the default value from the versions endpoint its basically >= 0 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. but we can remove it I just wanted to match the signature from the "default" case There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, remove it |
||
}, | ||
]; | ||
} | ||
|
||
return { | ||
releases, | ||
homepage: info.homepage_uri, | ||
|
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.
Doesn't this request throw ? If so then everything below it is not executed.
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 thought it doesnt because of the || if not than i can add a try catch around it
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.
just to be sure a try catch would look like the following right? I can implement this if you want me to.