Skip to content
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

[core] Add react-next workflow in CircleCI #13360

Merged
merged 26 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
917e2f2
add react_next workflow in circle ci
cherniavskii Jun 5, 2024
8d27ad0
run workflows conditionally
cherniavskii Jun 4, 2024
0408bbb
fix pnpm not being able to install dependencies
cherniavskii Jun 4, 2024
7dc4fe2
use different job names for react-next workflow
cherniavskii Jun 4, 2024
54a6230
add readme
cherniavskii Jun 4, 2024
89949e6
try using approval job
cherniavskii Jun 5, 2024
f977295
update readme
cherniavskii Jun 5, 2024
43e241b
Skip `mergeClassName` on `DateRangePickerDay`
LukasTy May 30, 2024
4eb5302
Fix `GridPanel` test
LukasTy May 30, 2024
a561095
use @mui/internal-test-utils without enzyme
cherniavskii Jun 5, 2024
1a56356
Merge branch 'master' into react-19-in-CI
cherniavskii Jun 17, 2024
c4751d1
update pnpm lock
cherniavskii Jun 17, 2024
1143436
Revert "try using approval job"
cherniavskii Jun 17, 2024
8e294ae
Revert "update readme"
cherniavskii Jun 17, 2024
eafbe98
update readme
cherniavskii Jun 17, 2024
02c00ea
update @mui/internal-test-utils
cherniavskii Jun 17, 2024
dbee72a
pnpm dedupe
cherniavskii Jun 17, 2024
738075a
Merge branch 'master' into react-19-in-CI
cherniavskii Jun 19, 2024
8d92d02
Merge branch 'master' into react-19-in-CI
cherniavskii Jun 25, 2024
ab80af3
Merge branch 'master' into react-19-in-CI
cherniavskii Jun 25, 2024
d312393
pnpm dedupe
cherniavskii Jun 25, 2024
0d12ad1
Merge branch 'master' into react-19-in-CI
cherniavskii Jul 1, 2024
7a85c12
use --no-frozen-lockfile flag conditionally
cherniavskii Jul 1, 2024
a8be510
add logs
cherniavskii Jul 1, 2024
5d2e392
remove enzyme from useReactVersion
cherniavskii Jul 2, 2024
f5689b7
Merge branch 'master' into react-19-in-CI
cherniavskii Jul 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 51 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ parameters:
description: Whether to force browserstack usage. We have limited resources on browserstack so the pipeline might decide to skip browserstack if this parameter isn't set to true.
type: boolean
default: false
react-dist-tag:
description: The dist-tag of react to be used
react-version:
description: The version of react to be used
type: string
default: stable
workflow:
Expand All @@ -20,10 +20,10 @@ parameters:

default-job: &default-job
parameters:
react-dist-tag:
description: The dist-tag of react to be used
react-version:
description: The version of react to be used
type: string
default: << pipeline.parameters.react-dist-tag >>
default: << pipeline.parameters.react-version >>
e2e-base-url:
description: The base url for running end-to-end test
type: string
Expand All @@ -33,7 +33,7 @@ default-job: &default-job
PLAYWRIGHT_BROWSERS_PATH: /tmp/pw-browsers
# expose it globally otherwise we have to thread it from each job to the install command
BROWSERSTACK_FORCE: << pipeline.parameters.browserstack-force >>
REACT_DIST_TAG: << parameters.react-dist-tag >>
REACT_VERSION: << parameters.react-version >>
working_directory: /tmp/mui
docker:
- image: cimg/node:18.20
Expand All @@ -59,6 +59,13 @@ commands:
description: 'Set to true if you intend to any browser (for example with playwright).'

steps:
- run:
name: Resolve React version
command: |
node scripts/useReactVersion.mjs
# log a patch for maintainers who want to check out this change
git --no-pager diff HEAD

