-
Notifications
You must be signed in to change notification settings - Fork 447
[ci] Improve Storybook deployment and comment workflow #5426
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
Conversation
🎭 Playwright Test Results⏰ Completed at: 09/30/2025, 01:26:34 AM UTC 📈 Summary
📊 Test Reports by Browser
🎉 Click on the links above to view detailed test results for each browser configuration. |
🎨 Storybook Build Status✅ Build completed successfully! ⏰ Completed at: 09/30/2025, 01:16:41 AM UTC 🔗 Links🎉 Your Storybook is ready for review! |
- Create unified shell script for Storybook deployment and PR comments - Separate workflows for fork and non-fork PRs for better security - Add deployment to Cloudflare Pages for Storybook previews - Improve error handling with retry logic for deployments - Simplify workflow logic using reusable script - Better handling of different workflow conclusions (success/failure/cancelled/skipped) Similar improvements as applied to Playwright workflow in sno-fix-playwright-comment-2 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Display deployment status even when build fails - Show specific messages for different failure scenarios - Better visibility into what happened with the deployment
- Separate storybook-build job that runs for all PRs - Deploy Storybook to Cloudflare Pages for free PR previews - Keep Chromatic deployment only for version-bump branches - Add separate deployment for Chromatic builds when applicable
- Chromatic already provides hosted builds with URLs - Add Chromatic URLs (build and storybook) to PR comments for version-bump branches - Remove redundant deploy-chromatic-build job - Add onlyChanged option to Chromatic to reduce costs
…ultiple - Fix comment update logic to properly find and update existing comments by ID - Update Chromatic URLs within the same comment instead of creating new ones - Properly filter comments by github-actions[bot] author
- Only mention Chromatic visual tests for version-bump branches - Show Cloudflare deployment message for regular PRs - Dynamically adjust starting comment based on branch name
…ng by using gh pr comment for editing existing comments chore(pr-storybook-deploy-and-comment.sh): remove unnecessary variable and streamline existing comment check logic
…n CI configuration
- Redirect all logging output to stderr in deploy_storybook function - Only return clean URL or 'failed' to stdout for proper capture - Add --commit-dirty=true flag to suppress git warnings - Fix issue where entire deployment output was shown in comment link
d17c831 to
4e06b2b
Compare
- Create unified shell script for Storybook deployment and PR comments - Separate workflows for fork and non-fork PRs for better security - Add deployment to Cloudflare Pages for Storybook previews - Improve error handling with retry logic for deployments - Simplify workflow logic using reusable script - Better handling of different workflow conclusions (success/failure/cancelled/skipped) Similar improvements as applied to Playwright workflow in sno-fix-playwright-comment-2 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Display deployment status even when build fails - Show specific messages for different failure scenarios - Better visibility into what happened with the deployment
- Separate storybook-build job that runs for all PRs - Deploy Storybook to Cloudflare Pages for free PR previews - Keep Chromatic deployment only for version-bump branches - Add separate deployment for Chromatic builds when applicable
- Chromatic already provides hosted builds with URLs - Add Chromatic URLs (build and storybook) to PR comments for version-bump branches - Remove redundant deploy-chromatic-build job - Add onlyChanged option to Chromatic to reduce costs
…ultiple - Fix comment update logic to properly find and update existing comments by ID - Update Chromatic URLs within the same comment instead of creating new ones - Properly filter comments by github-actions[bot] author
- Only mention Chromatic visual tests for version-bump branches - Show Cloudflare deployment message for regular PRs - Dynamically adjust starting comment based on branch name
…ng by using gh pr comment for editing existing comments chore(pr-storybook-deploy-and-comment.sh): remove unnecessary variable and streamline existing comment check logic
…n CI configuration
- Display deployment status even when build fails - Show specific messages for different failure scenarios - Better visibility into what happened with the deployment
- Separate storybook-build job that runs for all PRs - Deploy Storybook to Cloudflare Pages for free PR previews - Keep Chromatic deployment only for version-bump branches - Add separate deployment for Chromatic builds when applicable
- Chromatic already provides hosted builds with URLs - Add Chromatic URLs (build and storybook) to PR comments for version-bump branches - Remove redundant deploy-chromatic-build job - Add onlyChanged option to Chromatic to reduce costs
…ultiple - Fix comment update logic to properly find and update existing comments by ID - Update Chromatic URLs within the same comment instead of creating new ones - Properly filter comments by github-actions[bot] author
- Only mention Chromatic visual tests for version-bump branches - Show Cloudflare deployment message for regular PRs - Dynamically adjust starting comment based on branch name
…ng by using gh pr comment for editing existing comments chore(pr-storybook-deploy-and-comment.sh): remove unnecessary variable and streamline existing comment check logic
…n CI configuration
- Redirect all logging output to stderr in deploy_storybook function - Only return clean URL or 'failed' to stdout for proper capture - Add --commit-dirty=true flag to suppress git warnings - Fix issue where entire deployment output was shown in comment link
4e06b2b to
909eebb
Compare
|
let sno update this branch and steal the improvements from pr-playwright-*.yaml workflows |
📋 Task List: Update Storybook Workflows✅ All tasks completed! The branch has been updated with improvements from the Playwright workflows. 🔍 Analysis & ResearchKey improvements identified from pr-playwright-*.yaml:
🚀 Implementation Tasks:
📝 Summary of ChangesFiles Modified:
Commit:
✨ Status: Complete! The Storybook workflows now have the same improvements as the Playwright workflows. |
- Changed project name from comfyui-storybook to comfy-storybook in deployment script - This aligns with the new Cloudflare Pages project naming convention 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add null checks for head_repository to prevent errors with forked PRs - Simplify job status output using direct variable assignment - Remove unnecessary workflow conclusion fetching (use event data directly) - Improve logging for workflow trigger debugging - Only download artifacts when workflow succeeded - Remove duplicate start time calculation - Align error handling with playwright workflows These changes bring the Storybook deployment workflows in line with the improvements made to the Playwright workflows, providing better stability and consistency across CI/CD processes. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
## Summary - Improves Storybook deployment and PR comment workflow similar to the Playwright improvements in #5425 - Creates unified deployment and commenting system for better maintainability - Adds Cloudflare Pages deployment for Storybook previews ## Deployment Cases Matrix | Case | PR Type | Branch | Deployment | Features | |------|---------|--------|------------|----------| | **1** | Non-forked PR | `version-bump-*` | ✅ Chromatic | • Visual diff testing<br>• Chromatic build URL<br>• Chromatic Storybook URL<br>• Shows visual changes | | **2** | Non-forked PR | All branches | ✅ Cloudflare Pages | • Live Storybook preview<br>• pages.dev URL<br>• No visual diff | | **3** | Forked PR | Any branch | ✅ Cloudflare Pages | • Live Storybook preview<br>• pages.dev URL<br>• No visual diff<br>• Runs via separate workflow to avoid permission problems | ### Key Points: - **Chromatic** (paid service): Only for `version-bump-*` branches to track visual changes between releases - **Cloudflare Pages** (free): For all other PRs to provide Storybook preview without visual diff - **Security**: Forked PRs use a separate workflow with limited permissions ## Changes ### New Features - 🚀 **Cloudflare Pages Deployment**: Storybook builds are now deployed to Cloudflare Pages for easy preview - 🔄 **Unified Script**: Single reusable shell script handles both deployment and PR comments - 🔒 **Better Security**: Separate workflows for fork vs non-fork PRs ### Improvements - ♻️ **Retry Logic**: Automatic retry (3 attempts) for failed deployments - 📝 **Better Comments**: Clearer PR comments with deployment links and status - 🎯 **Simplified Logic**: Workflow logic moved to reusable script for easier maintenance - ⚡ **Better Error Handling**: Proper handling of different workflow conclusions - 🐛 **Fixed Comment Output**: Deployment logs now properly redirected to stderr ### Files Changed - `scripts/cicd/pr-storybook-deploy-and-comment.sh` - New unified deployment script - `.github/workflows/chromatic.yaml` - Updated to use new script and add deployment - `.github/workflows/pr-storybook-deploy.yaml` - New workflow for forked PRs - `.github/workflows/pr-storybook-comment.yaml` - Removed (replaced by new system) ##⚠️ Required Setup The Cloudflare Pages project `comfyui-storybook` needs to be created under the organization's Cloudflare account: ```bash # Using the account ID from GitHub secrets export CLOUDFLARE_ACCOUNT_ID=5ae914d9b87bcf6bbe1ada5798f92a5f export CLOUDFLARE_API_TOKEN=<org-token> wrangler pages project create comfyui-storybook --production-branch main ``` **Note**: The project must be created under the same Cloudflare account that's configured in the GitHub secrets. ## Test Plan - [x] Create Cloudflare Pages project `comfyui-storybook` - [x] Workflow runs successfully on all PRs - [x] PR comments are posted correctly at start and completion - [x] Storybook deploys to Cloudflare Pages with correct URL - [ ] Fork PRs are handled by separate workflow - [ ] Non-fork PRs get inline deployment - [ ] version-bump-* branches show Chromatic info ## References - Similar improvements for Playwright: #5459 - Based on pattern from sno-fix-playwright-comment-2 branch 🤖 Generated with [Claude Code](https://claude.ai/code) --------- Co-authored-by: Claude <noreply@anthropic.com>
## Summary - Improves Storybook deployment and PR comment workflow similar to the Playwright improvements in #5425 - Creates unified deployment and commenting system for better maintainability - Adds Cloudflare Pages deployment for Storybook previews ## Deployment Cases Matrix | Case | PR Type | Branch | Deployment | Features | |------|---------|--------|------------|----------| | **1** | Non-forked PR | `version-bump-*` | ✅ Chromatic | • Visual diff testing<br>• Chromatic build URL<br>• Chromatic Storybook URL<br>• Shows visual changes | | **2** | Non-forked PR | All branches | ✅ Cloudflare Pages | • Live Storybook preview<br>• pages.dev URL<br>• No visual diff | | **3** | Forked PR | Any branch | ✅ Cloudflare Pages | • Live Storybook preview<br>• pages.dev URL<br>• No visual diff<br>• Runs via separate workflow to avoid permission problems | ### Key Points: - **Chromatic** (paid service): Only for `version-bump-*` branches to track visual changes between releases - **Cloudflare Pages** (free): For all other PRs to provide Storybook preview without visual diff - **Security**: Forked PRs use a separate workflow with limited permissions ## Changes ### New Features - 🚀 **Cloudflare Pages Deployment**: Storybook builds are now deployed to Cloudflare Pages for easy preview - 🔄 **Unified Script**: Single reusable shell script handles both deployment and PR comments - 🔒 **Better Security**: Separate workflows for fork vs non-fork PRs ### Improvements - ♻️ **Retry Logic**: Automatic retry (3 attempts) for failed deployments - 📝 **Better Comments**: Clearer PR comments with deployment links and status - 🎯 **Simplified Logic**: Workflow logic moved to reusable script for easier maintenance - ⚡ **Better Error Handling**: Proper handling of different workflow conclusions - 🐛 **Fixed Comment Output**: Deployment logs now properly redirected to stderr ### Files Changed - `scripts/cicd/pr-storybook-deploy-and-comment.sh` - New unified deployment script - `.github/workflows/chromatic.yaml` - Updated to use new script and add deployment - `.github/workflows/pr-storybook-deploy.yaml` - New workflow for forked PRs - `.github/workflows/pr-storybook-comment.yaml` - Removed (replaced by new system) ##⚠️ Required Setup The Cloudflare Pages project `comfyui-storybook` needs to be created under the organization's Cloudflare account: ```bash # Using the account ID from GitHub secrets export CLOUDFLARE_ACCOUNT_ID=5ae914d9b87bcf6bbe1ada5798f92a5f export CLOUDFLARE_API_TOKEN=<org-token> wrangler pages project create comfyui-storybook --production-branch main ``` **Note**: The project must be created under the same Cloudflare account that's configured in the GitHub secrets. ## Test Plan - [x] Create Cloudflare Pages project `comfyui-storybook` - [x] Workflow runs successfully on all PRs - [x] PR comments are posted correctly at start and completion - [x] Storybook deploys to Cloudflare Pages with correct URL - [ ] Fork PRs are handled by separate workflow - [ ] Non-fork PRs get inline deployment - [ ] version-bump-* branches show Chromatic info ## References - Similar improvements for Playwright: #5459 - Based on pattern from sno-fix-playwright-comment-2 branch 🤖 Generated with [Claude Code](https://claude.ai/code) --------- Co-authored-by: Claude <noreply@anthropic.com>
- Improves Storybook deployment and PR comment workflow similar to the Playwright improvements in #5425 - Creates unified deployment and commenting system for better maintainability - Adds Cloudflare Pages deployment for Storybook previews | Case | PR Type | Branch | Deployment | Features | |------|---------|--------|------------|----------| | **1** | Non-forked PR | `version-bump-*` | ✅ Chromatic | • Visual diff testing<br>• Chromatic build URL<br>• Chromatic Storybook URL<br>• Shows visual changes | | **2** | Non-forked PR | All branches | ✅ Cloudflare Pages | • Live Storybook preview<br>• pages.dev URL<br>• No visual diff | | **3** | Forked PR | Any branch | ✅ Cloudflare Pages | • Live Storybook preview<br>• pages.dev URL<br>• No visual diff<br>• Runs via separate workflow to avoid permission problems | - **Chromatic** (paid service): Only for `version-bump-*` branches to track visual changes between releases - **Cloudflare Pages** (free): For all other PRs to provide Storybook preview without visual diff - **Security**: Forked PRs use a separate workflow with limited permissions - 🚀 **Cloudflare Pages Deployment**: Storybook builds are now deployed to Cloudflare Pages for easy preview - 🔄 **Unified Script**: Single reusable shell script handles both deployment and PR comments - 🔒 **Better Security**: Separate workflows for fork vs non-fork PRs - ♻️ **Retry Logic**: Automatic retry (3 attempts) for failed deployments - 📝 **Better Comments**: Clearer PR comments with deployment links and status - 🎯 **Simplified Logic**: Workflow logic moved to reusable script for easier maintenance - ⚡ **Better Error Handling**: Proper handling of different workflow conclusions - 🐛 **Fixed Comment Output**: Deployment logs now properly redirected to stderr - `scripts/cicd/pr-storybook-deploy-and-comment.sh` - New unified deployment script - `.github/workflows/chromatic.yaml` - Updated to use new script and add deployment - `.github/workflows/pr-storybook-deploy.yaml` - New workflow for forked PRs - `.github/workflows/pr-storybook-comment.yaml` - Removed (replaced by new system) The Cloudflare Pages project `comfyui-storybook` needs to be created under the organization's Cloudflare account: ```bash export CLOUDFLARE_ACCOUNT_ID=5ae914d9b87bcf6bbe1ada5798f92a5f export CLOUDFLARE_API_TOKEN=<org-token> wrangler pages project create comfyui-storybook --production-branch main ``` **Note**: The project must be created under the same Cloudflare account that's configured in the GitHub secrets. - [x] Create Cloudflare Pages project `comfyui-storybook` - [x] Workflow runs successfully on all PRs - [x] PR comments are posted correctly at start and completion - [x] Storybook deploys to Cloudflare Pages with correct URL - [ ] Fork PRs are handled by separate workflow - [ ] Non-fork PRs get inline deployment - [ ] version-bump-* branches show Chromatic info - Similar improvements for Playwright: #5459 - Based on pattern from sno-fix-playwright-comment-2 branch 🤖 Generated with [Claude Code](https://claude.ai/code) --------- Co-authored-by: Claude <noreply@anthropic.com>


Summary
Deployment Cases Matrix
version-bump-*• Chromatic build URL
• Chromatic Storybook URL
• Shows visual changes
• pages.dev URL
• No visual diff
• pages.dev URL
• No visual diff
• Runs via separate workflow to avoid permission problems
Key Points:
version-bump-*branches to track visual changes between releasesChanges
New Features
Improvements
Files Changed
scripts/cicd/pr-storybook-deploy-and-comment.sh- New unified deployment script.github/workflows/chromatic.yaml- Updated to use new script and add deployment.github/workflows/pr-storybook-deploy.yaml- New workflow for forked PRs.github/workflows/pr-storybook-comment.yaml- Removed (replaced by new system)The Cloudflare Pages project
comfyui-storybookneeds to be created under the organization's Cloudflare account:Note: The project must be created under the same Cloudflare account that's configured in the GitHub secrets.
Test Plan
comfyui-storybookReferences
🤖 Generated with Claude Code