Skip to content

Commit

Permalink
Remove support for Node.JS 16 (#4606)
Browse files Browse the repository at this point in the history
  • Loading branch information
saberduck authored Mar 21, 2024
1 parent 8e96590 commit 0f4351d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .cirrus/nodejs.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM ${CIRRUS_AWS_ACCOUNT}.dkr.ecr.eu-central-1.amazonaws.com/base:j17-latest

USER root

ARG NODE_VERSION=16
ARG NODE_VERSION=18

RUN curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION}.x | bash - \
&& apt-get install -y nodejs=${NODE_VERSION}.* \
Expand Down
2 changes: 1 addition & 1 deletion sonar-plugin/sonar-javascript-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@
<!-- This is used to get plugin version at runtime using getPackage().getImplementationVersion() -->
<Implementation-Version>${project.version}</Implementation-Version>
<!-- Keep in sync with NodeDeprecationWarning#MIN_SUPPORTED_NODE_VERSION -->
<NodeJs-Min-Version>16.0.0</NodeJs-Min-Version>
<NodeJs-Min-Version>18.18.0</NodeJs-Min-Version>
</manifestEntries>
</transformer>
</transformers>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,10 @@

/**
* Currently supported versions ('supported' means that we execute the analysis):
* 14 - deprecated (support will be removed not earlier than April 1, 2023)
* 15 - deprecated (support will be removed not earlier than April 1, 2023), not recommended
* 16 - nothing to warn, recommended version
* 17 - not recommended
* 18 - nothing to warn, recommended version
* 19 - not recommended
* 20 - nothing to warn, recommended version
* 21 - nothing to warn, recommended version
*/
@ScannerSide
@SonarLintSide(lifespan = SonarLintSide.MULTIPLE_ANALYSES)
Expand All @@ -54,10 +53,10 @@ public class NodeDeprecationWarning {
* The minor version is a requirement from the ESLint version that the bridge uses.
* @see https://github.com/eslint/eslint/blob/d75d3c68ad8c98828aaa522b87ec267ab2dcb002/package.json#L169
*/
static final Version MIN_SUPPORTED_NODE_VERSION = Version.create(16, 0, 0);
static final Version MIN_SUPPORTED_NODE_VERSION = Version.create(18, 18, 0);
static final int MIN_RECOMMENDED_NODE_VERSION = 18;
static final List<Integer> RECOMMENDED_NODE_VERSIONS = Arrays.asList(18, 20);
static final List<Integer> ALL_RECOMMENDED_NODE_VERSIONS = Arrays.asList(16, 18, 20);
static final List<Integer> ALL_RECOMMENDED_NODE_VERSIONS = Arrays.asList(18, 20, 21);
private final AnalysisWarningsWrapper analysisWarnings;

public NodeDeprecationWarning(AnalysisWarningsWrapper analysisWarnings) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,23 +54,15 @@ public void addUnique(String text) {
void test_recommended() {
deprecationWarning.logNodeDeprecation(18);
deprecationWarning.logNodeDeprecation(20);
deprecationWarning.logNodeDeprecation(21);
assertWarnings();
}

@Test
void test_16() {
deprecationWarning.logNodeDeprecation(16);
void test_19() {
deprecationWarning.logNodeDeprecation(19);
assertWarnings(
"Using Node.js version 16 to execute analysis is deprecated and will stop being supported no earlier than Jan 31th, 2024. Please upgrade to a newer LTS version of Node.js [18, 20]"
);
}

@Test
void test_17() {
deprecationWarning.logNodeDeprecation(17);
assertWarnings(
"Using Node.js version 17 to execute analysis is deprecated and will stop being supported no earlier than Jan 31th, 2024. Please upgrade to a newer LTS version of Node.js [18, 20]",
"Node.js version 17 is not recommended, you might experience issues. Please use a recommended version of Node.js [18, 20]"
"Node.js version 19 is not recommended, you might experience issues. Please use a recommended version of Node.js [18, 20]"
);
}

Expand Down

0 comments on commit 0f4351d

Please sign in to comment.