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

feat: added storybook configruation for publishing on chromatic #3548

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

devilkiller-ag
Copy link
Member

@devilkiller-ag devilkiller-ag commented Jan 6, 2025

Description
Storybook configuration for publishing on Chromatic.

Current Deploy Link: https://677b54b0a822478a61e2184e-zyhxiiozkj.chromatic.com/
Chromatic Library: https://www.chromatic.com/library?appId=677b54b0a822478a61e2184e

Discussion is needed with website maintainers.

Summary by CodeRabbit

  • Chores

    • Added GitHub Actions workflow for Chromatic Publish
    • Updated package.json with Chromatic script and dependency
    • Restructured author information in package configuration
  • Documentation

    • Integrated Chromatic for visual testing and deployment

Copy link

coderabbitai bot commented Jan 6, 2025

Walkthrough

A new GitHub Actions workflow for Chromatic has been introduced to automate the publishing and testing of Storybook components. The workflow is configured to run on Ubuntu, set up Node.js version 20, and integrate Chromatic for visual testing and deployment. Simultaneously, the package.json file was updated to include a new Chromatic script, modify the author details, and add the Chromatic package as a development dependency.

Changes

File Changes
.github/workflows/chromatic.yml - Added new GitHub Actions workflow
- Configures Chromatic publish job
package.json - Added "chromatic" script
- Updated author field to object format
- Added chromatic to devDependencies

Sequence Diagram

sequenceDiagram
    participant GH as GitHub Actions
    participant Node as Node.js
    participant Chromatic as Chromatic Service
    
    GH->>Node: Checkout repository
    Node->>Node: Setup Node.js v20
    Node->>Chromatic: Run Chromatic publish
    Chromatic-->>GH: Publish & Test Results
Loading

Poem

🐰 A Chromatic Tale of Code Delight 🎨

Workflows dance, a GitHub stage bright,
Storybook components take their flight,
Yarn spins, Node.js takes the lead,
Chromatic's magic, our visual creed!

Commit and publish with rabbit's might! 🚀


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

netlify bot commented Jan 6, 2025

Deploy Preview for asyncapi-website ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit a3c6bc2
🔍 Latest deploy log https://app.netlify.com/sites/asyncapi-website/deploys/677e546580216e000881f4b1
😎 Deploy Preview https://deploy-preview-3548--asyncapi-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@devilkiller-ag devilkiller-ag added the gsoc This label should be used for issues or discussions related to ideas for Google Summer of Code label Jan 6, 2025
Copy link

codecov bot commented Jan 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (4d002ce) to head (a3c6bc2).

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #3548   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           19        19           
  Lines          668       668           
=========================================
  Hits           668       668           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@asyncapi-bot
Copy link
Contributor

asyncapi-bot commented Jan 6, 2025

⚡️ Lighthouse report for the changes in this PR:

Category Score
🔴 Performance 35
🟢 Accessibility 98
🟢 Best practices 92
🟢 SEO 100
🔴 PWA 33

Lighthouse ran on https://deploy-preview-3548--asyncapi-website.netlify.app/

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
.github/workflows/chromatic.yml (1)

5-5: Consider multiple triggers.

Currently, the workflow triggers only when a push event occurs. If you also want visual regression tests on pull requests (which is common for Chromatic), consider adding pull_request to triggers.

 on:
-  push
+  push:
+    branches: [ main ]
+  pull_request:
+    branches: [ main ]
package.json (1)

145-145: Dependency pinned to a reasonable major version.

Using "^11.22.0" for Chromatic ensures broad compatibility. Remember to watch for any new major versions or security advisories.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fe09451 and 5584d52.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • .github/workflows/chromatic.yml (1 hunks)
  • package.json (4 hunks)
⏰ Context from checks skipped due to timeout of 180000ms (1)
  • GitHub Check: Lighthouse CI
🔇 Additional comments (4)
.github/workflows/chromatic.yml (2)

1-2: Well-defined workflow name.

Naming the workflow as Chromatic Publish is clean and descriptive, making it easy for other contributors to identify its purpose in the repository.


23-28: Ensure secrets are configured.

Please verify that the CHROMATIC_PROJECT_TOKEN secret is set in the repo settings. Otherwise, this step will fail at runtime.

package.json (2)

28-29: Chromatic script usage is clear.

Using --build-script-name=build:storybook ensures Chromatic is leveraging the designated Storybook build. This is a straightforward and effective approach.


42-45: Author field format improved.

Splitting the author details into an object is a good move for consistency and clarity, especially if you plan to parse or reuse this data programmatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gsoc This label should be used for issues or discussions related to ideas for Google Summer of Code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants