Skip to content

fix(@angular-devkit/build-angular): ensure to use content hash as filenames hashing mechanism#22612

Merged
dgp1130 merged 1 commit intoangular:masterfrom
alan-agius4:content-hash
Feb 2, 2022
Merged

fix(@angular-devkit/build-angular): ensure to use content hash as filenames hashing mechanism#22612
dgp1130 merged 1 commit intoangular:masterfrom
alan-agius4:content-hash

Conversation

@alan-agius4
Copy link
Collaborator

Previously we used hash which resulted in a unique hash generated for every build even when the contents of the files didn't differ.

More info: https://webpack.js.org/guides/caching/#output-filenames

NB: I did try to add a unit test, but it non trivial.

@alan-agius4 alan-agius4 requested a review from dgp1130 January 31, 2022 14:44
@alan-agius4 alan-agius4 added the target: patch This PR is targeted for the next patch release label Jan 31, 2022
Copy link
Collaborator

@dgp1130 dgp1130 left a comment

Choose a reason for hiding this comment

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

What exactly was non-deterministic that is fixed? I don't see anything too obvious being changed, is it updating .[hash:${length}] -> .[contenthash:${length}]?

@alan-agius4
Copy link
Collaborator Author

What exactly was non-deterministic that is fixed? I don't see anything too obvious being changed, is it updating .[hash:${length}] -> .[contenthash:${length}]?

Yes

@alan-agius4 alan-agius4 added the action: merge The PR is ready for merge by the caretaker label Jan 31, 2022
@dgp1130
Copy link
Collaborator

dgp1130 commented Jan 31, 2022

I think this conflicted with another PR, I'd fix it in GitHub, but I think that will create a merge commit. Probably easier for you to fix when you get a chance @alan-agius4.

@dgp1130 dgp1130 added action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews and removed action: merge The PR is ready for merge by the caretaker labels Jan 31, 2022
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews labels Feb 1, 2022
…enames hashing mechanism

Previously we used hash which resulted in a unique hash generated for every build even when the contents of the files didn't differ.

More info: https://webpack.js.org/guides/caching/#output-filenames
@dgp1130
Copy link
Collaborator

dgp1130 commented Feb 2, 2022

Merged to patch in #22623, so retargeting this PR to major.

@dgp1130 dgp1130 added target: major This PR is targeted for the next major release and removed target: patch This PR is targeted for the next patch release labels Feb 2, 2022
@dgp1130 dgp1130 merged commit 4b9199d into angular:master Feb 2, 2022
@alan-agius4 alan-agius4 deleted the content-hash branch February 2, 2022 06:29
@alan-agius4 alan-agius4 linked an issue Feb 2, 2022 that may be closed by this pull request
15 tasks
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Mar 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker target: major This PR is targeted for the next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Output files' filename hashes are incorrect

2 participants