Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(nuget): Sort api response before picking projectUrl (#23090)
Co-authored-by: Rhys Arkins <rhys@arkins.net> Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
- Loading branch information
1 parent
d03ef92
commit ac15e23
Showing
6 changed files
with
199 additions
and
2 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
lib/modules/datasource/nuget/__fixtures__/azure_devops/nunit/nuspec.xml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd"> | ||
<metadata minClientVersion="2.12"> | ||
<id>NUnit</id> | ||
<version>3.13.2</version> | ||
<title>NUnit</title> | ||
<authors>Charlie Poole, Rob Prouse</authors> | ||
<owners>Charlie Poole, Rob Prouse</owners> | ||
<requireLicenseAcceptance>false</requireLicenseAcceptance> | ||
<license type="file">LICENSE.txt</license> | ||
<licenseUrl>https://aka.ms/deprecateLicenseUrl</licenseUrl> | ||
<icon>icon.png</icon> | ||
<projectUrl>https://nunit.org/</projectUrl> | ||
<iconUrl>https://cdn.rawgit.com/nunit/resources/master/images/icon/nunit_256.png</iconUrl> | ||
<description></description> | ||
<summary>NUnit is a unit-testing framework for all .NET languages with a strong TDD focus.</summary> | ||
<releaseNotes></releaseNotes> | ||
<copyright>Copyright (c) 2021 Charlie Poole, Rob Prouse</copyright> | ||
<language>en-US</language> | ||
<tags>nunit test testing tdd framework fluent assert theory plugin addin</tags> | ||
<repository type="git" url="https://github.com/nunit/nunit" /> | ||
<dependencies> | ||
<group targetFramework=".NETFramework3.5" /> | ||
<group targetFramework=".NETFramework4.0" /> | ||
<group targetFramework=".NETFramework4.5" /> | ||
<group targetFramework=".NETStandard2.0"> | ||
<dependency id="NETStandard.Library" version="2.0.0" /> | ||
</group> | ||
</dependencies> | ||
</metadata> | ||
</package> |
56 changes: 56 additions & 0 deletions
56
lib/modules/datasource/nuget/__fixtures__/azure_devops/nunit/v3_registration.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
{ | ||
"count": 1, | ||
"items": [ | ||
{ | ||
"count": 4, | ||
"items": [ | ||
{ | ||
"@id": "https://pkgs.dev.azure.com/organisationName/_packaging/2745c5e9-610a-4537-9032-978c66527b51/nuget/v3/registrations2/nunit/3.13.2.json", | ||
"@type": "Package", | ||
"catalogEntry": { | ||
"listed": true, | ||
"projectUrl": "https://nunit.org/", | ||
"published": "2021-12-03T03:20:52Z", | ||
"version": "3.13.2" | ||
}, | ||
"packageContent": "https://pkgs.dev.azure.com/organisationName/_packaging/2745c5e9-610a-4537-9032-978c66527b51/nuget/v3/flat2/nunit/3.13.2/nunit.3.13.2.nupkg" | ||
}, | ||
{ | ||
"@id": "https://pkgs.dev.azure.com/organisationName/_packaging/2745c5e9-610a-4537-9032-978c66527b51/nuget/v3/registrations2/nunit/2.7.1.json", | ||
"@type": "Package", | ||
"catalogEntry": { | ||
"listed": true, | ||
"projectUrl": "http://nunitsoftware.com/nunitv2", | ||
"published": "2021-12-03T03:20:52Z", | ||
"version": "2.7.1" | ||
}, | ||
"packageContent": "https://pkgs.dev.azure.com/organisationName/_packaging/2745c5e9-610a-4537-9032-978c66527b51/nuget/v3/flat2/nunit/2.7.1/nunit.2.7.1.nupkg" | ||
}, | ||
{ | ||
"@id": "https://pkgs.dev.azure.com/organisationName/_packaging/2745c5e9-610a-4537-9032-978c66527b51/nuget/v3/registrations2/nunit/2.6.5.json", | ||
"@type": "Package", | ||
"catalogEntry": { | ||
"listed": true, | ||
"projectUrl": "http://nunit.org/", | ||
"published": "2021-12-03T03:20:52Z", | ||
"version": "2.6.5" | ||
}, | ||
"packageContent": "https://pkgs.dev.azure.com/organisationName/_packaging/2745c5e9-610a-4537-9032-978c66527b51/nuget/v3/flat2/nunit/2.6.5/nunit.2.6.5.nupkg" | ||
}, | ||
{ | ||
"@id": "https://pkgs.dev.azure.com/organisationName/_packaging/2745c5e9-610a-4537-9032-978c66527b51/nuget/v3/registrations2/nunit/2.5.7.10213.json", | ||
"@type": "Package", | ||
"catalogEntry": { | ||
"listed": true, | ||
"projectUrl": "", | ||
"published": "2021-12-03T03:20:52Z", | ||
"version": "2.5.7.10213" | ||
}, | ||
"packageContent": "https://pkgs.dev.azure.com/organisationName/_packaging/2745c5e9-610a-4537-9032-978c66527b51/nuget/v3/flat2/nunit/2.5.7.10213/nunit.2.5.7.10213.nupkg" | ||
} | ||
], | ||
"lower": "2.5.7.10213", | ||
"upper": "3.13.2" | ||
} | ||
] | ||
} |
14 changes: 14 additions & 0 deletions
14
lib/modules/datasource/nuget/__fixtures__/azure_devops/v3_index.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"resources": [ | ||
{ | ||
"@id": "https://pkgs.dev.azure.com/organisationName/_packaging/2745c5e9-610a-4537-9032-978c66527b51/nuget/v3/registrations2-semver2/", | ||
"@type": "RegistrationsBaseUrl/3.6.0", | ||
"comment": "This base URL includes SemVer 2.0.0 packages." | ||
}, | ||
{ | ||
"@id": "https://pkgs.dev.azure.com/organisationName/_packaging/2745c5e9-610a-4537-9032-978c66527b51/nuget/v3/flat2/", | ||
"@type": "PackageBaseAddress/3.0.0" | ||
} | ||
], | ||
"version": "3.0.0-beta" | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { sortNugetVersions } from './v3'; | ||
|
||
describe('modules/datasource/nuget/v3', () => { | ||
it.each<{ version: string; other: string; result: number }>` | ||
version | other | result | ||
${'invalid1'} | ${'invalid2'} | ${0} | ||
${'invalid'} | ${'1.0.0'} | ${-1} | ||
${'1.0.0'} | ${'invalid'} | ${1} | ||
${'1.0.0-rc.1'} | ${'1.0.0'} | ${-1} | ||
${'1.0.0'} | ${'1.0.0-rc.1'} | ${1} | ||
${'1.0.0'} | ${'1.0.0'} | ${0} | ||
`( | ||
'sortNugetVersions("$version", "$other") === $result', | ||
({ version, other, result }) => { | ||
const res = sortNugetVersions(version, other); | ||
expect(res).toBe(result); | ||
} | ||
); | ||
}); |
This file contains 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