-
Notifications
You must be signed in to change notification settings - Fork 13.8k
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
fix: Move copying translation files before npm run build in Docker #30099
fix: Move copying translation files before npm run build in Docker #30099
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh this will impact the docker-cache hit-rate a bit. If anything in the translation folder changes we won't be able to reuse the frontend build cache, which is probably ok and required anyways. I have to admit I didn't know if the translation was more of a build-time thing or a run-time thing. Given the new logic in the webpack config it appears it's required at build time. Hoping it doesn't impact perf when using We may want to introduce a new |
Thanks for the review!
I think this would cause more data to be loaded when the Is the preference still to add the build flag and then also remove the translations from the backend and have the standard image be |
Took the time to understand the new optimization in Note that we have a Overall unclear how much this matters (could be good to know the bundle size without any locale, with the 20 we support, and with all locales). I vote to keep things simple and simply adding a setting |
I resolved the merge conflict I created in the first place... |
c205131
to
64e3883
Compare
I seem to have a couple of failed tests and I can't quite see why.
Thanks! |
rebase and should be fine
unfortunately we have some flakiness in these tests, should re-run after you rebase+push |
The webpack.config.js now requires that the translation files are present when running the build.
The default build is 'en' only. Unfortunately the translation files need copying to the image regardless of the flag as COPY cannot be run based on a conditional
to the docker-builds documentation
64e3883
to
d6c9237
Compare
I think I've hit a bad link in the release notes that wasn't picked up when the change was merged to The Docs Testing/Link Checking workflow only runs when changes are made to Shall I fix it here or do you have a policy that that should be fixed in a separate PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, thinking prior to this PR the effective default is BUILD_TRANSACTION=true
so this is kind of a breaking change for those who build/ship translations. We could either set the default to true
here or add an entry in UPDATING.md
("if your environment requires translations, you'll want to set the docker build arg BUILD_TRANSACTION=true").
If we decide to switch the default to true
, I would set the default in docker-compose.*
to false as most development environments don't need translations.
Given the semi-unknown/uneven state of translations coverage and quality, I vote for setting the default to false
(as it is now), but that means this PR needs to add an entry in UPDATING.md as suggested above.
I'm not sure why For the docs, I think the failed check is non-blocking for merging, and there's new commits in |
|
Thanks for merging this :) Sorry for not responding to the above comment sooner but I didn't have time to look at this yesterday. As I didn't have time to add the entry in |
Oh I forgot about my own comment, a new comment in UPDATING.md would be nice if you don't mind opening a one-liner |
No problem :) Ignore the first closed PR above that I managed to open on my fork by accident! 🤦🏻 |
SUMMARY
Since #29791 the webpack.config.js file now requires that the translation files are present when running the build. This change simply moves the copy of the translation files before the
npm run build
step.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Beforehand, an error printed was printed, although it doesn't seem to stop the build, that can cause confusion as to whether something is wrong with the build:
TESTING INSTRUCTIONS
Build the
superset-node
stage and ensure it completes without errors relating to the translations files:docker buildx build --progress plain --target superset-node --build-arg PY_VER=3.10-slim-bookworm --no-cache .
ADDITIONAL INFORMATION