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

Fix assets not available in production #5082

Merged
merged 4 commits into from
Oct 26, 2023
Merged

Fix assets not available in production #5082

merged 4 commits into from
Oct 26, 2023

Conversation

jorg-vr
Copy link
Contributor

@jorg-vr jorg-vr commented Oct 26, 2023

This pull request fixes the fetching of undigested files.

Since rails/sprockets-rails#49 (comment) rails does not support this by default and requires a custom task or gem. We already had such a task, which I updated.

Step 1 was to reproduce the bug on naos.
The relevant setting was config.assets.compile = false
It is not an option to set this to true in production: https://stackoverflow.com/questions/8821864/config-assets-compile-true-in-rails-production-why-not

Step 2 was to fix the precompilation step for these files.
To fix this on naos I executed the assets:nodigest on naos.
I updated this task, which was unused, to support glob variables and be rooted in the builds directory.

It is important to keep in mind that these files are not managed by sprockets, so we need to add the hash for cache bumping ourselves.
For this reason I updated the naming scheme in webpack and only copied the files that certainly received a hash by webpack.

  • tested on naos

@jorg-vr jorg-vr added the bug Something isn't working label Oct 26, 2023
@jorg-vr jorg-vr self-assigned this Oct 26, 2023
@jorg-vr jorg-vr added the deploy naos Request a deployment on naos label Oct 26, 2023
@jorg-vr jorg-vr temporarily deployed to naos October 26, 2023 12:32 — with GitHub Actions Inactive
@github-actions github-actions bot removed the deploy naos Request a deployment on naos label Oct 26, 2023
@jorg-vr jorg-vr added the deploy naos Request a deployment on naos label Oct 26, 2023
@jorg-vr jorg-vr added deploy naos Request a deployment on naos and removed deploy naos Request a deployment on naos labels Oct 26, 2023
@jorg-vr jorg-vr temporarily deployed to naos October 26, 2023 13:14 — with GitHub Actions Inactive
@github-actions github-actions bot removed the deploy naos Request a deployment on naos label Oct 26, 2023
@jorg-vr jorg-vr marked this pull request as ready for review October 26, 2023 13:47
@jorg-vr jorg-vr requested a review from a team as a code owner October 26, 2023 13:47
@jorg-vr jorg-vr requested review from bmesuere and chvp and removed request for a team October 26, 2023 13:47
Copy link
Member

@bmesuere bmesuere left a comment

Choose a reason for hiding this comment

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

Nice reuse of the old functionality 👍

@jorg-vr jorg-vr merged commit 9d856a4 into main Oct 26, 2023
13 checks passed
@jorg-vr jorg-vr deleted the fix/production-caching branch October 26, 2023 13:58
@jorg-vr jorg-vr temporarily deployed to naos October 26, 2023 13:58 — with GitHub Actions Inactive
@jorg-vr jorg-vr temporarily deployed to production October 26, 2023 14:04 — with GitHub Actions Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants