feat(supported-versions): add release date (#100)

Previously, we didn't take into account a release date, which meant
that @vinai could not add MageOS or Magento releases before the actual
day of release.

With this, we can now add the releases to supported verisons before
a release comes out, allowing us to make a kind that allows testing
MageOS and Magento Mirror releases more quickly.
This commit is contained in:
Damien Retzinger
2023-08-16 05:57:48 -06:00
committed by GitHub
parent c093834133
commit 5599a0d2e7
6 changed files with 57 additions and 15 deletions
@@ -11,16 +11,7 @@ describe('getCurrentlySupportedVersions', () => {
// versions.
['2023-01-01T00:00:00Z', 'First day of 2023', [
'magento/project-community-edition:2.4.4-p2',
'magento/project-community-edition:2.4.4-p3',
'magento/project-community-edition:2.4.4-p4',
'magento/project-community-edition:2.4.4-p5',
'magento/project-community-edition:2.4.5-p1',
'magento/project-community-edition:2.4.5-p2',
'magento/project-community-edition:2.4.5-p3',
'magento/project-community-edition:2.4.5-p4',
'magento/project-community-edition:2.4.6',
'magento/project-community-edition:2.4.6-p1',
'magento/project-community-edition:2.4.6-p2',
'magento/project-community-edition:2.4.5-p1',
]],
['2024-01-01T00:00:00Z', 'First day of 2024', [
'magento/project-community-edition:2.4.4-p5',
@@ -36,6 +27,15 @@ describe('getCurrentlySupportedVersions', () => {
'magento/project-community-edition:2.4.5-p4',
'magento/project-community-edition:2.4.6-p2',
]],
['2023-03-14T00:00:00Z', 'Day of v2.4.6 Release', [
'magento/project-community-edition:2.4.4-p2',
'magento/project-community-edition:2.4.5-p1'
]],
['2023-03-15T00:00:00Z', 'Day after v2.4.6 Release', [
'magento/project-community-edition:2.4.4-p3',
'magento/project-community-edition:2.4.5-p2',
'magento/project-community-edition:2.4.6'
]],
['2025-08-09T00:00:00Z', 'Day of v2.4.5 EoL', [
'magento/project-community-edition:2.4.5-p4',
'magento/project-community-edition:2.4.6-p2',
@@ -3,5 +3,9 @@ import allVersions from '../versions/individual.json';
export const getCurrentlySupportedVersions = (date: Date): string[] =>
Object.entries(<Record<string,MagentoMatrixVersion>>allVersions)
.filter(([key, value]) => new Date(value.eol) >= date)
.filter(([key, value]) => {
const dayAfterRelease = new Date(value.release);
dayAfterRelease.setDate(dayAfterRelease.getDate() + 1);
return date >= dayAfterRelease && new Date(value.eol) >= date;
})
.map(([key, value]) => key);