Ci: Allow branch selection for sandbox generation#34618
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughReplaces two fixed sandbox-generation jobs with a matrix-driven Changes
Sequence Diagram(s)sequenceDiagram
participant Trigger as GitHub Actions Trigger
participant SetBranches as set-branches Job
participant Matrix as generate Job (matrix.branch)
participant Checkout as actions/checkout
participant Generate as sandbox generation steps
participant Publish as publish step
participant Discord as Discord notifier
Trigger->>SetBranches: compute target branches (workflow_dispatch -> [ref], schedule -> [next, main])
SetBranches-->>Matrix: provide branches for matrix
loop for each matrix.branch
Matrix->>Checkout: checkout repo @ matrix.branch
Checkout->>Generate: run generation/build steps
Generate->>Publish: publish with branch arg (scheduled: matrix.branch, manual: next)
Publish-->>Matrix: success/failure
alt failure
Matrix->>Discord: send failure message referencing matrix.branch
end
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/generate-sandboxes.yml:
- Around line 30-37: The run block under the step with id "set" in the GitHub
Actions workflow inlines `${{ github.ref_name }}` into a shell script which
risks template/shell injection; instead pass the ref through env (e.g.,
REF_NAME: ${{ github.ref_name }}) and reference it inside the run body as a
shell variable (e.g., "$REF_NAME"), then construct the branches JSON safely (for
example using jq or by validating/escaping REF_NAME) and write it to
$GITHUB_OUTPUT; update only the step containing the run, keep the same logic for
workflow_dispatch vs default branches, and ensure all references to the inline
`${{ github.ref_name }}` are replaced with the environment variable.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: eed87730-d98a-4b24-880d-5b963c2667bb
📒 Files selected for processing (1)
.github/workflows/generate-sandboxes.yml
Package BenchmarksCommit: The following packages have significant changes to their size or dependencies:
|
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 186 | 186 | 0 |
| Self size | 76 KB | 76 KB | 0 B |
| Dependency size | 32.78 MB | 32.89 MB | 🚨 +111 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/angular
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 185 | 185 | 0 |
| Self size | 140 KB | 140 KB | 0 B |
| Dependency size | 30.44 MB | 30.54 MB | 🚨 +106 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/ember
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 190 | 190 | 0 |
| Self size | 15 KB | 15 KB | 0 B |
| Dependency size | 29.50 MB | 29.61 MB | 🚨 +111 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/nextjs
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 535 | 535 | 0 |
| Self size | 650 KB | 650 KB | 0 B |
| Dependency size | 60.80 MB | 60.91 MB | 🚨 +111 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/react-webpack5
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 273 | 273 | 0 |
| Self size | 23 KB | 23 KB | 🎉 -12 B 🎉 |
| Dependency size | 45.41 MB | 45.52 MB | 🚨 +111 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/server-webpack5
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 198 | 198 | 0 |
| Self size | 16 KB | 16 KB | 🎉 -12 B 🎉 |
| Dependency size | 34.04 MB | 34.15 MB | 🚨 +111 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
@storybook/preset-react-webpack
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 166 | 166 | 0 |
| Self size | 18 KB | 18 KB | 0 B |
| Dependency size | 31.78 MB | 31.89 MB | 🚨 +111 KB 🚨 |
| Bundle Size Analyzer | Link | Link |
Closes #
What I did
This PR changes the generate sandbox CI to allow selection of the source branch from which is generation is run from
Checklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Manual testing
verify sandbox generation action can be selected with any other branch
Caution
This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!
Documentation
MIGRATION.MD
Checklist for Maintainers
When this PR is ready for testing, make sure to add
ci:normal,ci:mergedorci:dailyGH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found incode/lib/cli-storybook/src/sandbox-templates.tsMake sure this PR contains one of the labels below:
Available labels
bug: Internal changes that fixes incorrect behavior.maintenance: User-facing maintenance tasks.dependencies: Upgrading (sometimes downgrading) dependencies.build: Internal-facing build tooling & test updates. Will not show up in release changelog.cleanup: Minor cleanup style change. Will not show up in release changelog.documentation: Documentation only changes. Will not show up in release changelog.feature request: Introducing a new feature.BREAKING CHANGE: Changes that break compatibility in some way with current major version.other: Changes that don't fit in the above categories.🦋 Canary release
This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the
@storybookjs/coreteam here.core team members can create a canary release here or locally with
gh workflow run --repo storybookjs/storybook publish.yml --field pr=<PR_NUMBER>Summary by CodeRabbit