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

Switch to npm ci in the pipeline to avoid failures #172

Merged
merged 2 commits into from
Oct 1, 2021

Conversation

mikeisen1
Copy link
Contributor

@mikeisen1 mikeisen1 commented Sep 30, 2021

Replace npm install in the pipeline with npm ci. We are doing this to avoid pipeline failures caused by npm install modifying package-lock.json. npm ci will not modify that file and it also provides more detailed messaging when a dependency error arises during a workflow run.

Replace, in workflow and project build files, npm
install with npm ci, unless the npm install is a
global installation. This solves unexpected pipeline
failures and provides information on which
dependencies need to be added, if any.
README.md Outdated
@@ -29,7 +29,7 @@ The [example](./example) folder shows how those components can be assembled to c
### Building and Running Locally

In order to use the library components or test the library locally, the project components need to be rolled up and
dependencies need to be installed initially with the command: `npm install`. From here the application can be built
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we want to change this for developers building locally, just the pipeline(s)

package.json Outdated
"eject": "react-scripts eject",
"lint": "npx eslint src/**/*.js --fix",
"format": "prettier --write src/**/*.js",
"deploy": "gh-pages -d oscal-react-library/build",
"build-library-and-run-example": "npm install && cd example && npm install && npm start",
"build-and-run-example": "cd example && npm install && npm start",
"build-library-and-run-example": "npm ci && cd example && npm ci && npm start",
Copy link
Contributor

Choose a reason for hiding this comment

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

Here as well, these are used by developers so I don't think they'd be changing.

Revert some changes made in package.json that used npm ci
instead of npm install because those scripts were only used
by developers and not in an actual workflow run
@kylelaker kylelaker merged commit 5db04c4 into develop Oct 1, 2021
@kylelaker kylelaker deleted the EasyGRC-React-135 branch October 1, 2021 15:46
@mikeisen1 mikeisen1 linked an issue Oct 1, 2021 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Switch to npm ci in the pipeline to avoid failures
4 participants