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

Use determinstic output file hashes based on git commit #1952

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

adamrdrew
Copy link

We want to have hashes in filenames for cache busting, but this can cause problems with with containerized frontends and how they interact with akamai that can (and recently, have) result in outages. This patch makes the hashes based on the current git SHA instead of webpack's built-in full hash. This would ensure that if a given commit is rebuilt we will get the same files in the resultant build.

The reason we want this is we had an issue where a version of an app was rebuilt. When this new version of the build was deployed cache wasn't busted in akamai because we were using the same image tag. The resulted in the fed-mods.json in akamai and the file names on the pod to mismatch. This resulted in a production outage and customer impact in the form of a customer support case. If this patch had been in place the issue would never have happened as the resultant rebuild would have had the same filenames.

This patch shouldn't impact developers and the developer workflow because we're already conditional on hot reload. That said, this is a complex config and we've got lots of apps, so input is very much appreciated.

@Hyperkid123
Copy link
Contributor

@adamrdrew can't do that yet. I'll switch to content hash soon. The new version of one of the dependencies we were waiting on was updated and we will be able to move forward now.

We have to start with upgrading our Scalprum dependency.

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.

2 participants