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

Precompile asset esbuild failure does not trigger CI build exit #500

Closed
Mycobee opened this issue Feb 22, 2022 · 1 comment
Closed

Precompile asset esbuild failure does not trigger CI build exit #500

Mycobee opened this issue Feb 22, 2022 · 1 comment

Comments

@Mycobee
Copy link

Mycobee commented Feb 22, 2022

When rails assets:precompile fails in a github actions CI pipeline, the build continues without raising a build error. This caused some broken code to sneak in to our prod instance this morning.

Does anyone have any ideas how to trigger an error where it will stop the CI build? The output below is printed out, but the CI build continues

Example:

doppler run -- bundle exec rails assets:precompile --trace
  shell: /usr/bin/bash -e {0}
  env:
    CI: true
    RAILS_ENV: test
    DOPPLER_TOKEN: dp.st.test_ci.t1B[4](https://github.com/**/**/runs/5294624544?check_suite_focus=true#step:17:4)eRvzwX0erbADmC6aasdfg[5](https://github.com/**/**/runs/5294624544?check_suite_focus=true#step:17:5)IjeVkehjiKHJETg
** Invoke assets:precompile (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
** Invoke css:build (first_time)
** Execute css:build
yarn install v1.22.17
[1/4] Resolving packages...
success Already up-to-date.
$ [ ! -d ".git" ] && exit 0; husky install
husky - Git hooks installed
Done in 0.78s.
yarn run v1.22.17
$ yarn run build:tailwind & yarn run build:sass
$ tailwindcss -i ./app/assets/stylesheets/v2.css -o ./app/assets/builds/v2.css
$ sass ./app/assets/stylesheets/v1.sass.scss ./app/assets/builds/v1.css --load-path=node_modules --embed-sources
Done in 2.05s.
** Invoke javascript:build (first_time)
** Execute javascript:build
yarn install v1.22.17
[1/4] Resolving packages...
Done in 1715ms.
success Already up-to-date.
$ [ ! -d ".git" ] && exit 0; husky install
husky - Git hooks installed
Done in 1.10s.
yarn run v1.22.17
$ esbuild app/frontend/*.* --bundle --sourcemap --outdir=app/assets/builds --loader:.svg=text
 > app/frontend/app/hooks/index.js:[6](https://github.com/**/**/runs/5294624544?check_suite_focus=true#step:17:6):[9](https://github.com/**/**/runs/5294624544?check_suite_focus=true#step:17:9): error: Expected ";" but found "here"
    6 │ putatypo here!!
      ╵          ~~~~
1 error
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
** Execute assets:precompile
@tgaff
Copy link

tgaff commented Jul 3, 2023

Is it possible this is fixed now, or was an issue with the build script?
I just tried to reproduce this and could not. The assets:precompile task had an exit code of 1 for "bad" JS.

@dhh dhh closed this as completed Jan 21, 2024
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

No branches or pull requests

3 participants