-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Build: Fix windows #33221
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
Build: Fix windows #33221
Conversation
|
View your CI Pipeline Execution ↗ for commit c5af483
☁️ Nx Cloud last updated this comment at |
📝 WalkthroughWalkthroughWindows-specific CircleCI steps were adjusted to use Windows paths and a Windows working directory; Chromatic sandbox step ordering was changed to cd into the sandbox before copying artifacts; npm registry commands in the sandbox generator now use the global (-g) flag; an Angular sandbox template dependency changed to Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20–30 minutes
Possibly related PRs
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
🔇 Additional comments (2)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.circleci/config.yml(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: nx
- GitHub Check: merged
- GitHub Check: Core Unit Tests, windows-latest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.circleci/config.yml(2 hunks).circleci/src/jobs/test-init-empty-windows.yml(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: merged
- GitHub Check: nx
- GitHub Check: Core Unit Tests, windows-latest
🔇 Additional comments (2)
.circleci/src/jobs/test-init-empty-windows.yml (1)
49-51: Validate relative path navigation with new working_directory.The job steps use
cd ..to navigate from the working directory (%HOME%\storybook) to the parent (%HOME%) where the attached workspace resides. Verify that this navigation correctly reaches thecodedirectory (which contains Verdaccio and yarn local-registry) after attaching the workspace at%HOME%.Also applies to: 81-83, 114-116, 147-149
.circleci/config.yml (1)
768-927: Verify working_directory placement in YAML structure.The
working_directoryis placed at the end of thetest-init-empty-windowsjob definition (line 927), after all the steps. While this may be valid YAML, please verify this is the intended CircleCI configuration style. Typically, job metadata likeworking_directoryappears before thestepssection for clarity. Compare with the non-Windowstest-init-emptyjob (starting at line 627) which does not have aworking_directoryoverride.
| working_directory: \%HOME%\storybook | ||
|
|
||
| steps: | ||
| - checkout | ||
| - attach_workspace: | ||
| at: /tmp | ||
| at: \%HOME% |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
CircleCI Windows executor working_directory attach_workspace path syntax YAML
💡 Result:
Short answer: working_directory in CircleCI is treated as an absolute path and may be created automatically; attach_workspace.at may be an absolute path or a path relative to working_directory. On Windows executors use Windows-style absolute paths (e.g. C:\path\to\dir) or a path relative to the working_directory. Persist_to_workspace.root follows the same rule (absolute or relative to working_directory) and persist_to_workspace.paths are relative to that root. (circleci.com)
Minimal Windows YAML example:
version: 2.1
jobs:
build:
machine:
image: windows-server-2019-vs2019
working_directory: C:\project
steps:
- run: mkdir C:\project\workspace
- run: echo Hello > C:\project\workspace\out.txt
- persist_to_workspace:
root: C:\project\workspace
paths:
- out.txt
downstream:
machine:
image: windows-server-2019-vs2019
working_directory: C:\project
steps:
- attach_workspace:
at: C:\project\workspace
- run: type C:\project\workspace\out.txt
References:
- CircleCI configuration reference (executors / working_directory). [1]
- Using workspaces (attach_workspace example + rules). [2]
- persist_to_workspace / attach_workspace keys (root/paths/at details). [3]
Citations:
🏁 Script executed:
#!/bin/bash
# Check for other CircleCI Windows job configs in the repo
fd -e yml -e yaml | xargs grep -l "working_directory.*%HOME%" 2>/dev/null || echo "No matches found with %HOME%"
# Also search for Windows path patterns
fd -e yml -e yaml | xargs grep -n "working_directory.*\\\\" 2>/dev/null | head -20 || echo "No backslash patterns found"
# Look at the specific file to understand full context
echo "=== Full test-init-empty-windows.yml file ==="
cat ".circleci/src/jobs/test-init-empty-windows.yml"Repository: storybookjs/storybook
Length of output: 5555
Correct the Windows path escaping syntax: remove the leading backslash before %HOME%.
Based on CircleCI's official documentation, Windows paths in CircleCI YAML should use standard Windows format without leading backslash escaping. The configuration shows:
working_directory: \%HOME%\storybook
at: \%HOME%This should be:
working_directory: %HOME%\storybook
at: %HOME%The leading backslash before %HOME% is incorrect and will prevent proper environment variable expansion. CircleCI's documented example uses C:\project (no leading backslash), and environment variables expand as %VAR% not \%VAR%.
🤖 Prompt for AI Agents
In .circleci/src/jobs/test-init-empty-windows.yml around lines 9 to 14, the
Windows paths incorrectly include a leading backslash before the %HOME%
environment variable; remove the leading backslash so the values become standard
Windows-style with environment variable expansion (e.g. change
"\%HOME%\storybook" to "%HOME%\storybook" and "\%HOME%" to "%HOME%") to allow
CircleCI to expand the %HOME% variable correctly.
Closes #
What I did
Checklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Manual testing
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
✏️ Tip: You can customize this high-level summary in your review settings.