The pod_setup script fails to minify some JavaScript, due to a precompile script failure
Bug #1952681 reported by
Barry Price
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
charm-k8s-discourse |
Fix Released
|
High
|
Unassigned |
Bug Description
Running the pod_setup script as we do on launch results in some housekeeping being done, including compression/
However, on recent 2.7 releases we run into issues with uglifier failing to process some files, e.g.:
https:/
Since the error is non-fatal, we can work around it for now by looping the precompile stage until success.
This bug is to track fixing it properly so that it doesn't fail in the first place (and so that we have more efficiently compressed/minified resources on live sites).
Related branches
~weii-wang/charm-k8s-discourse:fix-terser-precompile
- Tom Haddon: Approve
- Barry Price: Approve
- Franco Luciano Forneron Buschiazzo: Pending requested
-
Diff: 80 lines (+10/-26)4 files modifieddev/null (+0/-13)
image/build_scripts/build_app (+0/-3)
image/build_scripts/get_app_dependencies (+9/-1)
image/scripts/pod_setup (+1/-9)
~barryprice/charm-k8s-discourse/+git/charm-k8s-discourse:loop-precompile
- Tom Haddon: Approve
- 🤖 prod-jenkaas-is (community): Approve (continuous-integration)
- Canonical IS Reviewers: Pending requested
-
Diff: 15 lines (+7/-0)1 file modifiedimage/scripts/pod_setup (+7/-0)
~barryprice/charm-k8s-discourse/+git/charm-k8s-discourse:master
Rejected
for merging
into
charm-k8s-discourse:master
- Barry Price: Needs Fixing
- 🤖 prod-jenkaas-is (community): Approve (continuous-integration)
- Canonical IS Reviewers: Pending requested
-
Diff: 18 lines (+9/-1)1 file modifiedimage/scripts/pod_setup (+9/-1)
Changed in charm-k8s-discourse: | |
status: | New → Confirmed |
importance: | Undecided → High |
Changed in charm-k8s-discourse: | |
status: | Confirmed → Fix Released |
To post a comment you must log in.
I was recently reviewing the code to fix the bug, and it seems the bug has already been fixed. The error on the pastebin link is triggered by trying to use uglifier as compressor for ES6 as seen here: https:/ /www.rubydoc. info/gems/ uglifier
When I went to inspect the code, I realized there already exists a patch to change the compressor from uglifier to terser (https:/ /github. com/terser/ terser). This patch is located in the build_scripts/ terser. patch file and it is called correctly on the build_scripts/ build_app file.
Should that mean this bug is fixed? Or am I missing something? Thank you :)