- when:
condition: << parameters.browsers >>
steps:
Expand Down Expand Up @@ -91,7 +98,7 @@ commands:
pnpm --version
- run:
name: Install js dependencies
command: pnpm install
command: pnpm install --no-frozen-lockfile
LukasTy marked this conversation as resolved.
Show resolved Hide resolved
- when:
condition: << parameters.browsers >>
steps:
Expand Down Expand Up @@ -147,7 +154,7 @@ jobs:
command: |
curl -Os https://uploader.codecov.io/latest/linux/codecov
chmod +x codecov
./codecov -t ${CODECOV_TOKEN} -Z -F "$REACT_DIST_TAG-jsdom"
./codecov -t ${CODECOV_TOKEN} -Z -F "$REACT_VERSION-jsdom"
test_lint:
<<: *default-job
steps:
Expand Down Expand Up @@ -337,3 +344,39 @@ workflows:
- test_e2e_website:
requires:
- checkout

react-next:
# triggers:
# - schedule:
# cron: '0 0 * * *'
# filters:
# branches:
# only:
# - master
jobs:
- hold:
type: approval
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The downside is that all the PRs will have a pending check if this workflow is not triggered manually.

An alternative approach that avoids the pending check is to manually trigger the workflow:

Screen.Recording.2024-06-05.at.21.08.20.mov

Thoughts?

cc @mui/code-infra

Copy link
Member

@Janpot Janpot Jun 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you could set up a nightly build, but then I suppose we have the problem of not being notified. I'm not sure how hard it would be to set up slack or email notifications for a single failed workflow.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, a scheduled workflow is good. But I also wanted to add an ability to run the workflow on the PR on demand.
This would be useful when working on React 19 compatibility, or when we want to make sure the specific PR would work across different React versions.

Copy link
Member

@Janpot Janpot Jun 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, I understand. Having those builds in pending state won't be the greatest DX though.

How hard would it be to do this workflow in GitHub actions? It would open up the possibility to build based on e.g. a PR comment, or PR title, or a label.

edit: ok, nvm, it's a lot of work

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, triggering a CircleCI workflow from GitHub action if the PR has a specific label shouldn't be that hard to do 🤔
I've never used GitHub Actions, but I can give it a try, thanks for the suggestion 👍🏻

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having those builds in pending state won't be the greatest DX though.

Yes, it's a no-go. CircleCI is not great when it comes to optional manual workflows

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, triggering a CircleCI workflow from GitHub action if the PR has a specific label shouldn't be that hard to do

I don't think we get this info in the the pipeline, but I only investigated it briefly.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've reverted the approval type for this workflow.
It is still possible to run react-next tests on demand, it's just not as convenient. See https://github.com/cherniavskii/mui-x/blob/react-19-in-CI/test/README.md#next-version
The upside is that the always pending workflow is gone 👍🏻

