Enforce that actioncable compiled JS bundle is in sync with source code #37485
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.
Summary
Addresses #34473 (comment)
We have run into issues in the past where the actioncable compiled javascript bundle got out of sync with the source code. For example, in 30a0c7e (#34446) only the compiled bundle was modified. This meant that anyone who ran
yarn build
in the actioncable directory would then see a dirty git status indicating changes to the compiled bundle, despite not having made any changes to the actioncable javascript source code. We fixed that particular inconsistency in a4c2758 (#34475). However, the same problem could reoccur.To address this, I've added a new test to enforce that actioncable's compiled javascript bundle is in sync with the source code. When the compiled bundle is in sync with the source code, the test will pass:
However, if the two are not in sync, the test will fail. For example, if you were to apply the following patch (which only updates the source code):
the test would then fail like this:
Thus, the actioncable test suite will now prevent "the compiled bundle is out of sync" issues going forward.