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

make node_modules a order-only prerequisite #9923

Merged
merged 6 commits into from
Jan 25, 2020

Conversation

silverwind
Copy link
Member

@silverwind silverwind commented Jan 21, 2020

Package installations and our fomantic step results in changes inside node_modules which lead to make triggering that target unnecessarily.

Moved all node_modules prerequisites to order-only which will make make skip the timestamp check on it and eliminate useless npm install calls.

Changes in package-lock.json will still result in reinstallation so node_modules should stay consistent.

Package installations and our fomantic step results in changes inside
node_modules which lead to make triggering that target unnecessarily.

Moved all node_modules prerequisites to order-only which will make skip
the timestamp check on in and eliminate useless npm calls.

Changes in package-lock.json will still result in reinstallation so
node_modules should stay consistent.
@techknowlogick techknowlogick added the topic/build PR changes how Gitea is built, i.e. regarding Docker or the Makefile label Jan 21, 2020
@techknowlogick techknowlogick added this to the 1.12.0 milestone Jan 21, 2020
@silverwind
Copy link
Member Author

I initially had a change here that deleted node_modules on clean-all, kind of like an escape hatch. But I guess it's better to trust npm to be able to get the modules in a consistent state itself.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jan 21, 2020
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jan 21, 2020
@silverwind
Copy link
Member Author

silverwind commented Jan 21, 2020

Still seeing some unneccesary installs, not sure why make thinks package-lock.json has changed here:

$ stat package-lock.json
Access: 2020-01-21 23:48:27.770141038
Modify: 2020-01-21 23:47:11.631464000
Change: 2020-01-21 23:47:11.631478146
$ make --trace node_modules
Makefile:469: update target 'node_modules' due to: package-lock.json
$ stat package-lock.json
Access: 2020-01-21 23:49:23.633522825
Modify: 2020-01-21 23:47:11.631464000
Change: 2020-01-21 23:47:11.631478146
$ make --trace node_modules
Makefile:469: update target 'node_modules' due to: package-lock.json

Edit: Probably some weird macOS filesystem issue. It does work on Linux:

$ make --trace node_modules
make: 'node_modules' is up to date.
$ make --trace node_modules
make: 'node_modules' is up to date.

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jan 22, 2020
@codecov-io
Copy link

codecov-io commented Jan 25, 2020

Codecov Report

Merging #9923 into master will decrease coverage by <.01%.
The diff coverage is 16.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9923      +/-   ##
==========================================
- Coverage   42.27%   42.27%   -0.01%     
==========================================
  Files         610      610              
  Lines       80364    80370       +6     
==========================================
- Hits        33974    33973       -1     
- Misses      42211    42213       +2     
- Partials     4179     4184       +5
Impacted Files Coverage Δ
models/repo.go 49.79% <0%> (-0.17%) ⬇️
modules/util/sanitize.go 50% <100%> (+50%) ⬆️
services/pull/patch.go 64.77% <0%> (-3.15%) ⬇️
modules/queue/workerpool.go 41.2% <0%> (-3.01%) ⬇️
services/pull/temp_repo.go 31.62% <0%> (-2.57%) ⬇️
modules/log/event.go 64.61% <0%> (-1.03%) ⬇️
routers/repo/view.go 39.47% <0%> (+0.87%) ⬆️
models/unit.go 39.5% <0%> (+2.46%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 921ba3f...93666e1. Read the comment docs.

@zeripath zeripath merged commit 8ca0730 into go-gitea:master Jan 25, 2020
@silverwind silverwind deleted the make-node_modules branch January 25, 2020 12:16
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. topic/build PR changes how Gitea is built, i.e. regarding Docker or the Makefile
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants