-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
[code-infra] Run react-17
and react-next
workflows on the next branch
#42690
Changes from 10 commits
0d49462
832ae9f
902fe4c
1a10d88
26b1740
7411f56
e70e366
fd8994c
09cf45e
70ddec3
b9e190a
67551c9
5741a63
7fe6d03
c0c6b40
769c02c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -108,7 +108,16 @@ commands: | |
pnpm --version | ||
- run: | ||
name: Install js dependencies | ||
command: pnpm install | ||
command: | | ||
echo "React version $REACT_VERSION" | ||
if [[ $(git --no-pager diff HEAD) == "" ]]; | ||
then | ||
echo "pnpm install" | ||
pnpm install | ||
else | ||
echo "pnpm install --no-frozen-lockfile" | ||
pnpm install --no-frozen-lockfile | ||
fi | ||
- when: | ||
condition: << parameters.browsers >> | ||
steps: | ||
|
@@ -887,48 +896,106 @@ workflows: | |
jobs: | ||
- test_profile: | ||
<<: *default-context | ||
|
||
# This workflow can be triggered manually on the PR | ||
react-17: | ||
when: | ||
equal: [react-17, << pipeline.parameters.workflow >>] | ||
jobs: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I had to duplicate the jobs here, I couldn't find a way to reuse them in CircleCI (the experience of configuring Circle CI is not great TBH 😅). The whole point is that: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, it's not great. Perhaps an orb could fix duplication here, but I don't really mind it so much. |
||
- test_unit: | ||
<<: *default-context | ||
react-version: ^17.0.0 | ||
name: test_unit-react@17 | ||
- test_browser: | ||
<<: *default-context | ||
react-version: ^17.0.0 | ||
name: test_browser-react@17 | ||
- test_regressions: | ||
<<: *default-context | ||
react-version: ^17.0.0 | ||
name: test_regressions-react@17 | ||
- test_e2e: | ||
<<: *default-context | ||
react-version: ^17.0.0 | ||
name: test_e2e-react@17 | ||
|
||
# This workflow is identical to react-17, but scheduled | ||
react-17-cron: | ||
triggers: | ||
- schedule: | ||
cron: '0 0 * * *' | ||
filters: | ||
branches: | ||
only: | ||
- master | ||
- next | ||
jobs: | ||
- test_unit: | ||
<<: *default-context | ||
react-version: ^17.0.0 | ||
name: test_unit-react@17 | ||
- test_browser: | ||
<<: *default-context | ||
react-version: ^17.0.0 | ||
name: test_browser-react@17 | ||
- test_regressions: | ||
<<: *default-context | ||
react-version: ^17.0.0 | ||
name: test_regressions-react@17 | ||
- test_e2e: | ||
<<: *default-context | ||
react-version: ^17.0.0 | ||
name: test_e2e-react@17 | ||
|
||
# This workflow can be triggered manually on the PR | ||
react-next: | ||
when: | ||
equal: [react-next, << pipeline.parameters.workflow >>] | ||
jobs: | ||
- test_unit: | ||
<<: *default-context | ||
react-version: next | ||
name: test_unit-react@next | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe it got in a bad state after renaming those jobs? Maybe try opening a different PR? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tried in #42991 and the result is the same... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe circleci reuses some existing state when opening a PR for the same commit. At least I think I've observed that before. Trying out that hypothesis in mui/mui-x#13942 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, that seems to work! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All looks good now! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, go for it 👍 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
- test_browser: | ||
<<: *default-context | ||
react-version: next | ||
name: test_browser-react@next | ||
- test_regressions: | ||
<<: *default-context | ||
react-version: next | ||
name: test_regressions-react@next | ||
- test_e2e: | ||
<<: *default-context | ||
react-version: next | ||
name: test_e2e-react@next | ||
# This workflow is identical to react-next, but scheduled | ||
react-next-cron: | ||
triggers: | ||
- schedule: | ||
cron: '0 0 * * *' | ||
filters: | ||
branches: | ||
only: | ||
- master | ||
- next | ||
jobs: | ||
- test_unit: | ||
<<: *default-context | ||
react-version: next | ||
name: test_unit-react@next | ||
- test_browser: | ||
<<: *default-context | ||
react-version: next | ||
name: test_browser-react@next | ||
- test_regressions: | ||
<<: *default-context | ||
react-version: next | ||
name: test_regressions-react@next | ||
- test_e2e: | ||
<<: *default-context | ||
react-version: next | ||
name: test_e2e-react@next | ||
|
||
typescript-next: | ||
triggers: | ||
- schedule: | ||
|
@@ -937,6 +1004,7 @@ workflows: | |
branches: | ||
only: | ||
- master | ||
- next | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added |
||
jobs: | ||
- test_types_next: | ||
<<: *default-context | ||
|
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.
The
useReactVersion
script modifiesresolutions
inpackage.json
, and it can't install dependencies without this flag.If there were no changes done to package.json (
git --no-pager diff HEAD) == ""
), the flag is not being passed.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.
Would it make sense for the
useReactVersion
script to runpnpm install
after it sets the resolutions? That would make the lockfile consistent with what's installed and this branching becomes unnecessary.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.
Yeah, running
useReactVersion
without installing the dependencies does not make much sense anyway 👍🏻