Skip to content
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

PORTALS-2652 - Integrate with Chromatic #241

Merged
merged 1 commit into from
May 18, 2023

Conversation

nickgros
Copy link
Collaborator

@nickgros nickgros commented May 17, 2023

  • Integrate with Chromatic

For an example, see nickgros#3 . There will be two new checks:

image

The Storybook Publish check links to a deployed Storybook. A PR submitter could link to a specific story in the Storybook if desired, like this.

The UI Tests check links to a list of all of the components where the base snapshot changed since the last deployment. Here's the list of changes from the example PR above. Snapshot diffs can be reviewed and approved. Here's a specific example of a snapshot diff for a component that changed in the example PR. I don't think we'll want to require UI approval to merge for now, but this could be a useful resource to validate a subset of changes.

The number of snapshots we can create per month is limited by the plan that we're on, so we shouldn't rely on this as a part of our SDLC until we understand the value, get a sense of our usage, and can determine if the cost is worth it (or if we should consider alternatives).

@@ -228,7 +229,8 @@
"build:esbuild": "rimraf dist/umd && node esbuild.config.mjs",
"serve:docs": "pnpm storybook",
"build:docs": "pnpm build:storybook",
"build:storybook": "storybook build && touch storybook-static/.nojekyll",
"build:build:gh-pages": "pnpm build-storybook && touch storybook-static/.nojekyll",
"build-storybook": "storybook build",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Chromatic expects a build-storybook command. They let us override with a custom command, but that was causing issues for me where the job would fail without a meaningful error message.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No longer build Storybook for each PR since that happens in the new deploy to chromatic job

Comment on lines +6 to +12
on:
push:
branches:
- main
pull_request_target:
branches:
- main
Copy link
Collaborator Author

@nickgros nickgros May 17, 2023

Choose a reason for hiding this comment

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

Deploy to Chromatic when we push to main (so we always have a deployment target for screenshot diffs) and on pull requests.

Use pull_request_target so we can use the deploy secret. Because we use pull_request_target, this job won't run until this is committed to main (so you won't see the new Chromatic checks on this PR).

@nickgros nickgros changed the title PORTALS-2652 PORTALS-2652 - Integrate with Chromatic May 17, 2023
@nickgros nickgros requested a review from jay-hodgson May 17, 2023 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants