-
Notifications
You must be signed in to change notification settings - Fork 76
Test for updated doc. on latest / ranges / -rc
#349
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
Changes from all commits
1c4fa97
ab11ddb
b1bf101
3e7a716
e55b2f4
09ef1ef
abc3213
200b93b
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 |
|---|---|---|
|
|
@@ -26323,6 +26323,7 @@ function validVersion(v) { | |
| v.match( | ||
| new RegExp(`${knownBranches.join('|')}|${nonSpecificVersions.join('|')}`), | ||
| ) == null && | ||
| // these ones are for rebar3, which has alpha and beta releases | ||
| !v.startsWith('a') && | ||
| !v.startsWith('b') | ||
| ) | ||
|
|
@@ -26349,7 +26350,12 @@ function getVersionFromSpec(spec0, versions0) { | |
| const altVersions = {} | ||
| Object.entries(versions0).forEach(([version, altVersion]) => { | ||
| let coerced | ||
| if (isStrictVersion() || isRC(version)) { | ||
| if ( | ||
| isStrictVersion() || | ||
| isRC(version) || | ||
| isKnownBranch(version) || | ||
| isKnownVerBranch(version) | ||
| ) { | ||
|
Comment on lines
+26353
to
+26358
Collaborator
Author
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. These are the exception we use when building the comparison list. We don't want |
||
| // If `version-type: strict` or version is RC, we just try to remove a potential initial v | ||
| coerced = maybeRemoveVPrefix(version) | ||
| } else { | ||
|
|
@@ -26367,9 +26373,14 @@ function getVersionFromSpec(spec0, versions0) { | |
| const rangeMax = semver.maxSatisfying(versions, rangeForMax) | ||
| let version = null | ||
|
|
||
| if (isStrictVersion() || isRC(spec0) || isKnownBranch(spec0)) { | ||
| if ( | ||
| isStrictVersion() || | ||
| isRC(spec0) || | ||
| isKnownBranch(spec0) || | ||
| isKnownVerBranch(spec0) | ||
| ) { | ||
|
Comment on lines
+26376
to
+26381
Collaborator
Author
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. Similarly, when the input is strict, and rc, ... we don't need to compare it in a range (done below), so we skip that entirely. |
||
| if (versions0[spec]) { | ||
| // If `version-type: strict` or version is RC, we obtain it directly | ||
| // We obtain it directly | ||
| version = versions0[spec] | ||
| } | ||
| } else if (spec0 === 'latest') { | ||
|
|
@@ -26592,7 +26603,7 @@ function xyzAbcVersion(pref, suf) { | |
| // https://www.erlang.org/doc/system_principles/versions.html | ||
| const dd = '\\.?(\\d+)?' | ||
| return new RegExp( | ||
| `${pref}v?(\\d+)${dd}${dd}${dd}${dd}${dd}(?:-rc\\.?\\d+)?(?:-otp-\\d+)?${suf}`, | ||
| `${pref}(?:OTP-)?v?(\\d+)${dd}${dd}${dd}${dd}${dd}(?:-rc\\.?\\d+)?(?:-otp-\\d+)?${suf}`, | ||
| ) | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -875,11 +875,31 @@ describe('.getVersionFromSpec(_)', () => { | |
| got = setupBeam.getVersionFromSpec(spec, matrix.otp['ubuntu-20.04']) | ||
| assert.deepStrictEqual(got, expected) | ||
|
|
||
| spec = 'maint-24' | ||
| expected = 'maint-24' | ||
| got = setupBeam.getVersionFromSpec(spec, matrix.otp['ubuntu-22.04']) | ||
| assert.deepStrictEqual(got, expected) | ||
|
|
||
| spec = '> 0' | ||
| expected = 'OTP-26.2.5' | ||
|
Collaborator
Author
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. Below we can see that |
||
| got = setupBeam.getVersionFromSpec(spec, matrix.otp['ubuntu-22.04']) | ||
| assert.deepStrictEqual(got, expected) | ||
|
|
||
| spec = 'latest' | ||
| expected = 'OTP-27.0-rc3' | ||
| got = setupBeam.getVersionFromSpec(spec, matrix.otp['ubuntu-22.04']) | ||
| assert.deepStrictEqual(got, expected) | ||
|
|
||
| spec = 'maint-26' | ||
| expected = 'maint-26' | ||
| got = setupBeam.getVersionFromSpec(spec, matrix.otp['ubuntu-22.04']) | ||
| assert.deepStrictEqual(got, expected) | ||
|
|
||
| spec = '> 0' | ||
| expected = 'OTP-27.0' | ||
| got = setupBeam.getVersionFromSpec(spec, matrix.otp['ubuntu-24.04']) | ||
| assert.deepStrictEqual(got, expected) | ||
|
|
||
| spec = 'latest' | ||
| expected = 'OTP-27.0' | ||
| got = setupBeam.getVersionFromSpec(spec, matrix.otp['ubuntu-24.04']) | ||
|
|
||
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 thoroughly revisited this as a way to make it as clear as possible... please give it a read and lemme know otherwise.