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

Skip install in dependencies map calculation if requested #277

Merged
merged 6 commits into from
Sep 30, 2024

Conversation

eranturgeman
Copy link
Contributor

@eranturgeman eranturgeman commented Sep 25, 2024

  • All tests passed. If this feature is not already covered by the tests, I added new tests.
  • All static analysis checks passed.
  • This pull request is on the dev branch.
  • I used gofmt for formatting the code before submitting the pull request.

This PR contains changes to NPM installation process when calculating dependencies map.
We currently add a new ability to skip installation of a project if requested by the user.
This new functionality will be available through Frogbot and will currently apply only to Yarn and NPM (for WalkMe POC)
The changes reflected here are only in NPM files due to the way NPM dependencies map calculation is performed. In the near future we opt to re-write this logic and take the installation logic to cli-security and leave only the map construction in build-info-go.
Tests were added as well.
The new logic is as follows:

  1. If the user has provided an 'install command' - we execute this command whether the project is installed or not (this is the logic we aim in all other PMs as well)
  2. If there is no 'install command' and the project is not installed, while the user prohibited installation - we throw a new error to indicate that and handle this error later in the process
  3. If there is no 'install command' and the project is not installed and the is no prohibition to install- we install using a default install command, as we do today

@eranturgeman eranturgeman added the ignore for release Automatically generated release notes label Sep 25, 2024
@eranturgeman eranturgeman added improvement Automatically generated release notes and removed ignore for release Automatically generated release notes labels Sep 25, 2024
@eranturgeman eranturgeman changed the title Skip install and dependencies map calc if requested Skip install in dependencies map calculation if requested Sep 25, 2024
Copy link
Contributor

@eyalbe4 eyalbe4 left a comment

Choose a reason for hiding this comment

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

Let's create PRs for the jfrog-cli-core and jfrog-cli project, to make sure the tests there pass following this change.

build/utils/npm.go Outdated Show resolved Hide resolved
build/utils/npm_test.go Outdated Show resolved Hide resolved
build/utils/npm_test.go Outdated Show resolved Hide resolved
build/utils/npm_test.go Outdated Show resolved Hide resolved
Copy link

👍 Frogbot scanned this pull request and did not find any new security issues.


@eyalbe4 eyalbe4 merged commit 7bd47c2 into jfrog:dev Sep 30, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Automatically generated release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants