-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
CI: Split CircleCI config into multiple files #32025
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
base: circleci-config-sort
Are you sure you want to change the base?
Conversation
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.
39 files reviewed, 18 comments
Edit PR Review Bot Settings | Greptile
- store_test_results: | ||
path: test-results |
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.
logic: Test results path should match working directory path for consistency. Change to test-storybooks/portable-stories-kitchen-sink/react/test-results
done | ||
yarn bench-packages --base-branch << pipeline.parameters.ghBaseBranch >> --pull-request << pipeline.parameters.ghPrNumber >> --upload | ||
# if there is a NOT a base branch OR NOT a PR number in parameters, just upload benchmarks for the branch | ||
# this happens when runned directly on branches, like next or main |
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.
syntax: Typo: 'runned' should be 'run'
# this happens when runned directly on branches, like next or main | |
# this happens when run directly on branches, like next or main |
- store_test_results: | ||
path: test-results |
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.
style: Test results directory should be prefixed with a unique identifier like 'chromatic-' to avoid conflicts with other test jobs
name: Uploading results | ||
command: yarn upload-bench $(yarn get-template --cadence << pipeline.parameters.workflow >> --task bench) << pipeline.parameters.ghPrNumber >> << pipeline.parameters.ghBaseBranch >> | ||
- report-workflow-on-failure: | ||
template: $(yarn get-template --cadence << pipeline.parameters.workflow >> --task bench) |
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.
syntax: Template parameter in report-workflow-on-failure should be quoted to handle paths with spaces.
- bench-packages: | ||
requires: | ||
- build | ||
- check |
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.
logic: The 'check' job has no dependencies specified, while most other jobs require 'build'. Consider whether this is intentional.
cd ../../ | ||
mkdir features-1 | ||
cd features-1 |
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.
logic: Use mktemp or unique directory naming to prevent conflicts in parallel runs
.circleci/config.yml
Outdated
IN_STORYBOOK_SANDBOX: true | ||
STORYBOOK_DISABLE_TELEMETRY: true | ||
STORYBOOK_INIT_EMPTY_TYPE: << parameters.template >> |
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.
style: Consider moving common environment variables like STORYBOOK_DISABLE_TELEMETRY and IN_STORYBOOK_SANDBOX into job parameters to avoid repetition
name: Storybook init from empty directory (NPM) | ||
command: | | ||
cd code | ||
yarn local-registry --open & |
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.
logic: Background process not properly handled - should add trap to cleanup local-registry process on exit
.circleci/config.yml
Outdated
command: | | ||
cd code | ||
yarn local-registry --open & | ||
cd ../../ | ||
mkdir empty-<< parameters.template >> | ||
cd empty-<< parameters.template >> | ||
npm i -g pnpm | ||
pnpm config set registry http://localhost:6001 | ||
pnpm dlx storybook init --yes --package-manager pnpm | ||
pnpm run storybook --smoke-test | ||
TEMPLATE=$(yarn get-template --cadence << pipeline.parameters.workflow >> --task test-runner) | ||
cd sandbox/$(yarn get-sandbox-dir --template $TEMPLATE) && yarn | ||
name: Install sandbox dependencies | ||
- start-event-collector | ||
- run: | ||
command: yarn task --task test-runner --template $(yarn get-template --cadence << pipeline.parameters.workflow >> --task test-runner) --no-link --start-from=never --junit | ||
environment: | ||
IN_STORYBOOK_SANDBOX: true | ||
STORYBOOK_INIT_EMPTY_TYPE: << parameters.template >> | ||
STORYBOOK_DISABLE_TELEMETRY: true | ||
- when: | ||
condition: | ||
equal: ['react-vite-ts', << parameters.template >>] | ||
steps: | ||
STORYBOOK_TELEMETRY_DEBUG: 1 | ||
STORYBOOK_TELEMETRY_URL: http://localhost:6007/event-log | ||
name: Running Test Runner | ||
- run: | ||
command: yarn --cwd scripts jiti ./event-log-checker.ts test-run $(yarn get-template --cadence << pipeline.parameters.workflow >> --task test-runner) | ||
name: Check Telemetry |
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.
style: Consider extracting telemetry check commands into a reusable command since they're used in multiple jobs (test-runner, vitest-integration)
View your CI Pipeline Execution ↗ for commit 7128fce
☁️ Nx Cloud last updated this comment at |
9f8ba24
to
7128fce
Compare
Closes #
What I did
Reorganized our CircleCI config by splitting it into separate files and then use config packing to generate the final
config.yml
.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:merged
orci:daily
GH 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.ts
Make 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/core
team here.core team members can create a canary release here or locally with
gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=<PR_NUMBER>
Greptile Summary
Splits monolithic CircleCI configuration into multiple modular files using CircleCI's config packing feature, significantly improving maintainability without changing core functionality.
.circleci/src/
for workflows, jobs, executors, commands, and parameters.circleci/README.md
explaining configuration structure and local testing procedures