Skip to content

feat: swallow exceptions on unparseable NPM package versions - #14233

Merged
mcollovati merged 7 commits into
masterfrom
feat/skip-unparseable-npm-versions
Aug 2, 2022
Merged

mcollovati merged 7 commits into
masterfrom
feat/skip-unparseable-npm-versions

Conversation

@cromoteca

Copy link
Copy Markdown
Contributor

When checking for new NPM package versions, let's skip all versions that we do not understand.

Closes #14217

@mshabarov mshabarov added the Contribution PRs coming from the community or external to the team label Jul 29, 2022
@cromoteca
cromoteca marked this pull request as draft July 29, 2022 09:16
@github-actions

github-actions Bot commented Jul 29, 2022 •

Copy link
Copy Markdown
Contributor

Unit Test Results

   905 files  ±0     905 suites  ±0   54m 28s ⏱️ + 3m 14s
5 903 tests +2  5 860 ✔️ +2  43 💤 ±0  0 ❌ ±0 
6 125 runs  +1  6 076 ✔️ +2  49 💤  - 1  0 ❌ ±0 

Results for commit e9455ba. ± Comparison against base commit 0b4be6e.

♻️ This comment has been updated with latest results.

@mcollovati

mcollovati commented Aug 1, 2022 •

Copy link
Copy Markdown
Collaborator

We discussed internally and choose to handle two try/catch statements.

  • for newVersion we will throw the exception if the version is not parsable, since the value is originated in Flow code and should always be correct
  • for existingVersion we will catch the exception, log the error and return false, so that the value from package.json is not replaced

I'll take care of this changes as soon of possible

@mcollovati mcollovati self-assigned this Aug 1, 2022
@cromoteca

Copy link
Copy Markdown
Contributor Author

We discussed internally and choose to handle two try/catch statements.

OK. In the meanwhile, I got the newVersion calculation out of the try/catch block, so the exception can propagate.

Co-authored-by: Marco Collovati <marco@vaadin.com>
@mcollovati
mcollovati enabled auto-merge (squash) August 2, 2022 07:59
@sonarqubecloud

sonarqubecloud Bot commented Aug 2, 2022

Copy link
Copy Markdown

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 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@vaadin-bot

Copy link
Copy Markdown
Collaborator

This ticket/PR has been released with Vaadin 23.2.0.beta1 and is also targeting the upcoming stable 23.2.0 version.

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.

build-frontend goal fails on npm package versions which are not regular version numbers

4 participants