From cee7158e3d16685af3a2a3e712025045a6dd4ac6 Mon Sep 17 00:00:00 2001 From: dimovi91 <62511246+dimovi91@users.noreply.github.com> Date: Mon, 23 May 2022 13:21:46 +0200 Subject: [PATCH 01/15] Delete close-incomplete-inactive.yml --- .github/workflows/close-incomplete-inactive.yml | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 .github/workflows/close-incomplete-inactive.yml diff --git a/.github/workflows/close-incomplete-inactive.yml b/.github/workflows/close-incomplete-inactive.yml deleted file mode 100644 index dc2161108d3308..00000000000000 --- a/.github/workflows/close-incomplete-inactive.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Close incomplete inactive -on: - schedule: - - cron: "0 0 * * *" -jobs: - close-issues: - runs-on: ubuntu-latest - steps: - - name: Need more information - uses: actions-cool/issues-helper@v2 - with: - actions: 'close-issues' - labels: 'status: incomplete' - inactive-day: 7 - body: | - Since the issue is missing key information, and has been inactive for 7 days, it has been automatically closed. - If you wish to see the issue reopened, please provide the missing information. From b9c2b7b53f6ae2b9147be25ba050dda9c4d3d303 Mon Sep 17 00:00:00 2001 From: dimovi91 <62511246+dimovi91@users.noreply.github.com> Date: Mon, 23 May 2022 13:22:26 +0200 Subject: [PATCH 02/15] Create no-response.yml --- .github/workflows/no-response.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/no-response.yml diff --git a/.github/workflows/no-response.yml b/.github/workflows/no-response.yml new file mode 100644 index 00000000000000..027ef1805933c5 --- /dev/null +++ b/.github/workflows/no-response.yml @@ -0,0 +1,26 @@ +name: No Response + +# Both `issue_comment` and `scheduled` event types are required for this Action +# to work properly. +on: + issue_comment: + types: [created] + schedule: + # Schedule for five minutes after the hour, every hour + - cron: '5 * * * *' + +jobs: + noResponse: + runs-on: ubuntu-latest + steps: + - uses: lee-dohm/no-response@v0.5.0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + # Number of days of inactivity before an Issue is closed for lack of response + daysUntilClose: 7 + # Label requiring a response + responseRequiredLabel: needs more information + # Comment to post when closing an Issue for lack of response. Set to `false` to disable + closeComment: > + Since the issue is missing key information, and has been inactive for 7 days, it has been automatically closed. + If you wish to see the issue reopened, please provide the missing information. From 8cda2fbab87ffa6ebbc54db3f4986d3a0976bb2f Mon Sep 17 00:00:00 2001 From: dimovi91 <62511246+dimovi91@users.noreply.github.com> Date: Mon, 23 May 2022 13:28:58 +0200 Subject: [PATCH 03/15] Update no-response.yml --- .github/workflows/no-response.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/no-response.yml b/.github/workflows/no-response.yml index 027ef1805933c5..9287b32242818d 100644 --- a/.github/workflows/no-response.yml +++ b/.github/workflows/no-response.yml @@ -17,7 +17,7 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} # Number of days of inactivity before an Issue is closed for lack of response - daysUntilClose: 7 + daysUntilClose: 0.05 # Label requiring a response responseRequiredLabel: needs more information # Comment to post when closing an Issue for lack of response. Set to `false` to disable From d94cba139921edc53c163231ce3939f02aa6023f Mon Sep 17 00:00:00 2001 From: dimovi91 <62511246+dimovi91@users.noreply.github.com> Date: Mon, 23 May 2022 13:34:46 +0200 Subject: [PATCH 04/15] Update no-response.yml --- .github/workflows/no-response.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/no-response.yml b/.github/workflows/no-response.yml index 9287b32242818d..84c84352b37bc9 100644 --- a/.github/workflows/no-response.yml +++ b/.github/workflows/no-response.yml @@ -17,7 +17,7 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} # Number of days of inactivity before an Issue is closed for lack of response - daysUntilClose: 0.05 + daysUntilClose: 0.005 # Label requiring a response responseRequiredLabel: needs more information # Comment to post when closing an Issue for lack of response. Set to `false` to disable From b9cacb3c819b492e5910f2e03644541b47cc6c74 Mon Sep 17 00:00:00 2001 From: dimovi91 <62511246+dimovi91@users.noreply.github.com> Date: Mon, 23 May 2022 15:58:36 +0200 Subject: [PATCH 05/15] Rename the label --- .github/workflows/no-response.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/no-response.yml b/.github/workflows/no-response.yml index 84c84352b37bc9..59b08b07e80823 100644 --- a/.github/workflows/no-response.yml +++ b/.github/workflows/no-response.yml @@ -19,7 +19,7 @@ jobs: # Number of days of inactivity before an Issue is closed for lack of response daysUntilClose: 0.005 # Label requiring a response - responseRequiredLabel: needs more information + responseRequiredLabel: 'status: needs more information' # Comment to post when closing an Issue for lack of response. Set to `false` to disable closeComment: > Since the issue is missing key information, and has been inactive for 7 days, it has been automatically closed. From af5d9e33576f629d7d4e02ffe191538101a021d5 Mon Sep 17 00:00:00 2001 From: dimovi91 <62511246+dimovi91@users.noreply.github.com> Date: Tue, 24 May 2022 09:25:24 +0200 Subject: [PATCH 06/15] Update ci.yml --- .github/workflows/ci.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9fa599326287c6..5cd3a0a9884dfb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,12 +19,17 @@ jobs: os: [macos-latest, windows-latest, ubuntu-latest] steps: - run: echo "${{ github.actor }}" - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: # fetch all tags which are required for `yarn release:changelog` fetch-depth: 0 + - uses: mnajdova/github-action-required-labels@v2.0 + with: + mode: minimum + count: 1 + labels: "" - name: Use Node.js 14.x - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version: 14 cache: 'yarn' # https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#caching-packages-dependencies From 82d814efe4e9adb5ea69f82527dc2aaf2e437f87 Mon Sep 17 00:00:00 2001 From: dimovi91 <62511246+dimovi91@users.noreply.github.com> Date: Tue, 24 May 2022 09:40:54 +0200 Subject: [PATCH 07/15] Update ci.yml --- .github/workflows/ci.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5cd3a0a9884dfb..971598efed7668 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,6 +9,15 @@ on: pull_request: jobs: + test-label-applied: + # Tests that label is added on the PR + runs-on: ubuntu-latest + steps: + - uses: mnajdova/github-action-required-labels@v2.0 + with: + mode: minimum + count: 1 + labels: "" # Tests dev-only scripts across all supported dev environments test-dev: # l10nbot does not affect dev scripts. @@ -23,11 +32,6 @@ jobs: with: # fetch all tags which are required for `yarn release:changelog` fetch-depth: 0 - - uses: mnajdova/github-action-required-labels@v2.0 - with: - mode: minimum - count: 1 - labels: "" - name: Use Node.js 14.x uses: actions/setup-node@v3 with: From 675c8cf64653543d02fbfac3e714ba806cea8cf1 Mon Sep 17 00:00:00 2001 From: dimovi91 <62511246+dimovi91@users.noreply.github.com> Date: Tue, 24 May 2022 09:48:30 +0200 Subject: [PATCH 08/15] Update ci.yml --- .github/workflows/ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 971598efed7668..691cefaeeea934 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,12 +12,12 @@ jobs: test-label-applied: # Tests that label is added on the PR runs-on: ubuntu-latest - steps: - - uses: mnajdova/github-action-required-labels@v2.0 - with: - mode: minimum - count: 1 - labels: "" + steps: + - uses: mnajdova/github-action-required-labels@v2.0 + with: + mode: minimum + count: 1 + labels: "" # Tests dev-only scripts across all supported dev environments test-dev: # l10nbot does not affect dev scripts. From a72a7e5d7d7e7fda471199dafbb80fc7590bfa0b Mon Sep 17 00:00:00 2001 From: dimovi91 <62511246+dimovi91@users.noreply.github.com> Date: Tue, 24 May 2022 09:56:08 +0200 Subject: [PATCH 09/15] Update ci.yml --- .github/workflows/ci.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 691cefaeeea934..53c478968ea34d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,15 +9,6 @@ on: pull_request: jobs: - test-label-applied: - # Tests that label is added on the PR - runs-on: ubuntu-latest - steps: - - uses: mnajdova/github-action-required-labels@v2.0 - with: - mode: minimum - count: 1 - labels: "" # Tests dev-only scripts across all supported dev environments test-dev: # l10nbot does not affect dev scripts. From 20bdb0c8ac6a686912973690a54a6696d598709c Mon Sep 17 00:00:00 2001 From: dimovi91 <62511246+dimovi91@users.noreply.github.com> Date: Tue, 24 May 2022 09:59:04 +0200 Subject: [PATCH 10/15] Create check-label-added.yml --- .github/workflows/check-label-added.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/check-label-added.yml diff --git a/.github/workflows/check-label-added.yml b/.github/workflows/check-label-added.yml new file mode 100644 index 00000000000000..85024244f95234 --- /dev/null +++ b/.github/workflows/check-label-added.yml @@ -0,0 +1,19 @@ +name: Check if PR has label + +on: + push: + branches-ignore: + - 'renovate/**' + pull_request: + types: [opened, reopened, labeled, unlabeled] + +jobs: + test-label-applied: + # Tests that label is added on the PR + runs-on: ubuntu-latest + steps: + - uses: mnajdova/github-action-required-labels@v2.0 + with: + mode: minimum + count: 1 + labels: "" From bbde3ad6108ee009c8c9a929bdc9730e02153d5d Mon Sep 17 00:00:00 2001 From: dimovi91 <62511246+dimovi91@users.noreply.github.com> Date: Tue, 24 May 2022 10:04:15 +0200 Subject: [PATCH 11/15] Update check-label-added.yml --- .github/workflows/check-label-added.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/check-label-added.yml b/.github/workflows/check-label-added.yml index 85024244f95234..9717c6cc26a74f 100644 --- a/.github/workflows/check-label-added.yml +++ b/.github/workflows/check-label-added.yml @@ -1,9 +1,6 @@ name: Check if PR has label on: - push: - branches-ignore: - - 'renovate/**' pull_request: types: [opened, reopened, labeled, unlabeled] From f5168d1f876d402b74b41110beda7785876a363a Mon Sep 17 00:00:00 2001 From: Marija Najdova Date: Wed, 20 Jul 2022 11:23:59 +0200 Subject: [PATCH 12/15] initial commit --- .circleci/config.yml | 30 ++++++++++++++ scripts/use-react-version.js | 77 ++++++++++++++++++++++++++++++++++++ 2 files changed, 107 insertions(+) create mode 100644 scripts/use-react-version.js diff --git a/.circleci/config.yml b/.circleci/config.yml index c73cf39b0c9d81..e071b05d5b150b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,6 +11,10 @@ parameters: description: The dist-tag of react to be used type: string default: stable + react-specific-version: + description: The specific version of react to be used + type: string + default: '' workflow: description: The name of the workflow to run type: string @@ -26,6 +30,10 @@ defaults: &defaults description: The dist-tag of react to be used type: string default: << pipeline.parameters.react-dist-tag >> + react-specific-version: + description: The specific version of react to be used + type: string + default: << pipeline.parameters.react-specific-version >> test-gate: description: A particular type of tests that should be run type: string @@ -40,6 +48,7 @@ defaults: &defaults # 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_SPECIFIC_VERSION: << parameters.react-specific-version >> TEST_GATE: << parameters.test-gate >> AWS_REGION_ARTIFACTS: eu-central-1 working_directory: /tmp/material-ui @@ -75,6 +84,10 @@ commands: node scripts/use-react-dist-tag # log a patch for maintainers who want to check out this change git --no-pager diff HEAD + - run: + name: Resolve react specific version if set + command: | + node scripts/use-react-version - restore_cache: name: Restore yarn cache keys: @@ -822,6 +835,23 @@ workflows: equal: [profile, << pipeline.parameters.workflow >>] jobs: - test_profile + react-17: + triggers: + - schedule: + cron: '30 11 * * *' + filters: + branches: + only: + - master + jobs: + - test_unit: + react-specific-version: 17.0.2 + - test_browser: + react-specific-version: 17.0.2 + - test_regressions: + react-specific-version: 17.0.2 + - test_e2e: + react-specific-version: 17.0.2 react-next: triggers: - schedule: diff --git a/scripts/use-react-version.js b/scripts/use-react-version.js new file mode 100644 index 00000000000000..c8a270c9384cc9 --- /dev/null +++ b/scripts/use-react-version.js @@ -0,0 +1,77 @@ +/* eslint-disable no-console */ +/** + * Given the dist tag fetch the corresponding + * version and make sure this version is used throughout the repository. + * + * If you work on this file: + * WARNING: This script can only use built-in modules since it has to run before + * `yarn install` + */ +const fs = require('fs'); +const os = require('os'); +const path = require('path'); + +// packages published from the react monorepo per version +const versionsSupported = { + '17.0.2': { + react: '17.0.2', + 'react-dom': '17.0.2', + 'react-is': '17.0.2', + 'react-test-renderer': '17.0.2', + scheduler: '0.20.2', + }, +}; + +const devDependencies = { + '17.0.2': { + '@mnajdova/enzyme-adapter-react-18': 'npm:@eps1lon/enzyme-adapter-react-17', + '@testing-library/react': '12.1.5', + }, +}; + +async function main(options) { + const { reactVersion } = options; + + if (typeof reactVersion !== 'string') { + throw new TypeError(`expected reactVersion: string but got '${distTag}'`); + } + + if (reactVersion === '') { + // do nothing + return; + } + + if (!versionsSupported[reactVersion]) { + console.log( + `This version is not supported. This is the list of all supported versions: ${Object.keys( + versionsSupported, + )}`, + ); + return; + } + + const packageJsonPath = path.resolve(__dirname, '../package.json'); + const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, { encoding: 'utf8' })); + + const reactPackageNames = versionsSupported[reactVersion]; + + await Promise.all( + Object.keys(reactPackageNames).map(async (reactPackageName) => { + packageJson.resolutions[reactPackageName] = reactPackageNames[reactPackageName]; + }), + ); + + packageJson.devDependencies['@mnajdova/enzyme-adapter-react-18'] = + devDependencies[reactVersion]['@mnajdova/enzyme-adapter-react-18']; + packageJson.devDependencies['@testing-library/react'] = + devDependencies[reactVersion]['@testing-library/react']; + + // add newline for clean diff + fs.writeFileSync(packageJsonPath, `${JSON.stringify(packageJson, null, 2)}${os.EOL}`); +} + +const [reactVersion = process.env.REACT_SPECIFIC_VERSION] = process.argv.slice(2); +main({ reactVersion }).catch((error) => { + console.error(error); + process.exit(1); +}); From fca76a00155050f7d2692fca3902753923daa413 Mon Sep 17 00:00:00 2001 From: Marija Najdova Date: Wed, 20 Jul 2022 11:43:47 +0200 Subject: [PATCH 13/15] Fix lint --- .circleci/config.yml | 2 +- scripts/use-react-version.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e071b05d5b150b..fe5cbe0f93cd4a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -838,7 +838,7 @@ workflows: react-17: triggers: - schedule: - cron: '30 11 * * *' + cron: '0 12 * * *' filters: branches: only: diff --git a/scripts/use-react-version.js b/scripts/use-react-version.js index c8a270c9384cc9..641523750c19fb 100644 --- a/scripts/use-react-version.js +++ b/scripts/use-react-version.js @@ -33,7 +33,7 @@ async function main(options) { const { reactVersion } = options; if (typeof reactVersion !== 'string') { - throw new TypeError(`expected reactVersion: string but got '${distTag}'`); + throw new TypeError(`expected reactVersion: string but got '${reactVersion}'`); } if (reactVersion === '') { From f23a304879e45941f6444ae7aaa205f51081fbb9 Mon Sep 17 00:00:00 2001 From: Marija Najdova Date: Wed, 20 Jul 2022 11:50:06 +0200 Subject: [PATCH 14/15] add temporary branch for testing --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index fe5cbe0f93cd4a..b7cc41becc510b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -843,6 +843,7 @@ workflows: branches: only: - master + - core/add-react-17-night-build jobs: - test_unit: react-specific-version: 17.0.2 From 2ae8667983e6b2333fa932f4b3c83fe6a9e6b375 Mon Sep 17 00:00:00 2001 From: Marija Najdova Date: Wed, 20 Jul 2022 12:58:52 +0200 Subject: [PATCH 15/15] Change config --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b7cc41becc510b..624fb005b9c4ba 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -838,7 +838,7 @@ workflows: react-17: triggers: - schedule: - cron: '0 12 * * *' + cron: '10 13 * * *' filters: branches: only: