Skip to content

fix: change SBOM maven goals lifecycle phase - #18550

Merged
mshabarov merged 5 commits into
mainfrom
sbom-lifecycle-phase
Feb 12, 2024
Merged

mshabarov merged 5 commits into
mainfrom
sbom-lifecycle-phase

Conversation

@sosa-vaadin

Copy link
Copy Markdown
Contributor

Description

  • Change the lifecycle phase of sbom generator maven goals from generate-resources to prepare-resources so that it matches the prepare-frontend maven goal.
  • Flip a boolean expression so that the package.json file is created if it doesn't exist when running the prepare-frontend maven goal.

@github-actions

github-actions Bot commented Jan 26, 2024 •

Copy link
Copy Markdown
Contributor

Test Results

1 092 files  ±0  1 092 suites  ±0   1h 21m 45s ⏱️ + 1m 23s
6 810 tests ±0  6 764 ✅ ±0  46 💤 ±0  0 ❌ ±0 
7 138 runs   - 5  7 080 ✅  - 5  58 💤 ±0  0 ❌ ±0 

Results for commit 3b62c9a. ± Comparison against base commit b8a992a.

This pull request removes 1 and adds 1 tests. Note that renamed tests count towards both.
com.vaadin.flow.plugin.maven.PrepareFrontendMojoTest ‑ should_updateAndkeepDependencies_when_packageJsonExists
com.vaadin.flow.plugin.maven.PrepareFrontendMojoTest ‑ should_updateAndKeepDependencies_when_packageJsonExists

♻️ This comment has been updated with latest results.

@mcollovati mcollovati added the Contribution PRs coming from the community or external to the team label Jan 29, 2024
@mshabarov
mshabarov requested review from mshabarov and tepi January 29, 2024 12:42
@tepi

tepi commented Jan 29, 2024

Copy link
Copy Markdown
Contributor

With the latest changes, com.vaadin.flow.server.frontend.Options#createMissingPackageJson is always called with true parameter. Should we remove the whole method?

@sosa-vaadin

Copy link
Copy Markdown
Contributor Author

With the latest changes, com.vaadin.flow.server.frontend.Options#createMissingPackageJson is always called with true parameter. Should we remove the whole method?

As far as I know, that option is only used here. We could just remove the if statement but keep its contents.

Your call.

@tepi

tepi commented Jan 29, 2024

Copy link
Copy Markdown
Contributor

Ok, I'll double-check it. I don't think we're using Options class from any other project either.

@tepi

tepi commented Jan 29, 2024

Copy link
Copy Markdown
Contributor

We also have this interesting snippet here:

// If we are missing either the base or generated package json
// files generate those
if (!new File(options.getNpmFolder(), PACKAGE_JSON).exists()) {
options.createMissingPackageJson(true);
}

@vaadin-bot vaadin-bot added +1.0.0 and removed +0.0.1 labels Jan 30, 2024
@tepi
tepi force-pushed the sbom-lifecycle-phase branch from 3b94cfa to 42ec4da Compare January 30, 2024 12:02
@vaadin-bot vaadin-bot added +0.0.1 and removed +1.0.0 labels Jan 30, 2024
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

.withJarFrontendResourcesFolder(
getJarFrontendResourcesFolder(adapter))
.createMissingPackageJson(
new File(adapter.npmFolder(), PACKAGE_JSON).exists())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this was an incorrect leftover in some old bugfix.
Setting true here looks safe to me.

@mshabarov mshabarov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks reasonable to me to not run SBOM generate goal earlier than prepare-frontend goal, as the latter prepares needed frontend meta data for SBOM.

@vaadin-bot

Copy link
Copy Markdown
Collaborator

This ticket/PR has been released with Vaadin 24.4.0.alpha4 and is also targeting the upcoming stable 24.4.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.

5 participants