- test_unit:
<<: *default-context
react-version: next
name: test_unit-react@next
requires:
- hold
- test_browser:
<<: *default-context
react-version: next
name: test_browser-react@next
requires:
- hold
- test_regressions:
<<: *default-context
react-version: next
name: test_regressions-react@next
requires:
- hold
- test_e2e:
<<: *default-context
react-version: next
name: test_e2e-react@next
requires:
- hold
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"@mnajdova/enzyme-adapter-react-18": "^0.2.0",
"@mui/icons-material": "^5.15.19",
"@mui/internal-markdown": "^1.0.4",
"@mui/internal-test-utils": "1.0.0",
"@mui/internal-test-utils": "https://pkg.csb.dev/mui/material-ui/commit/81f95747/@mui/internal-test-utils",
"@mui/material": "^5.15.19",
"@mui/monorepo": "github:mui/material-ui#f0026ad5bf4e1957cebd65b882bf45219514ca64",
"@mui/utils": "^5.15.14",
Expand Down
2 changes: 1 addition & 1 deletion packages/x-charts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
}
},
"devDependencies": {
"@mui/internal-test-utils": "1.0.0",
"@mui/internal-test-utils": "https://pkg.csb.dev/mui/material-ui/commit/81f95747/@mui/internal-test-utils",
"@react-spring/core": "^9.7.3",
"@react-spring/shared": "^9.7.3",
"@types/d3-color": "^3.1.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/x-data-grid-premium/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"react-dom": "^17.0.0 || ^18.0.0"
},
"devDependencies": {
"@mui/internal-test-utils": "1.0.0",
"@mui/internal-test-utils": "https://pkg.csb.dev/mui/material-ui/commit/81f95747/@mui/internal-test-utils",
"@types/prop-types": "^15.7.12",
"date-fns": "^2.30.0",
"rimraf": "^5.0.7"
Expand Down
2 changes: 1 addition & 1 deletion packages/x-data-grid-pro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"react-dom": "^17.0.0 || ^18.0.0"
},
"devDependencies": {
"@mui/internal-test-utils": "1.0.0",
"@mui/internal-test-utils": "https://pkg.csb.dev/mui/material-ui/commit/81f95747/@mui/internal-test-utils",
"@types/prop-types": "^15.7.12",
"rimraf": "^5.0.7"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/x-data-grid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"react-dom": "^17.0.0 || ^18.0.0"
},
"devDependencies": {
"@mui/internal-test-utils": "1.0.0",
"@mui/internal-test-utils": "https://pkg.csb.dev/mui/material-ui/commit/81f95747/@mui/internal-test-utils",
"@mui/joy": "5.0.0-beta.32",
"@mui/types": "^7.2.14",
"@types/prop-types": "^15.7.12",
Expand Down
8 changes: 7 additions & 1 deletion packages/x-data-grid/src/components/panel/GridPanel.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@ describe('<GridPanel />', () => {
classes: classes as any,
inheritComponent: Popper,
muiName: 'MuiGridPanel',
render: (node: React.ReactElement) => render(<Wrapper>{node}</Wrapper>),
render: (node: React.ReactElement) =>
render(
<Wrapper>
<div data-id="gridPanelAnchor" />
{node}
</Wrapper>,
),
wrapMount:
(baseMount: (node: React.ReactElement) => import('enzyme').ReactWrapper) =>
(node: React.ReactNode) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/x-date-pickers-pro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
}
},
"devDependencies": {
"@mui/internal-test-utils": "1.0.0",
"@mui/internal-test-utils": "https://pkg.csb.dev/mui/material-ui/commit/81f95747/@mui/internal-test-utils",
"@types/luxon": "^3.4.2",
"@types/prop-types": "^15.7.12",
"date-fns": "^2.30.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ describe('<DateRangePickerDay />', () => {
skip: [
'componentProp',
'rootClass', // forwards classes to DateRangePickerDayDay, but applies root class on DateRangePickerDayRoot
'mergeClassName', // forwards other props (i.e. data-test-id) to the DateRangePickerDayDay, but `className` is applied on the root
'componentsProp',
'reactTestRenderer',
'propsSpread',
Expand Down
2 changes: 1 addition & 1 deletion packages/x-date-pickers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
}
},
"devDependencies": {
"@mui/internal-test-utils": "1.0.0",
"@mui/internal-test-utils": "https://pkg.csb.dev/mui/material-ui/commit/81f95747/@mui/internal-test-utils",
"@types/luxon": "^3.4.2",
"@types/moment-hijri": "^2.1.4",
"@types/moment-jalaali": "^0.7.9",
Expand Down
2 changes: 1 addition & 1 deletion packages/x-license/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"react": "^17.0.0 || ^18.0.0"
},
"devDependencies": {
"@mui/internal-test-utils": "1.0.0",
"@mui/internal-test-utils": "https://pkg.csb.dev/mui/material-ui/commit/81f95747/@mui/internal-test-utils",
"rimraf": "^5.0.7"
},
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion packages/x-tree-view-pro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"react-dom": "^17.0.0 || ^18.0.0"
},
"devDependencies": {
"@mui/internal-test-utils": "1.0.0",
"@mui/internal-test-utils": "https://pkg.csb.dev/mui/material-ui/commit/81f95747/@mui/internal-test-utils",
"rimraf": "^5.0.7"
},
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion packages/x-tree-view/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"react-dom": "^17.0.0 || ^18.0.0"
},
"devDependencies": {
"@mui/internal-test-utils": "1.0.0",
"@mui/internal-test-utils": "https://pkg.csb.dev/mui/material-ui/commit/81f95747/@mui/internal-test-utils",
"@types/prop-types": "^15.7.12",
"rimraf": "^5.0.7"
},
Expand Down
47 changes: 24 additions & 23 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading