Skip to content

ci: build and deploy the website when the storybook resources change#609

Merged
tbouffard merged 1 commit intomainfrom
ci/deploy_website_when_sb_change
Jan 2, 2025
Merged

ci: build and deploy the website when the storybook resources change#609
tbouffard merged 1 commit intomainfrom
ci/deploy_website_when_sb_change

Conversation

@tbouffard
Copy link
Member

@tbouffard tbouffard commented Jan 2, 2025

Summary by CodeRabbit

  • Chores
    • Updated GitHub Actions workflow configuration to refine path triggers for website generation
    • Enhanced workflow to more precisely control which file changes initiate the website build process

@tbouffard tbouffard added the chore Build, CI/CD or repository tasks (issues/PR maintenance, environments, ...) label Jan 2, 2025
@coderabbitai
Copy link

coderabbitai bot commented Jan 2, 2025

Walkthrough

The pull request modifies the GitHub Actions workflow configuration for website generation, specifically updating the path filters for the pull_request event. The changes allow the workflow to be triggered by modifications in the packages/html/**/* directory, while explicitly excluding changes to the packages/html/README.md file. The core workflow structure, including build and deployment jobs, remains consistent with previous configurations.

Changes

File Change Summary
.github/workflows/generate-website.yml Added path filters for pull_request event, including packages/html/**/* and excluding packages/html/README.md

Sequence Diagram

sequenceDiagram
    participant PR as Pull Request
    participant Workflow as GitHub Actions Workflow
    participant HTML as HTML Package
    participant Pages as GitHub Pages

    alt Valid Path Changes
        PR ->> Workflow: Trigger on changes in packages/html
        Workflow ->> HTML: Validate changes
        Workflow ->> Pages: Deploy website
    else Excluded Changes
        PR ->> Workflow: Changes to README.md
        Workflow --x Pages: No deployment triggered
    end
Loading

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d01a614 and 02cc6c8.

📒 Files selected for processing (1)
  • .github/workflows/generate-website.yml (1 hunks)
🔇 Additional comments (1)
.github/workflows/generate-website.yml (1)

28-29: LGTM! Path filters are correctly configured.

The added path filters are well-structured and consistent with the existing patterns:

  • packages/html/**/* will trigger the workflow for any changes in the HTML package
  • !packages/html/README.md properly excludes the README file to avoid unnecessary builds

Let's verify that the HTML package is indeed used in the Storybook build:

✅ Verification successful

HTML package contains Storybook stories, confirming the path filters are correctly configured

The verification results show that the packages/html/ directory contains numerous Storybook story files (*.stories.js/ts), confirming that the HTML package is indeed used in the Storybook build. Let's verify the website package's build configuration to ensure completeness:


HTML package is integral to Storybook with 70+ story files, path filters are correct

Based on the initial verification results, we found extensive evidence that the HTML package is a crucial part of the Storybook build:

  • The packages/html/stories/ directory contains over 70 Storybook story files (*.stories.js/ts)
  • These stories cover various features like Anchors, Animation, AutoLayout, etc.

The path filters in the workflow:

      - 'packages/html/**/*'
      - '!packages/html/README.md'

are correctly configured to trigger the website generation when any of these story files change, while properly excluding the README to avoid unnecessary builds.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the relationship between HTML package and Storybook build
# Expected: Find references to HTML package in Storybook configuration or package dependencies

# Check for Storybook configuration files that might reference the HTML package
echo "Searching for Storybook configuration files..."
fd -e js -e ts "\.stories\.|\.storybook" packages/html/

# Check package.json files for dependencies between packages
echo "Checking package dependencies..."
for pkg in packages/*/package.json; do
  echo "Checking $pkg..."
  cat "$pkg" | jq -r '.dependencies."@maxgraph/html" // .devDependencies."@maxgraph/html" // empty'
done

Length of output: 5705


Script:

#!/bin/bash
# Check website's build configuration
echo "Checking website's build configuration..."
fd -g "*.js" -g "*.ts" -g "*.json" .storybook/ packages/website/.storybook/

# Check if there are any references to HTML package stories in the website's storybook config
echo "Checking for HTML package references in website's storybook config..."
rg -l "packages/html" .storybook/ packages/website/.storybook/

Length of output: 787


Script:

#!/bin/bash
# Let's try a different approach to find Storybook configuration
echo "Searching for Storybook configuration files..."
fd -g "*storybook*" -g "*.stories.*"

# Check main.js/ts which typically contains story loading configuration
echo "Checking story loading configuration..."
rg -l "packages/html" --type js --type ts

Length of output: 371


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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

@tbouffard tbouffard marked this pull request as ready for review January 2, 2025 16:05
@tbouffard tbouffard merged commit 9303a85 into main Jan 2, 2025
@tbouffard tbouffard deleted the ci/deploy_website_when_sb_change branch January 2, 2025 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Build, CI/CD or repository tasks (issues/PR maintenance, environments, ...)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant