Use determinstic output file hashes based on git commit #1952
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.