fix(datasource/dotnet-version): use sdks property to find all sdk version (#26031)

This commit is contained in:
Michael Kriese 2023-11-29 14:19:33 +01:00 committed by GitHub
parent 4d60390554
commit dda5f189ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 122 additions and 73 deletions

View file

@ -15,10 +15,12 @@
"version": "3.1.29", "version": "3.1.29",
"version-display": "3.1.29" "version-display": "3.1.29"
}, },
"sdk": { "sdks": [
"version": "3.1.423", {
"version-display": "3.1.423" "version": "3.1.423",
} "version-display": "3.1.423"
}
]
}, },
{ {
"release-date": "2020-01-14", "release-date": "2020-01-14",
@ -29,10 +31,12 @@
"version": "3.1.1", "version": "3.1.1",
"version-display": "3.1.1" "version-display": "3.1.1"
}, },
"sdk": { "sdks": [
"version": "3.1.101", {
"version-display": "3.1.101" "version": "3.1.101",
} "version-display": "3.1.101"
}
]
}, },
{ {
"release-date": "2019-12-03", "release-date": "2019-12-03",
@ -43,10 +47,12 @@
"version": "3.1.0", "version": "3.1.0",
"version-display": "3.1.0" "version-display": "3.1.0"
}, },
"sdk": { "sdks": [
"version": "3.1.100", {
"version-display": "3.1.100" "version": "3.1.100",
} "version-display": "3.1.100"
}
]
}, },
{ {
"release-date": "2019-10-15", "release-date": "2019-10-15",
@ -57,10 +63,12 @@
"version": "3.1.0-preview1.19506.1", "version": "3.1.0-preview1.19506.1",
"version-display": "3.1.0-preview1" "version-display": "3.1.0-preview1"
}, },
"sdk": { "sdks": [
"version": "3.1.100-preview1-014459", {
"version-display": "3.1.100-preview1" "version": "3.1.100-preview1-014459",
} "version-display": "3.1.100-preview1"
}
]
} }
] ]
} }

View file

@ -15,10 +15,12 @@
"version": "5.0.17", "version": "5.0.17",
"version-display": "5.0.17" "version-display": "5.0.17"
}, },
"sdk": { "sdks": [
"version": "5.0.408", {
"version-display": "5.0.408" "version": "5.0.408",
} "version-display": "5.0.408"
}
]
}, },
{ {
"release-date": "2020-12-08", "release-date": "2020-12-08",
@ -29,10 +31,12 @@
"version": "5.0.1", "version": "5.0.1",
"version-display": "5.0.1" "version-display": "5.0.1"
}, },
"sdk": { "sdks": [
"version": "5.0.101", {
"version-display": "5.0.101" "version": "5.0.101",
} "version-display": "5.0.101"
}
]
}, },
{ {
"release-date": "2020-11-10", "release-date": "2020-11-10",
@ -43,10 +47,12 @@
"version": "5.0.0", "version": "5.0.0",
"version-display": "5.0.0" "version-display": "5.0.0"
}, },
"sdk": { "sdks": [
"version": "5.0.100", {
"version-display": "5.0.100" "version": "5.0.100",
} "version-display": "5.0.100"
}
]
}, },
{ {
"release-date": "2020-09-14", "release-date": "2020-09-14",
@ -57,10 +63,12 @@
"version": "5.0.0-rc.1.20451.14", "version": "5.0.0-rc.1.20451.14",
"version-display": "5.0.0-rc.1" "version-display": "5.0.0-rc.1"
}, },
"sdk": { "sdks": [
"version": "5.0.100-rc.1.20452.10", {
"version-display": "5.0.100-rc.1" "version": "5.0.100-rc.1.20452.10",
} "version-display": "5.0.100-rc.1"
}
]
}, },
{ {
"release-date": "2020-08-25", "release-date": "2020-08-25",
@ -71,10 +79,12 @@
"version": "5.0.0-preview.8.20407.11", "version": "5.0.0-preview.8.20407.11",
"version-display": "5.0.0-preview.8" "version-display": "5.0.0-preview.8"
}, },
"sdk": { "sdks": [
"version": "5.0.100-preview.8.20417.9", {
"version-display": "5.0.100-preview.8" "version": "5.0.100-preview.8.20417.9",
} "version-display": "5.0.100-preview.8"
}
]
}, },
{ {
"release-date": "2020-03-16", "release-date": "2020-03-16",
@ -85,10 +95,12 @@
"version": "5.0.0-preview.1.20120.5", "version": "5.0.0-preview.1.20120.5",
"version-display": "5.0.0-preview.1" "version-display": "5.0.0-preview.1"
}, },
"sdk": { "sdks": [
"version": "5.0.100-preview.1.20155.7", {
"version-display": "5.0.100-preview.1" "version": "5.0.100-preview.1.20155.7",
} "version-display": "5.0.100-preview.1"
}
]
} }
] ]
} }

View file

@ -15,10 +15,20 @@
"version": "6.0.9", "version": "6.0.9",
"version-display": "6.0.9" "version-display": "6.0.9"
}, },
"sdk": { "sdks": [
"version": "6.0.401", {
"version-display": "6.0.401" "version": "6.0.401",
} "version-display": "6.0.401"
},
{
"version": "6.0.304",
"version-display": "6.0.304"
},
{
"version": "6.0.109",
"version-display": "6.0.109"
}
]
}, },
{ {
"release-date": "2021-12-14", "release-date": "2021-12-14",
@ -29,10 +39,12 @@
"version": "6.0.1", "version": "6.0.1",
"version-display": "6.0.1" "version-display": "6.0.1"
}, },
"sdk": { "sdks": [
"version": "6.0.101", {
"version-display": "6.0.101" "version": "6.0.101",
} "version-display": "6.0.101"
}
]
}, },
{ {
"release-date": "2021-11-08", "release-date": "2021-11-08",
@ -43,10 +55,12 @@
"version": "6.0.0", "version": "6.0.0",
"version-display": "6.0.0" "version-display": "6.0.0"
}, },
"sdk": { "sdks": [
"version": "6.0.100", {
"version-display": "6.0.100" "version": "6.0.100",
} "version-display": "6.0.100"
}
]
}, },
{ {
"release-date": "2021-09-14", "release-date": "2021-09-14",
@ -57,10 +71,12 @@
"version": "6.0.0-rc.1.21451.13", "version": "6.0.0-rc.1.21451.13",
"version-display": "6.0.0-rc.1" "version-display": "6.0.0-rc.1"
}, },
"sdk": { "sdks": [
"version": "6.0.100-rc.1.21463.6", {
"version-display": "6.0.100-rc.1" "version": "6.0.100-rc.1.21463.6",
} "version-display": "6.0.100-rc.1"
}
]
}, },
{ {
"release-date": "2021-02-17", "release-date": "2021-02-17",
@ -71,10 +87,12 @@
"version": "6.0.0-preview.1.21102.12", "version": "6.0.0-preview.1.21102.12",
"version-display": "6.0.0-preview.1" "version-display": "6.0.0-preview.1"
}, },
"sdk": { "sdks": [
"version": "6.0.100-preview.1.21103.13", {
"version-display": "6.0.100-preview.1" "version": "6.0.100-preview.1.21103.13",
} "version-display": "6.0.100-preview.1"
}
]
} }
] ]
} }

View file

@ -15,10 +15,12 @@
"version": "7.0.0-rc.1.22426.10", "version": "7.0.0-rc.1.22426.10",
"version-display": "7.0.0-rc.1" "version-display": "7.0.0-rc.1"
}, },
"sdk": { "sdks": [
"version": "7.0.100-rc.1.22431.12", {
"version-display": "7.0.100-rc.1" "version": "7.0.100-rc.1.22431.12",
} "version-display": "7.0.100-rc.1"
}
]
}, },
{ {
"release-date": "2022-02-17", "release-date": "2022-02-17",
@ -29,10 +31,12 @@
"version": "7.0.0-preview.1.22076.8", "version": "7.0.0-preview.1.22076.8",
"version-display": "7.0.0-preview.1" "version-display": "7.0.0-preview.1"
}, },
"sdk": { "sdks": [
"version": "7.0.100-preview.1.22110.4", {
"version-display": "7.0.100-preview.1" "version": "7.0.100-preview.1.22110.4",
} "version-display": "7.0.100-preview.1"
}
]
} }
] ]
} }

View file

@ -126,7 +126,7 @@ describe('modules/datasource/dotnet-version/index', () => {
expect(res).toBeDefined(); expect(res).toBeDefined();
expect(res?.sourceUrl).toBe('https://github.com/dotnet/sdk'); expect(res?.sourceUrl).toBe('https://github.com/dotnet/sdk');
expect(res?.releases).toHaveLength(17); expect(res?.releases).toHaveLength(19);
expect(res?.releases).toIncludeAllPartialMembers([ expect(res?.releases).toIncludeAllPartialMembers([
{ version: '3.1.100-preview1-014459' }, { version: '3.1.100-preview1-014459' },
{ version: '3.1.423' }, { version: '3.1.423' },
@ -134,6 +134,8 @@ describe('modules/datasource/dotnet-version/index', () => {
{ version: '5.0.408' }, { version: '5.0.408' },
{ version: '6.0.100-preview.1.21103.13' }, { version: '6.0.100-preview.1.21103.13' },
{ version: '6.0.401' }, { version: '6.0.401' },
{ version: '6.0.304' },
{ version: '6.0.109' },
{ version: '7.0.100-preview.1.22110.4' }, { version: '7.0.100-preview.1.22110.4' },
{ version: '7.0.100-rc.1.22431.12' }, { version: '7.0.100-rc.1.22431.12' },
]); ]);

View file

@ -26,17 +26,22 @@ export const DotnetSdkReleases = z
.object({ .object({
releases: LooseArray( releases: LooseArray(
ReleaseBase.extend({ ReleaseBase.extend({
sdk: ReleaseDetails, sdks: z.array(ReleaseDetails),
}), }),
).catch([]), ).catch([]),
}) })
.transform(({ releases }): Release[] => .transform(({ releases }): Release[] =>
releases.map( releases.flatMap(
({ ({
sdk: { version }, sdks,
'release-date': releaseTimestamp, 'release-date': releaseTimestamp,
'release-notes': changelogUrl, 'release-notes': changelogUrl,
}) => ({ version, releaseTimestamp, changelogUrl }), }) =>
sdks.map(({ version }) => ({
version,
releaseTimestamp,
changelogUrl,
})),
), ),
); );