fix: Add npm ci target and dependency on all npm run commands #5683
fix: Add npm ci target and dependency on all npm run commands #5683bennerv wants to merge 1 commit into
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bennerv, tsatam The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Pull request overview
This PR updates the api build/generation Makefile so that any targets invoking npm run … first ensure Node dependencies are installed via an npm ci step, reducing failures due to missing/old dependencies during API generation workflows.
Changes:
- Add a new
ciMakefile target that runsnpm ci. - Make
swagger,models,testsdk, andfmtdepend onciso dependencies are installed beforenpm runscripts execute.
925f88f to
468a786
Compare
468a786 to
6a8987d
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 4 comments.
Comments suppressed due to low confidence (1)
api/Makefile:51
- This Makefile now ensures deps for npm-run targets, but validate-examples/lint-openapi invoke pinned Node tools via npx (oav/autorest). Without depending on the same install stamp, npx may download tools from the network instead of using package-lock-pinned versions. Consider adding the npm ci stamp prerequisite here too, and switch fmt to the stamp file as well.
fmt: node_modules/.package-lock.json
npm run format
.PHONY: validate-examples
validate-examples:
|
|
||
| .PHONY: swagger | ||
| swagger: | ||
| swagger: node_modules/.package-lock.json |
|
|
||
| .PHONY: models | ||
| models: $(GOIMPORTS) | ||
| models: node_modules/.package-lock.json $(GOIMPORTS) |
|
|
||
| .PHONY: testsdk | ||
| testsdk: $(GOIMPORTS) | ||
| testsdk: node_modules/.package-lock.json $(GOIMPORTS) |
| node_modules/.package-lock.json: package-lock.json | ||
| npm ci No newline at end of file |
|
@bennerv: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
No jira
What
Adds an
npm cidependency on anynpm runcommands as we need the dependencies installed in order to succeed first.Why
if dependencies are updated, this will force the user to have the latest dependencies for generation.
Testing
api validation should cover this from a prowjob
Special notes for your reviewer
PR Checklist