guardian / guardian/dotcom-rendering
Chromatic "ignoring" dependencies when working out TurboSnaps
- Dominant language
- TypeScript
- Stars
- 274
- Forks
- 34
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 121
Description
We have put[ `package.json` and `pnpm-lock.yaml` in the `untraced` option for chromatic](https://github.com/guardian/dotcom-rendering/blob/main/.github/workflows/dcr-chromatic.yml#L61)
This means [chromatic ignores these files when working out which stories have been affected](https://www.chromatic.com/docs/turbosnap/setup/#avoid-re-testing-dependent-stories-when-certain-files-changed) and need to be re-snapshotted.
The implication of this is that if dependencies update that may affect our UI like react, or our component libraries, they would be ignored by turbosnap and will use the previous cached snapshots, you can see this happening by looking at the chromatic results of dependabot PRs, they all have 100% turbosnaps.
This firstly could cause a dependabot update of a library to break the UI without us knowing.
And secondly can cause updates in other PRs not to show until the snapshot is fully run on another PR, which happened when `support-dotcom-components` was updated in https://github.com/guardian/dotcom-rendering/pull/16367/, this silently broke one of the stories. Which came up in a later PR that caused the shapshot to re-run https://github.com/guardian/dotcom-rendering/pull/16356 (https://www.chromatic.com/build?appId=63e251470cfbe61776b0ef19&number=16649)
Contributor guide
Research direction
Start with .github/workflows/dcr-chromatic.yml at line 61 and the linked Chromatic TurboSnap setup. Compare Chromatic results for Dependabot PRs with the support-dotcom-components update examples. Done means dependency changes no longer bypass the relevant visual snapshots.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- ci-cd, testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100