-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add option to ignore out of sync lock files #49
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think this is correct, and we should instead ensure the lock files are in sync. Node package managers have flags to support this in CI.
In yarn, we have yarn install --frozen-lockfile
:
If you need reproducible dependencies, which is usually the case with the continuous integration systems, you should pass
--frozen-lockfile
flag.
In NPM, we have npm ci
:
This command is similar to npm install, except it's meant to be used in automated environments such as test platforms, continuous integration, and deployment -- or any situation where you want to make sure you're doing a clean install of your dependencies.
I think we should use these flags when installing dependencies in CI, so that the build fails if the lock file is out of date, resulting in our keeping it up to date. This also results in CI becoming more deterministic, as the versions of (direct, and transitive) dependencies installed during the build will exactly match those used locally when developing a change.
I think this is a duplicate of #42? |
@akash1810 The issue is that the out of sync package is not an NPM package but another yarn workspace from this repo. In support-dotcom-components we have We have a project to move |
Install the shared module `@sdc/shared` with a local path. This allows it to appear in the `yarn.lock` file. See: - https://docs.npmjs.com/cli/v9/configuring-npm/package-json#local-paths - guardian/.github#49
What does this change?
Because of how the support dotcom components packages are structured the snyk task fails with the following error:
This PR adds support for the
--strict-out-of-sync
option for snyk monitor.It adds a new optional boolean parameter to this task name
IGNORE_OUT_OF_SYNC
, if set to true it sets adds the option--strict-out-of-sync=false
to the snyk command.The default for
--strict-out-of-sync
is true so settingIGNORE_OUT_OF_SYNC
to false does nothing.This option is only available for npm and yarn projects.
Snyk docs.
How to test
I will use this branch's version of the task to test the support-doctom-components snyk integration and take it from there.
-> This solved the issue
How can we measure success?
Have we considered potential risks?