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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for Chromatic Publish Action #721

Merged
merged 4 commits into from Jun 16, 2023
Merged

Conversation

jamigibbs
Copy link
Contributor

@jamigibbs jamigibbs commented Jun 15, 2023

Chromatic

https://chromatic-publish-error--60f9b557105290003b387cd5.chromatic.com

Description

Our Chromatic github workflow for publishing Storybook previews stopped working a few days ago. There is an issue reported to the chromatic-cli that is similar to what we are experiencing:

Screenshot 2023-06-14 at 4 31 06 PM

The resolution mentioned in that issue is to add an empty "scripts": {}, tag to the root package.json file but this did not work in our case (see the failure below in commit ffb57dc).

Adding a "fake script" does work though (which is how this PR is passing at the moment):

  "scripts": {
    "chromatic-bridge": "echo \"Nothing to see here\""
  },

In an older issue, the following was suggested to avoid having to add an unnecessary script tag to the root package.json:

Can you try adding the --storybook-build-dir REPLACE_ME_WITH_DIR here? The CLI currently infers how to build your storybook from the package.json file. If you build your storybook using the NX command and then point the CLI at the output directory using the flag above, you should get the desired outcome. Docs: https://www.chromatic.com/docs/cli#storybook-options

But it seems like we already have the --storybook-build-dir option set in our Github workflow so I'm not sure if it needs to be added somewhere else too?

https://github.com/department-of-veterans-affairs/component-library/blob/main/.github/workflows/chromatic.yml#L40

        uses: chromaui/action@v1
        with:
          token: $
          # 馃憞 Chromatic projectToken, refer to the manage page to obtain it.
          projectToken: $
         storybookBuildDir: packages/storybook/storybook-static

Testing done

Screenshots

Acceptance criteria

  • [ ]

Definition of done

  • Documentation has been updated, if applicable
  • A link has been provided to the originating GitHub issue (or connected to it via ZenHub)

@jamigibbs jamigibbs added the ignore-for-release Used if you want to ignore the PR in the generated release notes label Jun 15, 2023
@jamigibbs jamigibbs changed the title Testing Chromatic Publish Action Update for Chromatic Publish Action Jun 15, 2023
@jamigibbs jamigibbs marked this pull request as ready for review June 15, 2023 22:16
@jamigibbs jamigibbs requested a review from a team as a code owner June 15, 2023 22:16
Copy link
Contributor

@Andrew565 Andrew565 left a comment

Choose a reason for hiding this comment

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

Agreed that this feels hacky, but at least it works and doesn't introduce any weird side effects.

@Andrew565 Andrew565 merged commit 6cf2832 into main Jun 16, 2023
19 checks passed
@Andrew565 Andrew565 deleted the chromatic-publish-error branch June 16, 2023 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ignore-for-release Used if you want to ignore the PR in the generated release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants