Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: linux node installation (#14657) (CP: 23.2) #14825

Merged
merged 1 commit into from
Oct 13, 2022
Merged

Conversation

Artur-
Copy link
Member

@Artur- Artur- commented Oct 13, 2022

Fix installation of node for unix systems.
NodeJS 18 is more strict about where
the contents are located than old versions.

Fixes #14636

Fix installation of node for unix systems.
NodeJS 18 is more strict about where
the contents are located than old versions.

Fixes #14636
@Artur- Artur- requested a review from caalador October 13, 2022 11:00
@caalador caalador enabled auto-merge (squash) October 13, 2022 11:02
@sonarcloud
Copy link

sonarcloud bot commented Oct 13, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@@ -33,7 +33,9 @@ public class FrontendStubs {
public static final String VITE_SERVER = "node_modules/vite/bin/vite.js";
public static final String VITE_TEST_OUT_FILE = "vite-out.test";

private static final String NPM_BIN_PATH = "node/node_modules/npm/bin";
private static final String NPM_BIN_PATH = System.getProperty("os.name")
.startsWith("Windows") ? "node/node_modules/npm/bin/"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NULL_DEREFERENCE: object returned by getProperty("os.name") could be null and is dereferenced at line 37.


ℹ️ Learn about @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.


Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

@@ -315,7 +317,8 @@ private void extractUnixNpm(InstallData data, File destinationDirectory)
File tmpNodeModulesDir = new File(data.getTmpDirectory(),
data.getNodeFilename() + File.separator + "lib" + File.separator
+ FrontendUtils.NODE_MODULES);
File nodeModulesDirectory = new File(destinationDirectory,
File nodeModulesDirectory = new File(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💬 3 similar findings have been found in this PR


PATH_TRAVERSAL_IN: This API (java/io/File.(Ljava/lang/String;Ljava/lang/String;)V) reads a file whose location might be specified by user input


🔎 Expand here to view all instances of this finding
File Path Line Number
flow-server/src/main/java/com/vaadin/flow/server/frontend/FrontendTools.java 1069
flow-server/src/main/java/com/vaadin/flow/server/frontend/installer/NodeInstaller.java 332
flow-server/src/main/java/com/vaadin/flow/server/frontend/installer/NodeInstaller.java 446

Visit the Lift Web Console to find more details in your report.


ℹ️ Learn about @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.


Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

@github-actions
Copy link

Unit Test Results

   930 files  ±  0     930 suites  ±0   54m 35s ⏱️ + 4m 46s
6 057 tests ±  0  6 003 ✔️  - 1  54 💤 +1  0 ±0 
6 277 runs   - 11  6 219 ✔️  - 9  58 💤  - 2  0 ±0 

Results for commit beb3b09. ± Comparison against base commit 262878d.

@caalador caalador merged commit 9cb944a into 23.2 Oct 13, 2022
@caalador caalador deleted the backport-node-install branch October 13, 2022 12:09
@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Vaadin 23.2.6.

caalador pushed a commit that referenced this pull request Nov 14, 2022
Fix installation of node for unix systems.
NodeJS 18 is more strict about where
the contents are located than old versions.

Fixes #14636

Co-authored-by: caalador <mikael.grankvist@vaadin.com>
# Conflicts:
#	flow-test-generic/src/main/java/com/vaadin/flow/testutil/FrontendStubs.java
caalador added a commit that referenced this pull request Nov 14, 2022
Fix installation of node for unix systems.
NodeJS 18 is more strict about where
the contents are located than old versions.

Fixes #14636

Co-authored-by: caalador <mikael.grankvist@vaadin.com>
# Conflicts:
#	flow-test-generic/src/main/java/com/vaadin/flow/testutil/FrontendStubs.java

Co-authored-by: Artur <artur@vaadin.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants