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 building UI on unit-tests target #435

Merged
merged 2 commits into from
Jul 7, 2021
Merged

Skip building UI on unit-tests target #435

merged 2 commits into from
Jul 7, 2021

Conversation

jpellizzari
Copy link
Contributor

@jpellizzari jpellizzari commented Jul 6, 2021

Adds some specificity to the Makefile to avoid rebuilding UI assets on every make unit-tests. Also refactors to be smarter about building assets in general.

Edit: The scope has expanded to remove the Docker Scan job, as it was superfluous. I chatted with @josecordaz about it before proceeding.

@palemtnrider
Copy link
Contributor

I like the changes to the Makefile - great to see more under the clean target. 2 issues running make ui
on the mac, I received an error from gyp:

gyp: No Xcode or CLT version detected!
easily fixed with sudo xcode-select --reset

Also getting an error on parcel :

> parcel build --no-source-maps ui/index.html --dist-dir cmd/ui/dist

error: unknown option `--dist-dir'

I recently installed parcel with npm install -g parcel-bundler

@jpellizzari
Copy link
Contributor Author

@palemtnrider You do not have to do npm install -g parcel-bundler. When the npm run build runs, it will find the parcel specified in the package.json. The specific error you are getting is due to flags being changed from v1 to v2 of parcel.

We are using parcel@v2 due to it having less vulnerabilities (and its newer).

The node-gyp build errors are another issue, and an unfortunate side effect of the wonderful/terrible Node.js ecosystem. I'll see if I can fix that by removing that dependency or some other creative solution.

Copy link
Contributor

@josecordaz josecordaz left a comment

Choose a reason for hiding this comment

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

make ui and unit-tests worked well for me

@palemtnrider
Copy link
Contributor

I removed parcel-builder npm uninstall -g parcel-bundler and I'm getting the following error:

make clean && make ui                                                                                 15:02:46
rm -f bin/wego pkg/flux/bin/flux
rm -rf cmd/ui/dist
rm -rf coverage
rm -rf node_modules
npm install

> weave-gitops@0.0.1 preinstall
> npx npm-force-resolutions


added 1306 packages, and audited 1306 packages in 22s

found 0 vulnerabilities
npm run build

> weave-gitops@0.0.1 build
> parcel build --no-source-maps ui/index.html --dist-dir cmd/ui/dist

sh: parcel: command not found
npm ERR! code 127
npm ERR! path /Users/me/src/weaveworks/weave-gitops
npm ERR! command failed
npm ERR! command sh -c parcel build --no-source-maps ui/index.html --dist-dir cmd/ui/dist

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/me/.npm/_logs/2021-07-07T21_03_15_102Z-debug.log

Are you certain you don't have parcel installed locally?

@jpellizzari
Copy link
Contributor Author

jpellizzari commented Jul 7, 2021

Are you certain you don't have parcel installed locally?

Fairly sure.

$ which parcel doesn't return anything, and npm ls -g | grep parcel doesn't return anything either.

I also don't believe I have added parcel to CI anywhere

@jpellizzari
Copy link
Contributor Author

@palemtnrider Which node version are you running?

My output:

jordan@UbuntuDesktop:~/Projects/weave-gitops$ node -v
v14.17.0

@jpellizzari
Copy link
Contributor Author

@palemtnrider Looks like some folks had good results in this thread: parcel-bundler/parcel#3023

@jpellizzari
Copy link
Contributor Author

The scope has expanded to remove the Docker Scan job, as it was superfluous. I chatted with @josecordaz about it before proceeding.

Copy link
Contributor

@palemtnrider palemtnrider left a comment

Choose a reason for hiding this comment

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

Worked through how to run from a clean system without extra installs. LGTM

@jpellizzari jpellizzari merged commit 5753a72 into main Jul 7, 2021
@jpellizzari jpellizzari deleted the jp-deps-makefile branch July 7, 2021 23:02
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.

None yet

3 participants