forked from aws/jsii
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: automated node runtime deprecation warnings (aws#3499)
This changes how the node release support information is modeled so that the end-of-life dates are configured, so that `@jsii/check-node` can automatically start warning a month ahead of a runtime's EOL date, so we can drop support right on EOL day if needed wihtout taking users by surprise. This also includes tweaks of the messages that get printed out to STDERR when an unsupported/untested/deprecated/end-of-life version is being used, to increase clarity of provide more information about migration options. Finally, this adds node 18 (initial release `2022-04-19`) to the test matrix.
- Loading branch information
1 parent
db2d62e
commit 2ace7c9
Showing
11 changed files
with
330 additions
and
137 deletions.
There are no files selected for viewing
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
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
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 |
---|---|---|
@@ -1,23 +1,28 @@ | ||
| Release | Status | | ||
| --------- | ---------------------------- | | ||
| `<12.7.0` | :x: Defunct | | ||
| `^12.7.0` | :white_check_mark: Supported | | ||
| `^13.0.0` | :x: Defunct | | ||
| `^14.0.0` | :white_check_mark: Supported | | ||
| `^15.0.0` | :x: Defunct | | ||
| `^16.0.0` | :white_check_mark: Supported | | ||
!!! info "The following node releases are part of our test matrix:" | ||
|
||
??? question "Status Definitions" | ||
- **:white_check_mark: Supported**: Long Term Support (LTS) releases (those with an even major version) are | ||
supported and bugs specific to those releases are addressed with the highest priority. Every `jsii` release is | ||
automatically tested against those releases. | ||
- **:test_tube: Best effort**: Development releases (those with an odd major version) are supported on a best-effort | ||
basis. No automated testing is performed against those releases. | ||
- **:warning: Unsupported**: End-of-Life releases are not supported. Bugs affecting those may not be fixed, and | ||
users are strongly advised to migrate to more recent releases. | ||
- **:x: Defunct**: Very old releases (these have been End-of-Live for a while now) are unlikely to work at all. | ||
| Release | Status | End-of-Life | | ||
| --------- | ---------------------------- | ------------ | | ||
| `^12.7.0` | :white_check_mark: Supported | `2022-04-30` | | ||
| `^14.5.0` | :white_check_mark: Supported | `2023-04-30` | | ||
| `^16.3.0` | :white_check_mark: Supported | `2024-04-30` | | ||
| `^17.3.0` | :test_tube: Best effort | `2022-06-01` | | ||
| `^18.0.0` | :white_check_mark: Supported | `2025-04-30` | | ||
|
||
??? question "Status Definitions" | ||
- **:white_check_mark: Supported**: Long Term Support (LTS) releases (those with an even major version) are | ||
supported and bugs specific to those releases are addressed with the highest priority. Every `jsii` release is | ||
automatically tested against those releases. | ||
- **:test_tube: Best effort**: Development releases (those with an odd major version) are supported on a | ||
best-effort basis. Some of these releases may include breaking changes or bugs that may cause runtime errors | ||
that we may not be able to fix. | ||
|
||
Releases not in the matrix might work, but are not guaranteed to: they can be considered to fall under the | ||
**:test_tube: Best Effort** umbrella, unless they are end-of-life. Releases past end-of-life are unlikely to work, | ||
or may stop working with any future release. | ||
|
||
The [node releases schedule][node-releases] provides up-to-date information on the current status of all active | ||
releases, and indicates the timelines for support (including planned End-of-Life dates for each). | ||
|
||
[node-releases]: https://nodejs.org/en/about/releases/ | ||
|
||
|
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,74 @@ | ||
import { NodeRelease } from './constants'; | ||
|
||
test('supported release', () => { | ||
const endOfLife = new Date(Date.now() + 31 * 86_400_000); | ||
const subject = new NodeRelease(42, { endOfLife }); | ||
|
||
expect(subject).toMatchObject({ | ||
deprecated: false, | ||
endOfLife: false, | ||
endOfLifeDate: endOfLife, | ||
untested: false, | ||
supported: true, | ||
supportedRange: expect.objectContaining({ raw: '^42.0.0' }), | ||
}); | ||
}); | ||
|
||
test('supported release with range', () => { | ||
const endOfLife = new Date(Date.now() + 31 * 86_400_000); | ||
const subject = new NodeRelease(42, { | ||
endOfLife, | ||
supportedRange: '^42.1337.0', | ||
}); | ||
|
||
expect(subject).toMatchObject({ | ||
deprecated: false, | ||
endOfLife: false, | ||
endOfLifeDate: endOfLife, | ||
untested: false, | ||
supported: true, | ||
supportedRange: expect.objectContaining({ raw: '^42.1337.0' }), | ||
}); | ||
}); | ||
|
||
test('untested release', () => { | ||
const endOfLife = new Date(Date.now() + 31 * 86_400_000); | ||
const subject = new NodeRelease(42, { endOfLife, untested: true }); | ||
|
||
expect(subject).toMatchObject({ | ||
deprecated: false, | ||
endOfLife: false, | ||
endOfLifeDate: endOfLife, | ||
untested: true, | ||
supported: false, | ||
supportedRange: expect.objectContaining({ raw: '^42.0.0' }), | ||
}); | ||
}); | ||
|
||
test('deprecated release', () => { | ||
const endOfLife = new Date(Date.now() + 25 * 86_400_000); | ||
const subject = new NodeRelease(42, { endOfLife }); | ||
|
||
expect(subject).toMatchObject({ | ||
deprecated: true, | ||
endOfLife: false, | ||
endOfLifeDate: endOfLife, | ||
untested: false, | ||
supported: true, | ||
supportedRange: expect.objectContaining({ raw: '^42.0.0' }), | ||
}); | ||
}); | ||
|
||
test('EOL release', () => { | ||
const endOfLife = new Date(); | ||
const subject = new NodeRelease(42, { endOfLife }); | ||
|
||
expect(subject).toMatchObject({ | ||
deprecated: false, | ||
endOfLife: true, | ||
endOfLifeDate: endOfLife, | ||
untested: false, | ||
supported: false, | ||
supportedRange: expect.objectContaining({ raw: '^42.0.0' }), | ||
}); | ||
}); |
Oops, something went wrong.