Skip to content

CI: Avoid shallow checkout for Chromatic job#34483

Merged
Sidnioulz merged 1 commit into
nextfrom
sidnioulz/ci-chromatic-unshallow
Apr 7, 2026
Merged

CI: Avoid shallow checkout for Chromatic job#34483
Sidnioulz merged 1 commit into
nextfrom
sidnioulz/ci-chromatic-unshallow

Conversation

@Sidnioulz
Copy link
Copy Markdown
Member

@Sidnioulz Sidnioulz commented Apr 7, 2026

What I did

This should fix an ongoing issue we've had with Chromatic history getting heavily polluted when rebasing branches. There was a regression in the switch to dynamically generated CI, where we stopped checking out the git history of the repo for the Chromatic job, and switched to a default shallow clone.

The PR reintroduces a deeper clone by letting us pass checkout options to the restore* helpers. It then passes shallow: false specifically for Chromatic.

Checklist for Contributors

Testing

Caution

THIS IS NOT COVERED BY TESTS 🚨

Manual testing

Caution

I HAVE NOT TESTED THIS 🚨

I don't know how to test this other than merge and observe it.

Documentation

ø

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli-storybook/src/sandbox-templates.ts

  • Make sure this PR contains one of the labels below:

    Available labels
    • bug: Internal changes that fixes incorrect behavior.
    • maintenance: User-facing maintenance tasks.
    • dependencies: Upgrading (sometimes downgrading) dependencies.
    • build: Internal-facing build tooling & test updates. Will not show up in release changelog.
    • cleanup: Minor cleanup style change. Will not show up in release changelog.
    • documentation: Documentation only changes. Will not show up in release changelog.
    • feature request: Introducing a new feature.
    • BREAKING CHANGE: Changes that break compatibility in some way with current major version.
    • other: Changes that don't fit in the above categories.

🦋 Canary release

This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the @storybookjs/core team here.

core team members can create a canary release here or locally with gh workflow run --repo storybookjs/storybook publish.yml --field pr=<PR_NUMBER>

Summary by CodeRabbit

  • Chores
    • Enhanced CI workflow helpers to support configurable Git checkout behavior, enabling flexible shallow clone options during build operations.

@Sidnioulz Sidnioulz requested a review from ndelangen April 7, 2026 12:26
Copilot AI review requested due to automatic review settings April 7, 2026 12:26
@Sidnioulz Sidnioulz added build Internal-facing build tooling & test updates ci:normal labels Apr 7, 2026
@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Apr 7, 2026

View your CI Pipeline Execution ↗ for commit dcf8696

Command Status Duration Result
nx run-many -t compile,check,knip,test,lint,fmt... ✅ Succeeded 23m 58s View ↗

☁️ Nx Cloud last updated this comment at 2026-04-07 12:51:58 UTC

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the dynamically generated CI helpers so the Chromatic job can opt out of the default shallow git checkout, reducing the chance of Chromatic history being misattributed after rebases.

Changes:

  • Extend workflow.restoreLinux() / workflow.restoreWindows() to accept git checkout options.
  • Configure the Chromatic job to run with shallow: false checkout settings.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
scripts/ci/utils/helpers.ts Adds optional checkout options to workflow restore helpers and forwards them into git.checkout(...).
scripts/ci/common-jobs.ts Uses the new option passing to request a deeper checkout for the Chromatic job.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/ci/common-jobs.ts
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 7, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 320fca7c-59e0-40a7-a4e8-cdd6761d0fbe

📥 Commits

Reviewing files that changed from the base of the PR and between 7cb708b and dcf8696.

📒 Files selected for processing (2)
  • scripts/ci/common-jobs.ts
  • scripts/ci/utils/helpers.ts

📝 Walkthrough

Walkthrough

Updated CI workflow helpers to accept optional checkout configuration options. The storybookChromatic job now calls workflow.restoreLinux({ shallow: false }), while restoreLinux and restoreWindows functions in the helpers module were modified to accept and forward optional checkout configuration to git operations.

Changes

Cohort / File(s) Summary
Job Configuration Update
scripts/ci/common-jobs.ts
Updated storybookChromatic job's Linux cache restore step to pass { shallow: false } option to workflow.restoreLinux().
Helper Function Signatures
scripts/ci/utils/helpers.ts
Modified restoreLinux() to accept optional checkoutOpts parameter with forceHttps? and shallow? properties; modified restoreWindows() to accept optional checkoutOpts parameter with shallow? property and merge it into git checkout while maintaining forced HTTPS behavior.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands and usage tips.

@Sidnioulz Sidnioulz changed the title Avoid shallow checkout for Chromatic job CI: Avoid shallow checkout for Chromatic job Apr 7, 2026
@Sidnioulz Sidnioulz merged commit ced6900 into next Apr 7, 2026
130 of 137 checks passed
@Sidnioulz Sidnioulz deleted the sidnioulz/ci-chromatic-unshallow branch April 7, 2026 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Internal-facing build tooling & test updates ci:normal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants