Skip to content

Commit

Permalink
chore: automated node runtime deprecation warnings (aws#3499)
Browse files Browse the repository at this point in the history
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
RomainMuller authored Apr 27, 2022
1 parent db2d62e commit 2ace7c9
Show file tree
Hide file tree
Showing 11 changed files with 330 additions and 137 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: ['12', '14', '16']
node: ['12', '14', '16', '18']
env:
# Node version whose images will be aliased without the -nodeXX segment
DEFAULT_NODE_MAJOR_VERSION: 12
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,12 @@ jobs:
dotnet: ['3.1.x']
go: ['1.16']
java: ['8']
node: ['12', '14', '16', '17']
node:
- '12' # EOL 2022-04-30
- '14' # EOL 2023-04-30
- '16' # EOL 2024-04-30
- '17' # EOL 2022-06-01
- '18' # EOL 2025-04-30
os: [ubuntu-latest]
python: ['3.7']
# Add specific combinations to be tested against "node 12" (to restrict cardinality)
Expand Down
4 changes: 4 additions & 0 deletions .mergify/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ queue_rules:
- status-success~=^Test \(.* node 14 .*$
- status-success~=^Test \(.* node 16 .*$
- status-success~=^Test \(.* node 17 .*$
- status-success~=^Test \(.* node 18 .*$
# One test for each supported dotnet version
- status-success~=^Test \(.* dotnet 3\.1\.x .*$
- status-success~=^Test \(.* dotnet 5\.0\.x .*$
Expand Down Expand Up @@ -62,6 +63,7 @@ pull_request_rules:
- status-success~=^Test \(.* node 14 .*$
- status-success~=^Test \(.* node 16 .*$
- status-success~=^Test \(.* node 17 .*$
- status-success~=^Test \(.* node 18 .*$
# One test for each supported dotnet version
- status-success~=^Test \(.* dotnet 3\.1\.x .*$
- status-success~=^Test \(.* dotnet 5\.0\.x .*$
Expand Down Expand Up @@ -112,6 +114,7 @@ pull_request_rules:
- status-success~=^Test \(.* node 14 .*$
- status-success~=^Test \(.* node 16 .*$
- status-success~=^Test \(.* node 17 .*$
- status-success~=^Test \(.* node 18 .*$
# One test for each supported dotnet version
- status-success~=^Test \(.* dotnet 3\.1\.x .*$
- status-success~=^Test \(.* dotnet 5\.0\.x .*$
Expand Down Expand Up @@ -162,6 +165,7 @@ pull_request_rules:
- status-success~=^Test \(.* node 14 .*$
- status-success~=^Test \(.* node 16 .*$
- status-success~=^Test \(.* node 17 .*$
- status-success~=^Test \(.* node 18 .*$
# One test for each supported dotnet version
- status-success~=^Test \(.* dotnet 3\.1\.x .*$
- status-success~=^Test \(.* dotnet 5\.0\.x .*$
Expand Down
2 changes: 1 addition & 1 deletion gh-pages/content/user-guides/lib-author/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ to produce releasable artifacts.
| Language/Platform | SDK Requirement |
| ----------------- | ---------------------------- |
| .NET | .NET Core ≥ 3.1 / .NET ≥ 5.0 |
| Go | Go ≥ 1.15 |
| Go | Go ≥ 1.16 |
| Java | JDK ≥ 8 *and* Maven ≥ 3.6 |
| Python | Python ≥ 3.7 |

Expand Down
39 changes: 22 additions & 17 deletions gh-pages/partials/node-support-table.md
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/


2 changes: 1 addition & 1 deletion packages/@jsii/check-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"directory": "packages/@jsii/check-node"
},
"engines": {
"node": ">= 10.3.0"
"node": ">= 12.7.0"
},
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down
74 changes: 74 additions & 0 deletions packages/@jsii/check-node/src/constants.test.ts
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' }),
});
});
Loading

0 comments on commit 2ace7c9

Please sign in to comment.