feat: re-introduce comment-based trigger for Chromatic #1468
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.
Problem
Chromatic snapshots are expensive and we should have a way to get a snapshot only when we really need one.
Solution
Breaking Changes
Features:
branchName
configuration has been added. This is needed to let Chromatic be aware of where the snapshot is coming from. Without this configuration, Chromatic will pull from theGITHUB_REF
environment variable, which is alwaysdevelop
when on theissue_comment
workflow. This causes Chromatic to constantly rebuild thedevelop
branch and causing our baselines to always reset.autoAcceptChanges
configuration has been added. This is needed so that the baseline (which should, in theory, be thedevelop
branch) is up-to-date, as Chromatic treats the latest accepted ancestor build as the baseline to compare pull request changes against. This is done together with thepush
event to thedevelop
branch, which will generate a new Chromatic snapshot that Chromatic will automatically mark as accepted.Notes:
You tell me that you can only test after this is merged, how am I going to review this?
I hear your concerns. This was what I did to test my hypothesis:
test-1
,test-2
,test-3
,test-4
andtest-5
branches, along with their associated PRs).develop
).develop
as much as possible, or the parent commit of the same branch).If you are interested, the full documentation of how Chromatic calculates the ancestor builds is available.
Tests
Developer experience changes, no user-facing changes. Testing can unfortunately only be done once it is merged.
Deploy Notes
None