chromaui/chromatic-cli

TurboSnap: inconsistent git history issue

Closed this issue · 3 comments

Bug report

TurboSnap is not able to determine the git history consistently for different builds in a Pull Request. This results in full rebuilds, which creates unnecessary snapshots per commit. I've reviewed other issues, but it's not clear what the fix was.

I've noticed for some PR builds that TurboSnap will be enabled, meanwhile another build for the same PR (different commit) will be disabled. I created a gist that compares the chromaui/action between each build - https://gist.github.com/redonkulus/98ca5fe390e04c3d79e38f11fba50dba

How do I configure my repository or the action to be consistent?

chromatic.yml
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
          # To avoid DETACHED HEAD issues which cause the git history to not be found
          # @see https://github.com/chromaui/chromatic-cli/issues/522#issuecomment-1040404730
          ref: ${{ github.event.pull_request.head.ref || github.ref }}
      - name: Use Node.js
        uses: actions/setup-node@v4
        with:
          cache: npm
          node-version-file: .nvmrc
      - run: npm ci
      - name: Run Chromatic
        uses: chromaui/action@v11
        with:
          autoAcceptChanges: main
          buildScriptName: build
          debug: true
          externals: public/**
          exitOnceUploaded: true
          onlyChanged: true
          projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
          skip: "@(renovate/**|dependabot/**)"
          storybookBaseDir: ./apps/docs
          traceChanged: expanded
          workingDir: ./apps/docs
          zip: true
  

System

  • GitHub Actions: chromaui/action@v11
  • Storybook: ^8.1.10

@redonkulus Please reach out to our customer support team via our in-app chat, because I can't provide tailored support here as this is a public platform.

My suspicion is that you need to remove this line, as our GitHub Action already corrects for ephemeral merge commits (see here).

Thanks @ghengeveld. I will follow up via my internal email thread with support.

This was resolved via #1015