chromaui/chromatic-cli

Storybook publish not being triggered when TurboSnap detects 0 changed components

Closed this issue · 9 comments

Bug report

We have TurboSnap enabled. With dependency updates however it says 0 story files affected by recent changes. So far so good. This however causes it to skip publishing the storybook, which is required check in our CI, blocking the merge.

Here is the relevant part of the log

ollecting Storybook metadata
Collected Storybook metadata
    → Storybook 7.6.17 for React; using the @storybook/react-webpack5 builder (7.6.17); supported addons found: Essentials, A11y
Initializing build
Initialized build
    → Build 1375 initialized
Building your Storybook
    → Running command: yarn run storybook:export <...redacted...>
Storybook built in 36 seconds
    → View build log at ...
Publish your built Storybook
    → Validating Storybook files
Retrieving story files affected by recent changes
    → Traversing dependencies for 2 files that changed since the last build
Found 1 changed dependencies:
  chromatic
Found affected story files:

Retrieved story files affected by recent changes
    → Found 0 story files affected by recent changes
Publishing your built Storybook
    → Calculating file hashes
Publishing your built Storybook
    → Starting publish
    → [====================] 100%
Publishing your built Storybook
    → Finalizing upload
Publish complete in 4 seconds
    → Uploaded 1 file (798 B), skipped 160 files
Verifying your Storybook
    → This may take a few minutes
    → [*                   ]
Starting partial build
    → Snapshots will be limited to 0 story files affected by recent changes
✔ TurboSnap enabled
Capturing 0 snapshots and skipping 101 snapshots.
✔ Storybook published
We found 56 components with 78 stories.
ℹ View your Storybook at ...
Started build 1375
    → View build details at ...
Finalizing build
    → All tests skipped
ℹ Speed up Continuous Integration
Your project is linked to GitHub so Chromatic will report results there.
This means you can pass the --exit-once-uploaded flag to skip waiting for build results.
Read more here: https://www.chromatic.com/docs/cli#chromatic-options
✔ Build 1375 passed!
No visual changes were found in this build.
ℹ View build details at ...
Build 1375 passed!
    → Tested 78 stories across 56 components; captured 0 snapshots in 0 seconds

It's essentially the same as successful builds. The difference is whether Storybook Publish was triggered after that. Int his case when 0 story files are affected, it remain in Expected — Waiting for status to be reported

@Darhazer we've got the same issue over here

image

Our logs:

Retrieving git information
Found 3 changed files:
  apps/fms/ng-scholar/src/app/resource/infobox-resource/infobox-resource.component.html
  apps/fms/ng-scholar/src/assets/i18n/resources/resources-infobox/infobox/en.json
  apps/fms/ng-scholar/src/assets/i18n/resources/resources-infobox/infobox/fr.json
Retrieved git information
    → Commit '8f42a96' on branch 'feat/HRZN-3[29](https://github.com/xxx/xxx/actions/runs/8285648309/job/22674044087?pr=638#step:6:30)_create-user-delete-modal'; found 1 parent build and 3 changed files
Collecting Storybook metadata
Collected Storybook metadata
    → Storybook 7.0.11 for Angular; using the @storybook/angular builder (7.0.11); supported addons found: Essentials
Initializing build
Initialized build
    → Build 777 initialized
Building your Storybook
    → Running command: npm run build-storybook -- --output-dir /tmp/chromatic--1711-t5R9tZ4TToZD --webpack-stats-json /tmp/chromatic--1711-t5R9tZ4TToZD
    → [*                   ]
    → [ *                  ]
    → [  *                 ]
    → [   *                ]
    → [    *               ]
    → [     *              ]
    → [      *             ]
Storybook built in 1 minute 9 seconds
    → View build log at /home/runner/work/xxx/xxx/build-storybook.log
Publish your built Storybook
    → Validating Storybook files
Retrieving story files affected by recent changes
    → Traversing dependencies for 3 files that changed since the last build
Found affected story files:

Retrieved story files affected by recent changes
    → Found 0 story files affected by recent changes
Publishing your built Storybook
    → Calculating file hashes
Publishing your built Storybook
    → Starting publish
    → [====================] 100%
Publishing your built Storybook
    → Finalizing upload
Publish complete in 3 seconds
    → Uploaded 1 file (766 B), skipped 167 files
Verifying your Storybook
    → This may take a few minutes
    → [*                   ]
Starting partial build
    → Snapshots will be limited to 0 story files affected by recent changes
✔ TurboSnap enabled
Capturing 0 snapshots and skipping 155 snapshots.
✔ Storybook published
We found 62 components with 155 stories.
ℹ View your Storybook at https://65b934f73e8a8795[33](https://github.com/xxx/xxx/actions/runs/8285648309/job/22674044087?pr=638#step:6:34)e57ecf-knkpyurfex.chromatic.com/
Started build 777
    → View build details at https://www.chromatic.com/build?appId=65b9[34](https://github.com/xxx/xxx/actions/runs/8285648309/job/22674044087?pr=638#step:6:35)f73e8a879[53](https://github.com/xxx/xxx/actions/runs/8285648309/job/22674044087?pr=638#step:6:54)3e57ecf&number=777
Finalizing build
    → All tests skipped
ℹ Speed up Continuous Integration
Your project is linked to GitHub so Chromatic will report results there.
This means you can pass the --exit-once-uploaded flag to skip waiting for build results.
Read more here: https://www.chromatic.com/docs/cli#chromatic-options
✔ Build 777 passed!
No visual changes were found in this build.
ℹ View build details at https://www.chromatic.com/build?appId=65b934f73e8a879533e57ecf&number=777
Build 777 passed!
    → Tested 1[55](https://github.com/xxx/xxx/actions/runs/8285648309/job/22674044087?pr=638#step:6:56) stories across [62](https://github.com/xxx/xxx/actions/runs/8285648309/job/22674044087?pr=638#step:6:63) components; captured 0 snapshots in 0 seconds

But we do both have 0 snapshots or story files affected

Starting partial build
      -> Snapshots will be limited to 0 story files affected by recent changes
✔ TurboSnap enabled
Capturing 0 snapshots and skipping 155 snapshots.
✔ Storybook published

versus

Starting partial build
    → Snapshots will be limited to 0 story files affected by recent changes
✔ TurboSnap enabled
Capturing 0 snapshots and skipping 101 snapshots.
✔ Storybook published

Seems it could be related to TurboSnap

@Darhazer @maxeber thanks for the reports. We've released a fix for this, so any subsequent builds should send off the Storybook commit status update. Please let us know if that's not the case!

@tevanoff It seems the issue re-appeared

@Darhazer can you share the build logs?

Sure

Run chromaui/action@v11
  with:
    buildScriptName: storybook:export
    projectToken: ***
    onlyChanged: true

Chromatic CLI v11.3.0
https://www.chromatic.com/docs/cli

Authenticating with Chromatic
    → Connecting to https://index.chromatic.com/
Authenticated with Chromatic
    → Using project token '********'
Retrieving git information
Found 2 changed files:
  package.json
  yarn.lock
Retrieved git information
    → Commit '********' on branch '********'; found 1 parent build and 2 changed files
Collecting Storybook metadata
Collected Storybook metadata
    → Storybook 7.6.17 for React; using the @storybook/react-webpack5 builder (7.6.17); supported addons found: Essentials, A11y
Initializing build
Initialized build
    → Build 1452 initialized
Building your Storybook
    → Running command: yarn run storybook:export --output-dir /tmp/chromatic--1713-fuDNLmNFG0U2 --webpack-stats-json /tmp/chromatic--1713-fuDNLmNFG0U2
    → [*                   ]
    → [ *                  ]
    → [  *                 ]
    → [   *                ]
Storybook built in 39 seconds
    → View build log at /********/build-storybook.log
Publish your built Storybook
    → Validating Storybook files
Retrieving story files affected by recent changes
    → Traversing dependencies for 2 files that changed since the last build
Found 1 changed dependencies:
  sass-loader
Found affected story files:

Retrieved story files affected by recent changes
    → Found 0 story files affected by recent changes
Publishing your built Storybook
    → Calculating file hashes
Publishing your built Storybook
    → Starting publish
    → [====================] 100%
Publishing your built Storybook
    → Finalizing upload
Publish complete in 4 seconds
    → Uploaded 1 file (798 B), skipped 163 files
Verifying your Storybook
    → This may take a few minutes
    → [*                   ]
Starting partial build
    → Snapshots will be limited to 0 story files affected by recent changes
✔ TurboSnap enabled
Capturing 0 snapshots and skipping 104 snapshots.
✔ Storybook published
We found 58 components with 80 stories.
ℹ View your Storybook at https://********.chromatic.com/
Started build 1452
    → View build details at https://www.chromatic.com/build?********
Finalizing build
    → All tests skipped
ℹ Speed up Continuous Integration
Your project is linked to GitHub so Chromatic will report results there.
This means you can pass the --exit-once-uploaded flag to skip waiting for build results.
Read more here: https://www.chromatic.com/docs/cli#chromatic-options
✔ Build 1452 passed!
No visual changes were found in this build.
ℹ View build details at https://www.chromatic.com/********
Build 1452 passed!
    → Tested 80 stories across 58 components; captured 0 snapshots in 0 seconds

@Darhazer can you confirm if this is a status check issue or the actual publish has failed? We had an issue earlier today related to status checks not sending. Once you confirm, I can resend that status check if necessary.

Yes, it's a status check issue. Storybook Publish is not being triggered

Ah ok thank you! If you wouldn't mind reaching out to support on intercom with the buildId (or chromatic build URL) in question we should have that resolved right away. I am 99% certain that is the issue in this instance and I apologize for the inconvenience!

Noted. Thanks for that 🙇