-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gotcha about chromatic publish not working #17114
Conversation
New repos with less than 2 commits will fail due to the shallow clone test `Found only one commit This typically means you've checked out a shallow copy of the Git repository,`
☁️ Nx Cloud ReportWe didn't find any information for the current pull request with the commit 2e3ee01. Check the Nx Cloud Github Integration documentation for more information. Sent with 💌 from NxCloud. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cabbiepete thanks for the time and effort you've put into this pull request and willingness to help us improve our documentation. One small item to take care of and this should be good to go.
Let me know once you've addressed the feedback and I'll gladly merge this pull request.
Have a great day!
Stay safe
docs/writing-tests/visual-testing.md
Outdated
<div class="aside"> | ||
|
||
GOTCHA: If you're project has less than 2 commits chromatic publishing will fail while `Retrieving git information` add another commit and try again. | ||
|
||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cabbiepete we have a bit of room for improvement here. We could move this below the snippet with the text " Build 1 published...." and probably go with:
<div class="aside">
💡 Before running Chromatic's CLI ensure you have at least two commits added to the repository to prevent build failures, as Chromatic relies on a full Git history graph to establish the baselines. Read more about baselines in Chromatic's <a href="https://www.chromatic.com/docs/branching-and-baselines"> documentation</a>
</div>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jonniegodes thanks done.
All good on my end. @cabbiepete thanks for the follow-up on this and willingness to address the feedback so promptly. Appreciate it. Going to merge this. Have a great weekend! Stay safe |
Gotcha about chromatic publish not working
New repos with less than 2 commits will fail due to the shallow clone test
Found only one commit This typically means you've checked out a shallow copy of the Git repository,
Issue:
What I did
My chat from the chromatic intercom that pointed this out and helped me resolve the issue.
cli issue trying to install chromatic while following the storybook testing tutorial
taskbox git:(master) npx chromatic --project-token=40bc0fc490f8
Chromatic CLI v6.3.3
https://www.chromatic.com/docs/cli
✔ Authenticated with Chromatic
→ Using project token '********90f8'
✖ Retrieving git information
→ Refer to your CI provider's documentation for details.
Collect Storybook metadata
Build Storybook
Publish your built Storybook
Verify your Storybook
Test your stories
✖ Failed to retrieve git information
✖ Found only one commit
This typically means you've checked out a shallow copy of the Git repository, which some CI systems do by default.
In order for Chromatic to correctly determine baseline commits, we need access to the full Git history graph.
Refer to your CI provider's documentation for details.
→ View the full stacktrace below
If you need help, please chat with us at https://www.chromatic.com/docs/cli for the fastest response.
You can also email the team at support@chromatic.com if chat is not an option.
Please provide us with the above CLI output and the following info:
{
"timestamp": "2022-01-03T01:55:06.683Z",
"sessionId": "5b14b470-bc2b-4aa7-904b-6143d02a71cf",
"nodePlatform": "darwin",
"nodeVersion": "14.18.1",
"packageName": "chromatic",
"packageVersion": "6.3.3",
"flags": {
"projectToken": [
"40bc0fc490f8"
],
"appCode": [],
"outputDir": [],
"storybookBuildDir": [],
"untraced": [],
"externals": [],
"interactive": true
},
"buildScript": "build-storybook -s public",
"errorType": "Error",
"errorMessage": "✖ Failed to retrieve git information"
}
Error: ✖ Failed to retrieve git information
✖ Found only one commit
This typically means you've checked out a shallow copy of the Git repository, which some CI systems do by default.
In order for Chromatic to correctly determine baseline commits, we need access to the full Git history graph.
Refer to your CI provider's documentation for details.
at /Users/cabbiepete/development/taskbox/node_modules/chromatic/bin/main.cjs:95:1602
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async wt.steps (/Users/cabbiepete/development/taskbox/node_modules/chromatic/bin/main.cjs:95:1089)
at async e.exports.task (/Users/cabbiepete/development/taskbox/node_modules/chromatic/bin/main.cjs:70:11136)
Operator profile
Thanks we'll get back to you as soon as we can.
Michael profile
Hi Peter, It looks like there is only one commit in your repo. Can you make another git commit and try again?
January 4
Thanks, interesting gotcha you guys should note this in the quick start or link to a FAQ about it. I'll see if I can do a PR for the storybook book tutorial
it works btw
14m ago. Not seen yet
We run on Intercom
How to test
Create a new repo and attempt
npx chromatic --project-token=<token>
expect failure, add 1 commit, try again another failure, add a 2nd commit try again expect success.