diff --git a/.github/workflows/cherry-pick.yml b/.github/workflows/cherry-pick.yml
index d9a22a4fb85..312ff9d6dcb 100644
--- a/.github/workflows/cherry-pick.yml
+++ b/.github/workflows/cherry-pick.yml
@@ -1,28 +1,28 @@
name: Cherry Pick Tool
on:
- issues:
- types: [milestoned, labeled]
- pull_request:
- types: [closed]
- workflow_dispatch:
- inputs:
- release_branch:
- description: Provide the release branch you want to cherry pick into. Example release/6.9
- default: ''
- required: true
- pull_requests:
- description: The pull request number.
- default: ''
- required: true
- skipSlackPing:
- description: "Skip Slack Ping: If true, the Slack ping will be skipped (useful for testing)"
- type: boolean
- required: false
- default: false
- slackChannelOverride:
- description: "Slack Channel Override: The channel ID to send the Slack ping about the code freeze violation"
- required: false
- default: ''
+ issues:
+ types: [milestoned, labeled]
+ pull_request:
+ types: [closed]
+ workflow_dispatch:
+ inputs:
+ release_branch:
+ description: Provide the release branch you want to cherry pick into. Example release/6.9
+ default: ''
+ required: true
+ pull_requests:
+ description: The pull request number.
+ default: ''
+ required: true
+ skipSlackPing:
+ description: 'Skip Slack Ping: If true, the Slack ping will be skipped (useful for testing)'
+ type: boolean
+ required: false
+ default: false
+ slackChannelOverride:
+ description: 'Slack Channel Override: The channel ID to send the Slack ping about the code freeze violation'
+ required: false
+ default: ''
env:
GIT_COMMITTER_NAME: 'WooCommerce Bot'
@@ -31,320 +31,321 @@ env:
GIT_AUTHOR_EMAIL: 'no-reply@woocommerce.com'
jobs:
- verify:
- name: Verify
- runs-on: ubuntu-20.04
- outputs:
- run: ${{ steps.check.outputs.run }}
- steps:
- - name: check
- id: check
- uses: actions/github-script@v6
- with:
- script: |
- let run = false;
+ verify:
+ name: Verify
+ runs-on: ubuntu-20.04
+ outputs:
+ run: ${{ steps.check.outputs.run }}
+ steps:
+ - name: check
+ id: check
+ uses: actions/github-script@v6
+ with:
+ script: |
+ let run = false;
- const isManualTrigger = context.payload.inputs && context.payload.inputs.release_branch && context.payload.inputs.release_branch != null;
-
- const isMergedMilestonedIssue = context.payload.issue && context.payload.issue.pull_request != null && context.payload.issue.pull_request.merged_at != null && context.payload.issue.milestone != null;
-
- const isMergedMilestonedPR = context.payload.pull_request && context.payload.pull_request != null && context.payload.pull_request.merged == true && context.payload.pull_request.milestone != null;
+ const isManualTrigger = context.payload.inputs && context.payload.inputs.release_branch && context.payload.inputs.release_branch != null;
- const isBot = context.payload.pull_request && ( context.payload.pull_request.user.login == 'github-actions[bot]' || context.payload.pull_request.user.type == 'Bot' );
+ const isMergedMilestonedIssue = context.payload.issue && context.payload.issue.pull_request != null && context.payload.issue.pull_request.merged_at != null && context.payload.issue.milestone != null;
- if ( !isBot && ( isManualTrigger || isMergedMilestonedIssue || isMergedMilestonedPR ) ) {
- console.log( "::set-output name=run::true" );
- } else {
- console.log( "::set-output name=run::false" );
- }
- prep:
- name: Prep inputs
- runs-on: ubuntu-20.04
- needs: verify
- if: needs.verify.outputs.run == 'true'
- outputs:
- release: ${{ steps.prep-inputs.outputs.release }}
- pr: ${{ steps.prep-inputs.outputs.pr }}
- version: ${{ steps.prep-inputs.outputs.version }}
- steps:
- - name: Prep inputs
- id: prep-inputs
- uses: actions/github-script@v6
- with:
- script: |
- const event = ${{ toJSON( github.event ) }}
+ const isMergedMilestonedPR = context.payload.pull_request && context.payload.pull_request != null && context.payload.pull_request.merged == true && context.payload.pull_request.milestone != null;
- // Means this workflow was triggered manually.
- if ( event.inputs && event.inputs.release_branch ) {
- const releaseBranch = '${{ inputs.release_branch }}'
- const version = releaseBranch.replace( 'release/', '' );
+ const isBot = context.payload.pull_request && ( context.payload.pull_request.user.login == 'github-actions[bot]' || context.payload.pull_request.user.type == 'Bot' );
- console.log( "::set-output name=version::" + version )
- console.log( "::set-output name=release::${{ inputs.release_branch }}" )
- } else if ( event.action === 'milestoned' ) {
- const version = '${{ github.event.issue.milestone.title }}'
- const release = version.substring( 0, 3 )
+ if ( !isBot && ( isManualTrigger || isMergedMilestonedIssue || isMergedMilestonedPR ) ) {
+ core.setOutput( 'run', 'true' );
+ } else {
+ core.setOutput( 'run', 'false' );
+ }
+ prep:
+ name: Prep inputs
+ runs-on: ubuntu-20.04
+ needs: verify
+ if: needs.verify.outputs.run == 'true'
+ outputs:
+ release: ${{ steps.prep-inputs.outputs.release }}
+ pr: ${{ steps.prep-inputs.outputs.pr }}
+ version: ${{ steps.prep-inputs.outputs.version }}
+ steps:
+ - name: Prep inputs
+ id: prep-inputs
+ uses: actions/github-script@v6
+ with:
+ script: |
+ const event = ${{ toJSON( github.event ) }}
- console.log( "::set-output name=version::" + version )
- console.log( "::set-output name=release::release/" + release )
- } else {
- const version = '${{ github.event.pull_request.milestone.title }}'
- const release = version.substring( 0, 3 )
+ // Means this workflow was triggered manually.
+ if ( event.inputs && event.inputs.release_branch ) {
+ const releaseBranch = '${{ inputs.release_branch }}'
+ const version = releaseBranch.replace( 'release/', '' )
- console.log( "::set-output name=version::" + version )
- console.log( "::set-output name=release::release/" + release )
- }
+ core.setOutput( 'version', version )
+ core.setOutput( 'release', releaseBranch )
+ } else if ( event.action === 'milestoned' ) {
+ const version = '${{ github.event.issue.milestone.title }}'
+ const release = version.substring( 0, 3 )
- // Means this workflow was triggered manually.
- if ( event.inputs && event.inputs.pull_requests ) {
- console.log( "::set-output name=pr::${{ inputs.pull_requests }}" )
- } else if ( event.action === 'milestoned' ) {
- console.log( "::set-output name=pr::${{ github.event.issue.number }}" )
- } else {
- console.log( "::set-output name=pr::${{ github.event.pull_request.number }}" )
- }
- check-release-branch-exists:
- name: Check for existence of release branch
- runs-on: ubuntu-20.04
- needs: prep
- steps:
- - name: Check for release branch
- id: release-breanch-check
- uses: actions/github-script@v6
- with:
- script: |
- // This will throw an error for non-200 responses, which prevents subsequent jobs from completing, as desired.
- await github.request( 'GET /repos/{owner}/{repo}/branches/{branch}', {
- owner: context.repo.owner,
- repo: context.repo.repo,
- branch: '${{ needs.prep.outputs.release }}',
- } );
- cherry-pick-run:
- name: Run cherry pick tool
- runs-on: ubuntu-20.04
- needs: [ prep, check-release-branch-exists ]
- if: success()
- steps:
- - name: Checkout release branch
- uses: actions/checkout@v3
- with:
- fetch-depth: 0
+ core.setOutput( 'version', version )
+ core.setOutput( 'release', `release/${release}` )
+ } else {
+ const version = '${{ github.event.pull_request.milestone.title }}'
+ const release = version.substring( 0, 3 )
- - name: Git fetch the release branch
- run: git fetch origin ${{ needs.prep.outputs.release }}
-
- - name: Checkout release branch
- run: git checkout ${{ needs.prep.outputs.release }}
-
- - name: Create a cherry pick branch based on release branch
- run: git checkout -b cherry-pick-${{ needs.prep.outputs.version }}/${{ needs.prep.outputs.pr }}
-
- - name: Get commit sha from PR
- id: commit-sha
- uses: actions/github-script@v6
- with:
- script: |
- const pr = await github.rest.pulls.get({
- owner: context.repo.owner,
- repo: context.repo.repo,
- pull_number: '${{ needs.prep.outputs.pr }}'
- })
-
- console.log( `::set-output name=sha::${ pr.data.merge_commit_sha }` )
-
- - name: Cherry pick
- run: |
- git cherry-pick ${{ steps.commit-sha.outputs.sha }}
-
- - name: Generate changelog
- id: changelog
- uses: actions/github-script@v6
- with:
- script: |
- const fs = require( 'node:fs' );
-
- const changelogsToBeDeleted = []
- let changelogTxt = '';
-
- const commit = await github.rest.repos.getCommit({
- owner: context.repo.owner,
- repo: context.repo.repo,
- ref: '${{ steps.commit-sha.outputs.sha }}'
- })
-
- for ( const file of commit.data.files ) {
- if ( file.filename.match( 'plugins/woocommerce/changelog/' ) ) {
- if ( changelogsToBeDeleted.indexOf( file.filename ) === -1 ) {
- changelogsToBeDeleted.push( file.filename );
- }
-
- let changelogEntry = '';
- let changelogEntryType = '';
-
- fs.readFile( './' + file.filename, 'utf-8', function( err, data ) {
- if ( err ) {
- console.error( err );
- }
-
- const changelogEntryArr = data.split( "\n" );
- changelogEntryType = data.match( /Type: (.+)/i );
- changelogEntryType = changelogEntryType[ 1 ].charAt( 0 ).toUpperCase() + changelogEntryType[ 1 ].slice( 1 );
-
- changelogEntry = changelogEntryArr.filter( el => {
- return el !== null && typeof el !== 'undefined' && el !== '';
- } );
- changelogEntry = changelogEntry[ changelogEntry.length - 1 ];
-
- // Check if changelogEntry is what we want.
- if ( changelogEntry.length < 1 ) {
- changelogEntry = false;
- }
-
- if ( changelogEntry.match( /significance:/i ) ) {
- changelogEntry = false;
- }
-
- if ( changelogEntry.match( /type:/i ) ) {
- changelogEntry = false;
- }
-
- if ( changelogEntry.match( /comment:/i ) ) {
- changelogEntry = false;
- }
-
- if ( ! changelogEntry ) {
- return;
- }
-
- fs.readFile( './plugins/woocommerce/readme.txt', 'utf-8', function( err, data ) {
- if ( err ) {
- console.error( err );
- }
-
- changelogTxt = data.split( "\n" );
- let isInRange = false;
- let newChangelogTxt = [];
-
- for ( const line of changelogTxt ) {
- if ( isInRange === false && line === '== Changelog ==' ) {
- isInRange = true;
+ core.setOutput( 'version', version )
+ core.setOutput( 'release', `release/${release}` )
}
- if ( isInRange === true && line.match( /\*\*WooCommerce Blocks/ ) ) {
- isInRange = false;
+ // Means this workflow was triggered manually.
+ if ( event.inputs && event.inputs.pull_requests ) {
+ core.setOutput( 'pr', '${{ inputs.pull_requests }}' )
+ } else if ( event.action === 'milestoned' ) {
+ core.setOutput( 'pr', '${{ github.event.issue.number }}' )
+ } else {
+ core.setOutput( 'pr', '${{ github.event.pull_request.number }}' )
+ }
+ check-release-branch-exists:
+ name: Check for existence of release branch
+ runs-on: ubuntu-20.04
+ needs: prep
+ steps:
+ - name: Check for release branch
+ id: release-breanch-check
+ uses: actions/github-script@v6
+ with:
+ script: |
+ // This will throw an error for non-200 responses, which prevents subsequent jobs from completing, as desired.
+ await github.request( 'GET /repos/{owner}/{repo}/branches/{branch}', {
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ branch: '${{ needs.prep.outputs.release }}',
+ } );
+ cherry-pick-run:
+ name: Run cherry pick tool
+ runs-on: ubuntu-20.04
+ needs: [prep, check-release-branch-exists]
+ if: success()
+ steps:
+ - name: Checkout release branch
+ uses: actions/checkout@v3
+ with:
+ fetch-depth: 0
+
+ - name: Git fetch the release branch
+ run: git fetch origin ${{ needs.prep.outputs.release }}
+
+ - name: Checkout release branch
+ run: git checkout ${{ needs.prep.outputs.release }}
+
+ - name: Create a cherry pick branch based on release branch
+ run: git checkout -b cherry-pick-${{ needs.prep.outputs.version }}/${{ needs.prep.outputs.pr }}
+
+ - name: Get commit sha from PR
+ id: commit-sha
+ uses: actions/github-script@v6
+ with:
+ script: |
+ const pr = await github.rest.pulls.get({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ pull_number: '${{ needs.prep.outputs.pr }}'
+ })
+
+ core.setOutput( 'sha', pr.data.merge_commit_sha )
+
+ - name: Cherry pick
+ run: |
+ git cherry-pick ${{ steps.commit-sha.outputs.sha }} -m1
+
+ - name: Generate changelog
+ id: changelog
+ uses: actions/github-script@v6
+ with:
+ script: |
+ const fs = require( 'node:fs' );
+
+ const changelogsToBeDeleted = []
+ let changelogTxt = '';
+
+ const commit = await github.rest.repos.getCommit({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ ref: '${{ steps.commit-sha.outputs.sha }}'
+ })
+
+ for ( const file of commit.data.files ) {
+ if ( file.filename.match( 'plugins/woocommerce/changelog/' ) ) {
+ if ( changelogsToBeDeleted.indexOf( file.filename ) === -1 ) {
+ changelogsToBeDeleted.push( file.filename );
+ }
+
+ let changelogEntry = '';
+ let changelogEntryType = '';
+
+ fs.readFile( './' + file.filename, 'utf-8', function( err, data ) {
+ if ( err ) {
+ console.error( err );
+ }
+
+ const changelogEntryArr = data.split( "\n" );
+ changelogEntryType = data.match( /Type: (.+)/i );
+ changelogEntryType = changelogEntryType[ 1 ].charAt( 0 ).toUpperCase() + changelogEntryType[ 1 ].slice( 1 );
+
+ changelogEntry = changelogEntryArr.filter( el => {
+ return el !== null && typeof el !== 'undefined' && el !== '';
+ } );
+ changelogEntry = changelogEntry[ changelogEntry.length - 1 ];
+
+ // Check if changelogEntry is what we want.
+ if ( changelogEntry.length < 1 ) {
+ changelogEntry = false;
+ }
+
+ if ( changelogEntry.match( /significance:/i ) ) {
+ changelogEntry = false;
+ }
+
+ if ( changelogEntry.match( /type:/i ) ) {
+ changelogEntry = false;
+ }
+
+ if ( changelogEntry.match( /comment:/i ) ) {
+ changelogEntry = false;
+ }
+
+ if ( ! changelogEntry ) {
+ return;
+ }
+
+ fs.readFile( './plugins/woocommerce/readme.txt', 'utf-8', function( err, data ) {
+ if ( err ) {
+ console.error( err );
+ }
+
+ changelogTxt = data.split( "\n" );
+ let isInRange = false;
+ let newChangelogTxt = [];
+
+ for ( const line of changelogTxt ) {
+ if ( isInRange === false && line === '== Changelog ==' ) {
+ isInRange = true;
+ }
+
+ if ( isInRange === true && line.match( /\*\*WooCommerce Blocks/ ) ) {
+ isInRange = false;
+ }
+
+ // Find the first match of the entry "Type".
+ if ( isInRange && line.match( `\\* ${changelogEntryType} -` ) ) {
+ newChangelogTxt.push( '* ' + changelogEntryType + ' - ' + changelogEntry + ` [#${{ needs.prep.outputs.pr }}](https://github.com/woocommerce/woocommerce/pull/${{ needs.prep.outputs.pr }})` );
+ newChangelogTxt.push( line );
+ isInRange = false;
+ continue;
+ }
+
+ newChangelogTxt.push( line );
+ }
+
+ fs.writeFile( './plugins/woocommerce/readme.txt', newChangelogTxt.join( "\n" ), err => {
+ if ( err ) {
+ console.error( `Unable to generate the changelog entry for PR ${{ needs.prep.outputs.pr }}` );
+ }
+ } );
+ } );
+ } );
+ }
}
- // Find the first match of the entry "Type".
- if ( isInRange && line.match( `\\* ${changelogEntryType} -` ) ) {
- newChangelogTxt.push( '* ' + changelogEntryType + ' - ' + changelogEntry + ` [#${{ needs.prep.outputs.pr }}](https://github.com/woocommerce/woocommerce/pull/${{ needs.prep.outputs.pr }})` );
- newChangelogTxt.push( line );
- isInRange = false;
- continue;
- }
+ core.setOutput( 'changelogsToBeDeleted', changelogsToBeDeleted.join( ' ' ) )
- newChangelogTxt.push( line );
- }
+ - name: Delete changelog files from cherry pick branch
+ if: steps.changelog.outputs.changelogsToBeDeleted != '' && steps.changelog.outputs.changelogsToBeDeleted != null
+ run: git rm ${{ steps.changelog.outputs.changelogsToBeDeleted }}
- fs.writeFile( './plugins/woocommerce/readme.txt', newChangelogTxt.join( "\n" ), err => {
- if ( err ) {
- console.error( `Unable to generate the changelog entry for PR ${{ needs.prep.outputs.pr }}` );
- }
- } );
- } );
- } );
- }
- }
+ - name: Commit changes for cherry pick
+ if: steps.changelog.outputs.changelogsToBeDeleted != '' && steps.changelog.outputs.changelogsToBeDeleted != null
+ run: git commit --no-verify -am "Prep for cherry pick ${{ needs.prep.outputs.pr }}"
- console.log( `::set-output name=changelogsToBeDeleted::${ changelogsToBeDeleted }` )
+ - name: Push cherry pick branch up
+ run: git push origin cherry-pick-${{ needs.prep.outputs.version }}/${{ needs.prep.outputs.pr }}
- - name: Delete changelog files from cherry pick branch
- if: steps.changelog.outputs.changelogsToBeDeleted != '' && steps.changelog.outputs.changelogsToBeDeleted != null
- run: git rm ${{ steps.changelog.outputs.changelogsToBeDeleted }}
+ - name: Create the PR for cherry pick branch
+ id: cherry-pick-pr
+ uses: actions/github-script@v6
+ with:
+ script: |
+ let cherryPickPRBody = "This PR cherry-picks the following PRs into the release branch:\n";
- - name: Commit changes for cherry pick
- if: steps.changelog.outputs.changelogsToBeDeleted != '' && steps.changelog.outputs.changelogsToBeDeleted != null
- run: git commit --no-verify -am "Prep for cherry pick ${{ needs.prep.outputs.pr }}"
+ cherryPickPRBody = `${cherryPickPRBody}` + `* #${{ needs.prep.outputs.pr }}` + "\n";
- - name: Push cherry pick branch up
- run: git push origin cherry-pick-${{ needs.prep.outputs.version }}/${{ needs.prep.outputs.pr }}
+ const pr = await github.rest.pulls.create({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ title: "Cherry pick ${{ needs.prep.outputs.pr }} into ${{ needs.prep.outputs.release }}",
+ head: "cherry-pick-${{ needs.prep.outputs.version }}/${{ needs.prep.outputs.pr }}",
+ base: "${{ needs.prep.outputs.release }}",
+ body: cherryPickPRBody
+ })
- - name: Create the PR for cherry pick branch
- id: cherry-pick-pr
- uses: actions/github-script@v6
- with:
- script: |
- let cherryPickPRBody = "This PR cherry-picks the following PRs into the release branch:\n";
+ core.setOutput( 'cherry-pick-pr', pr.data.html_url )
- cherryPickPRBody = `${cherryPickPRBody}` + `* #${{ needs.prep.outputs.pr }}` + "\n";
+ - name: Checkout trunk branch
+ if: steps.changelog.outputs.changelogsToBeDeleted != '' && steps.changelog.outputs.changelogsToBeDeleted != null
+ run: git checkout trunk
- const pr = await github.rest.pulls.create({
- owner: context.repo.owner,
- repo: context.repo.repo,
- title: "Cherry pick ${{ needs.prep.outputs.pr }} into ${{ needs.prep.outputs.release }}",
- head: "cherry-pick-${{ needs.prep.outputs.version }}/${{ needs.prep.outputs.pr }}",
- base: "${{ needs.prep.outputs.release }}",
- body: cherryPickPRBody
- })
+ - name: Create a branch based on trunk branch
+ if: steps.changelog.outputs.changelogsToBeDeleted != '' && steps.changelog.outputs.changelogsToBeDeleted != null
+ run: git checkout -b delete-changelogs/${{ needs.prep.outputs.pr }}
- console.log( `::set-output name=cherry-pick-pr::${ pr.data.html_url }` )
- - name: Checkout trunk branch
- if: steps.changelog.outputs.changelogsToBeDeleted != '' && steps.changelog.outputs.changelogsToBeDeleted != null
- run: git checkout trunk
+ - name: Delete changelogs from trunk
+ if: steps.changelog.outputs.changelogsToBeDeleted != '' && steps.changelog.outputs.changelogsToBeDeleted != null
+ run: git rm ${{ steps.changelog.outputs.changelogsToBeDeleted }}
- - name: Create a branch based on trunk branch
- if: steps.changelog.outputs.changelogsToBeDeleted != '' && steps.changelog.outputs.changelogsToBeDeleted != null
- run: git checkout -b delete-changelogs/${{ needs.prep.outputs.pr }}
+ - name: Commit changes for deletion
+ if: steps.changelog.outputs.changelogsToBeDeleted != '' && steps.changelog.outputs.changelogsToBeDeleted != null
+ run: git commit --no-verify -am "Delete changelog files for ${{ needs.prep.outputs.pr }}"
- - name: Delete changelogs from trunk
- if: steps.changelog.outputs.changelogsToBeDeleted != '' && steps.changelog.outputs.changelogsToBeDeleted != null
- run: git rm ${{ steps.changelog.outputs.changelogsToBeDeleted }}
+ - name: Push deletion branch up
+ if: steps.changelog.outputs.changelogsToBeDeleted != '' && steps.changelog.outputs.changelogsToBeDeleted != null
+ run: git push origin delete-changelogs/${{ needs.prep.outputs.pr }}
- - name: Commit changes for deletion
- if: steps.changelog.outputs.changelogsToBeDeleted != '' && steps.changelog.outputs.changelogsToBeDeleted != null
- run: git commit --no-verify -am "Delete changelog files for ${{ needs.prep.outputs.pr }}"
+ - name: Create the PR for deletion branch
+ id: deletion-pr
+ if: steps.changelog.outputs.changelogsToBeDeleted != '' && steps.changelog.outputs.changelogsToBeDeleted != null
+ uses: actions/github-script@v6
+ with:
+ script: |
+ const pr = await github.rest.pulls.create({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ title: "Delete changelog files based on PR ${{ needs.prep.outputs.pr }}",
+ head: "delete-changelogs/${{ needs.prep.outputs.pr }}",
+ base: "trunk",
+ body: "Delete changelog files based on PR #${{ needs.prep.outputs.pr }}"
+ })
- - name: Push deletion branch up
- if: steps.changelog.outputs.changelogsToBeDeleted != '' && steps.changelog.outputs.changelogsToBeDeleted != null
- run: git push origin delete-changelogs/${{ needs.prep.outputs.pr }}
+ core.setOutput( 'deletion-pr', pr.data.html_url )
- - name: Create the PR for deletion branch
- id: deletion-pr
- if: steps.changelog.outputs.changelogsToBeDeleted != '' && steps.changelog.outputs.changelogsToBeDeleted != null
- uses: actions/github-script@v6
- with:
- script: |
- const pr = await github.rest.pulls.create({
- owner: context.repo.owner,
- repo: context.repo.repo,
- title: "Delete changelog files based on PR ${{ needs.prep.outputs.pr }}",
- head: "delete-changelogs/${{ needs.prep.outputs.pr }}",
- base: "trunk",
- body: "Delete changelog files based on PR #${{ needs.prep.outputs.pr }}"
- })
+ - name: Notify Slack on failure
+ if: ${{ failure() && inputs.skipSlackPing != true }}
+ uses: archive/github-actions-slack@v2.0.0
+ with:
+ slack-bot-user-oauth-access-token: ${{ secrets.CODE_FREEZE_BOT_TOKEN }}
+ slack-channel: ${{ inputs.slackChannelOverride || secrets.WOO_RELEASE_SLACK_CHANNEL }}
+ slack-text: |
+ :warning-8c: Code freeze violation. PR(s) created that breaks the Code Freeze for '${{ needs.prep.outputs.release }}' :ice_cube:
- console.log( `::set-output name=deletion-pr::${ pr.data.html_url }` )
+ An attempt to cherry pick PR(s) into outgoing release '${{ needs.prep.outputs.release }}' has failed. This could be due to a merge conflict or something else that requires manual attention. Please check: https://github.com/woocommerce/woocommerce/pull/${{ needs.prep.outputs.pr }}
- - name: Notify Slack on failure
- if: ${{ failure() && inputs.skipSlackPing != true }}
- uses: archive/github-actions-slack@v2.0.0
- with:
- slack-bot-user-oauth-access-token: ${{ secrets.CODE_FREEZE_BOT_TOKEN }}
- slack-channel: ${{ inputs.slackChannelOverride || secrets.WOO_RELEASE_SLACK_CHANNEL }}
- slack-text: |
- :warning-8c: Code freeze violation. PR(s) created that breaks the Code Freeze for '${{ needs.prep.outputs.release }}' :ice_cube:
+ - name: Notify Slack on success
+ if: ${{ success() && inputs.skipSlackPing != true }}
+ uses: archive/github-actions-slack@v2.0.0
+ with:
+ slack-bot-user-oauth-access-token: ${{ secrets.CODE_FREEZE_BOT_TOKEN }}
+ slack-channel: ${{ inputs.slackChannelOverride || secrets.WOO_RELEASE_SLACK_CHANNEL }}
+ slack-text: |
+ :warning-8c: Code freeze violation. PR(s) created that breaks the Code Freeze for '${{ needs.prep.outputs.release }}' :ice_cube:
- An attempt to cherry pick PR(s) into outgoing release '${{ needs.prep.outputs.release }}' has failed. This could be due to a merge conflict or something else that requires manual attention. Please check: https://github.com/woocommerce/woocommerce/pull/${{ needs.prep.outputs.pr }}
+ Release lead please review:
- - name: Notify Slack on success
- if: ${{ success() && inputs.skipSlackPing != true }}
- uses: archive/github-actions-slack@v2.0.0
- with:
- slack-bot-user-oauth-access-token: ${{ secrets.CODE_FREEZE_BOT_TOKEN }}
- slack-channel: ${{ inputs.slackChannelOverride || secrets.WOO_RELEASE_SLACK_CHANNEL }}
- slack-text: |
- :warning-8c: Code freeze violation. PR(s) created that breaks the Code Freeze for '${{ needs.prep.outputs.release }}' :ice_cube:
-
- Release lead please review:
-
- ${{ steps.cherry-pick-pr.outputs.cherry-pick-pr }}
- ${{ steps.deletion-pr.outputs.deletion-pr }}
+ ${{ steps.cherry-pick-pr.outputs.cherry-pick-pr }}
+ ${{ steps.deletion-pr.outputs.deletion-pr }}
diff --git a/.github/workflows/community-label.yml b/.github/workflows/community-label.yml
index 221753b62e3..6856aec116f 100644
--- a/.github/workflows/community-label.yml
+++ b/.github/workflows/community-label.yml
@@ -1,38 +1,40 @@
name: Add Community Label
on:
- pull_request_target:
- types: [opened]
- issues:
- types: [opened]
-
+ pull_request_target:
+ types: [opened]
+ issues:
+ types: [opened]
-concurrency:
- group: ${{ github.workflow }}-${{ github.ref }}
- cancel-in-progress: true
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
jobs:
- verify:
- name: Verify
- runs-on: ubuntu-20.04
- steps:
- - uses: actions/checkout@v3
+ verify:
+ name: Verify
+ runs-on: ubuntu-20.04
+ steps:
+ - uses: actions/checkout@v3
- - name: Setup Node.js
- uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93
+ - name: Setup Node.js
+ uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93
- - name: Install Octokit
- run: npm --prefix .github/workflows/scripts install @octokit/action
+ - name: Install Octokit
+ run: npm --prefix .github/workflows/scripts install @octokit/action
- - name: Check if user is a community contributor
- id: check
- run: node .github/workflows/scripts/is-community-contributor.js
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-
- - name: "If community PR, assign a reviewer"
- if: github.event.pull_request && steps.check.outputs.is-community == 'yes'
- uses: shufo/auto-assign-reviewer-by-files@f5f3db9ef06bd72ab6978996988c6462cbdaabf6
- with:
- config: ".github/project-community-pr-assigner.yml"
- token: ${{ secrets.PR_ASSIGN_TOKEN }}
+ - name: Install Actions Core
+ run: npm --prefix .github/workflows/scripts install @actions/core
+
+ - name: Check if user is a community contributor
+ id: check
+ run: node .github/workflows/scripts/is-community-contributor.js
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: 'If community PR, assign a reviewer'
+ if: github.event.pull_request && steps.check.outputs.is-community == 'yes'
+ uses: shufo/auto-assign-reviewer-by-files@f5f3db9ef06bd72ab6978996988c6462cbdaabf6
+ with:
+ config: '.github/project-community-pr-assigner.yml'
+ token: ${{ secrets.PR_ASSIGN_TOKEN }}
diff --git a/.github/workflows/post-release.yml b/.github/workflows/post-release.yml
index c9454db35ef..7ed2c418986 100644
--- a/.github/workflows/post-release.yml
+++ b/.github/workflows/post-release.yml
@@ -1,7 +1,7 @@
name: Run post release processes
-on:
- release:
- types: [released]
+on:
+ release:
+ types: [released]
env:
GIT_COMMITTER_NAME: 'WooCommerce Bot'
@@ -10,119 +10,119 @@ env:
GIT_AUTHOR_EMAIL: 'no-reply@woocommerce.com'
jobs:
- changelog-version-update:
- name: Update changelog and version
- runs-on: ubuntu-20.04
- steps:
- - uses: actions/checkout@v3
+ changelog-version-update:
+ name: Update changelog and version
+ runs-on: ubuntu-20.04
+ steps:
+ - uses: actions/checkout@v3
- - name: Git fetch trunk branch
- run: git fetch origin trunk
+ - name: Git fetch trunk branch
+ run: git fetch origin trunk
- - name: Copy readme.txt to vm root
- run: cp ./plugins/woocommerce/readme.txt ../../readme.txt
+ - name: Copy readme.txt to vm root
+ run: cp ./plugins/woocommerce/readme.txt ../../readme.txt
- - name: Switch to trunk branch
- run: git checkout trunk
+ - name: Switch to trunk branch
+ run: git checkout trunk
- - name: Create a new branch based on trunk
- run: git checkout -b prep/post-release-tasks-${{ github.event.release.tag_name }}
+ - name: Create a new branch based on trunk
+ run: git checkout -b prep/post-release-tasks-${{ github.event.release.tag_name }}
- - name: Check if we need to continue processing
- uses: actions/github-script@v6
- id: check
- with:
- script: |
- const fs = require( 'node:fs' );
- const version = ${{ toJSON( github.event.release.tag_name ) }}
+ - name: Check if we need to continue processing
+ uses: actions/github-script@v6
+ id: check
+ with:
+ script: |
+ const fs = require( 'node:fs' );
+ const version = ${{ toJSON( github.event.release.tag_name ) }}
- fs.readFile( './plugins/woocommerce/readme.txt', 'utf-8', function( err, data ) {
- if ( err ) {
- console.error( err );
- }
+ fs.readFile( './plugins/woocommerce/readme.txt', 'utf-8', function( err, data ) {
+ if ( err ) {
+ console.error( err );
+ }
- const regex = /Stable\stag:\s(\d+\.\d+\.\d+)/;
+ const regex = /Stable\stag:\s(\d+\.\d+\.\d+)/;
- const stableVersion = data.match( regex )[1];
+ const stableVersion = data.match( regex )[1];
- // If the release version is less than stable version we can bail.
- if ( version.localeCompare( stableVersion, undefined, { numeric: true, sensitivity: 'base' } ) == -1 ) {
- console.log( 'Release version is less than stable version. No automated action taken. A manual process is required.' );
- console.log( `::set-output name=continue::false` )
- return;
- } else {
- console.log( `::set-output name=continue::true` )
- }
- } )
+ // If the release version is less than stable version we can bail.
+ if ( version.localeCompare( stableVersion, undefined, { numeric: true, sensitivity: 'base' } ) == -1 ) {
+ console.log( 'Release version is less than stable version. No automated action taken. A manual process is required.' );
+ core.setOutput( 'continue', 'false' )
+ return;
+ } else {
+ core.setOutput( 'continue', 'true' )
+ }
+ } )
- - name: Update changelog.txt entries
- uses: actions/github-script@v6
- id: update-entries
- if: steps.check.outputs.continue == 'true'
- with:
- script: |
- const fs = require( 'node:fs' );
- const version = ${{ toJSON( github.event.release.tag_name ) }}
+ - name: Update changelog.txt entries
+ uses: actions/github-script@v6
+ id: update-entries
+ if: steps.check.outputs.continue == 'true'
+ with:
+ script: |
+ const fs = require( 'node:fs' );
+ const version = ${{ toJSON( github.event.release.tag_name ) }}
- // Read the saved readme.txt file from earlier.
- fs.readFile( '../../readme.txt', 'utf-8', function( err, readme ) {
- if ( err ) {
- console.log( `::set-output name=continue::false` )
- console.error( err );
- }
+ // Read the saved readme.txt file from earlier.
+ fs.readFile( '../../readme.txt', 'utf-8', function( err, readme ) {
+ if ( err ) {
+ core.setOutput( 'continue', 'false' );
+ console.error( err );
+ }
- const regex = /(== Changelog ==[\s\S]+)\s{2}\[See changelog for all versions\]\(https:\/\/raw\.githubusercontent\.com\/woocommerce\/woocommerce\/trunk\/changelog\.txt\)\./;
+ const regex = /(== Changelog ==[\s\S]+)\s{2}\[See changelog for all versions\]\(https:\/\/raw\.githubusercontent\.com\/woocommerce\/woocommerce\/trunk\/changelog\.txt\)\./;
- const entries = readme.match( regex )[1];
+ const entries = readme.match( regex )[1];
- fs.readFile( './changelog.txt', 'utf-8', function( err, changelog ) {
- if ( err ) {
- console.log( `::set-output name=continue::false` )
- console.error( err );
- }
+ fs.readFile( './changelog.txt', 'utf-8', function( err, changelog ) {
+ if ( err ) {
+ core.setOutput( 'continue', 'false' );
+ console.error( err );
+ }
- const regex = /== Changelog ==/;
+ const regex = /== Changelog ==/;
- const updatedChangelog = changelog.replace( regex, entries );
+ const updatedChangelog = changelog.replace( regex, entries );
- fs.writeFile( './changelog.txt', updatedChangelog, err => {
- if ( err ) {
- console.log( `::set-output name=continue::false` )
- console.error( 'Unable to update changelog entries in changelog.txt' );
- }
+ fs.writeFile( './changelog.txt', updatedChangelog, err => {
+ if ( err ) {
+ core.setOutput( 'continue', 'false' );
+ console.error( 'Unable to update changelog entries in changelog.txt' );
+ }
- console.log( `::set-output name=continue::true` )
- } )
- } )
- } )
+ core.setOutput( 'continue', 'true' );
+ } )
+ } )
+ } )
- - name: Commit changes
- if: steps.update-entries.outputs.continue == 'true'
- run: git commit -am "Prep trunk post release ${{ github.event.release.tag_name }}"
+ - name: Commit changes
+ if: steps.update-entries.outputs.continue == 'true'
+ run: git commit -am "Prep trunk post release ${{ github.event.release.tag_name }}"
- - name: Push branch up
- if: steps.update-entries.outputs.continue == 'true'
- run: git push origin prep/post-release-tasks-${{ github.event.release.tag_name }}
+ - name: Push branch up
+ if: steps.update-entries.outputs.continue == 'true'
+ run: git push origin prep/post-release-tasks-${{ github.event.release.tag_name }}
- - name: Create the PR
- if: steps.update-entries.outputs.continue == 'true'
- uses: actions/github-script@v6
- with:
- script: |
- const body = "This PR updates the changelog.txt entries based on the latest release: ${{ github.event.release.tag_name }}"
+ - name: Create the PR
+ if: steps.update-entries.outputs.continue == 'true'
+ uses: actions/github-script@v6
+ with:
+ script: |
+ const body = "This PR updates the changelog.txt entries based on the latest release: ${{ github.event.release.tag_name }}"
- const pr = await github.rest.pulls.create({
- owner: context.repo.owner,
- repo: context.repo.repo,
- title: "Update changelog.txt from release ${{ github.event.release.tag_name }}",
- head: "prep/post-release-tasks-${{ github.event.release.tag_name }}",
- base: "trunk",
- body: body
- })
+ const pr = await github.rest.pulls.create({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ title: "Update changelog.txt from release ${{ github.event.release.tag_name }}",
+ head: "prep/post-release-tasks-${{ github.event.release.tag_name }}",
+ base: "trunk",
+ body: body
+ })
- const prCreated = await github.rest.pulls.requestReviewers({
- owner: context.repo.owner,
- repo: context.repo.repo,
- pull_number: pr.data.number,
- reviewers: ["${{ github.event.release.author.login }}"]
- })
+ const prCreated = await github.rest.pulls.requestReviewers({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ pull_number: pr.data.number,
+ reviewers: ["${{ github.event.release.author.login }}"]
+ })
diff --git a/.github/workflows/pr-build-and-e2e-tests.yml b/.github/workflows/pr-build-and-e2e-tests.yml
index b4dbc95df24..d66270ba70d 100644
--- a/.github/workflows/pr-build-and-e2e-tests.yml
+++ b/.github/workflows/pr-build-and-e2e-tests.yml
@@ -12,8 +12,8 @@ jobs:
name: Runs E2E tests.
runs-on: ubuntu-20.04
env:
- ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/allure-results
- ALLURE_REPORT_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/allure-report
+ ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/test-results/allure-results
+ ALLURE_REPORT_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/test-results/allure-report
outputs:
E2E_GRAND_TOTAL: ${{ steps.count_e2e_total.outputs.E2E_GRAND_TOTAL }}
steps:
@@ -80,8 +80,8 @@ jobs:
name: Runs API tests.
runs-on: ubuntu-20.04
env:
- ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/api-core-tests/api-test-report/allure-results
- ALLURE_REPORT_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/api-core-tests/api-test-report/allure-report
+ ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/api-core-tests/test-results/allure-results
+ ALLURE_REPORT_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/api-core-tests/test-results/allure-report
steps:
- uses: actions/checkout@v3
diff --git a/.github/workflows/release-code-freeze.yml b/.github/workflows/release-code-freeze.yml
index 2ad6197d74f..17aa826f569 100644
--- a/.github/workflows/release-code-freeze.yml
+++ b/.github/workflows/release-code-freeze.yml
@@ -1,7 +1,7 @@
name: 'Release: Code freeze'
on:
schedule:
- - cron: '0 16 * * 4' # Run at 1600 UTC on Thursdays.
+ - cron: '0 23 * * 1' # Run at 2300 UTC on Mondays.
workflow_dispatch:
inputs:
timeOverride:
@@ -42,12 +42,12 @@ jobs:
$now = strtotime( getenv( 'TIME_OVERRIDE' ) );
}
- // Code freeze comes 26 days prior to release day.
- $release_time = strtotime( '+26 days', $now );
+ // Code freeze comes 22 days prior to release day.
+ $release_time = strtotime( '+22 days', $now );
$release_day_of_week = date( 'l', $release_time );
$release_day_of_month = (int) date( 'j', $release_time );
- // If 26 days from now isn't the second Tuesday, then it's not code freeze day.
+ // If 22 days from now isn't the second Tuesday, then it's not code freeze day.
if ( 'Tuesday' !== $release_day_of_week || $release_day_of_month < 8 || $release_day_of_month > 14 ) {
file_put_contents( getenv( 'GITHUB_OUTPUT' ), "freeze=1\n", FILE_APPEND );
} else {
@@ -163,7 +163,7 @@ jobs:
workflow_id: 'release-changelog.yml',
ref: 'trunk',
inputs: {
- releaseVersion: "release/${{ needs.maybe-create-next-milestone-and-release-branch.outputs.next_version }}",
- releaseBranch: "${{ needs.maybe-create-next-milestone-and-release-branch.outputs.next_version }}"
+ releaseVersion: "${{ needs.maybe-create-next-milestone-and-release-branch.outputs.release_version }}",
+ releaseBranch: "${{ needs.maybe-create-next-milestone-and-release-branch.outputs.branch }}"
}
})
diff --git a/.github/workflows/scripts/is-community-contributor.js b/.github/workflows/scripts/is-community-contributor.js
index 7708995fc06..9a4311d7878 100644
--- a/.github/workflows/scripts/is-community-contributor.js
+++ b/.github/workflows/scripts/is-community-contributor.js
@@ -1,50 +1,62 @@
-// Note you'll need to install this dependency as part of your workflow.
-const { Octokit } = require('@octokit/action');
+// Note you'll need to install these dependencies as part of your workflow.
+const { Octokit } = require( '@octokit/action' );
+const core = require( '@actions/core' );
// Note that this script assumes you set GITHUB_TOKEN in env, if you don't
// this won't work.
const octokit = new Octokit();
-const getIssueAuthor = (payload) => {
- return payload?.issue?.user?.login || payload?.pull_request?.user?.login || null;
-}
+const getIssueAuthor = ( payload ) => {
+ return (
+ payload?.issue?.user?.login ||
+ payload?.pull_request?.user?.login ||
+ null
+ );
+};
-const isCommunityContributor = async (owner, repo, username) => {
- if (username) {
- const {data: {permission}} = await octokit.rest.repos.getCollaboratorPermissionLevel({
+const isCommunityContributor = async ( owner, repo, username ) => {
+ if ( username ) {
+ const {
+ data: { permission },
+ } = await octokit.rest.repos.getCollaboratorPermissionLevel( {
owner,
repo,
username,
- });
-
+ } );
+
return permission === 'read' || permission === 'none';
}
- return false;
-}
+ return false;
+};
-const addLabel = async(label, owner, repo, issueNumber) => {
- await octokit.rest.issues.addLabels({
+const addLabel = async ( label, owner, repo, issueNumber ) => {
+ await octokit.rest.issues.addLabels( {
owner,
repo,
issue_number: issueNumber,
- labels: [label],
- });
-}
+ labels: [ label ],
+ } );
+};
const applyLabelToCommunityContributor = async () => {
- const eventPayload = require(process.env.GITHUB_EVENT_PATH);
- const username = getIssueAuthor(eventPayload);
- const [owner, repo] = process.env.GITHUB_REPOSITORY.split("/");
+ const eventPayload = require( process.env.GITHUB_EVENT_PATH );
+ const username = getIssueAuthor( eventPayload );
+ const [ owner, repo ] = process.env.GITHUB_REPOSITORY.split( '/' );
const { number } = eventPayload?.issue || eventPayload?.pull_request;
-
- const isCommunityUser = await isCommunityContributor(owner, repo, username);
- console.log( '::set-output name=is-community::%s', isCommunityUser ? 'yes' : 'no' );
-
- if (isCommunityUser) {
- console.log('Adding community contributor label');
- await addLabel('type: community contribution', owner, repo, number);
+
+ const isCommunityUser = await isCommunityContributor(
+ owner,
+ repo,
+ username
+ );
+
+ core.setOutput( 'is-community', isCommunityUser ? 'yes' : 'no' );
+
+ if ( isCommunityUser ) {
+ console.log( 'Adding community contributor label' );
+ await addLabel( 'type: community contribution', owner, repo, number );
}
-}
+};
applyLabelToCommunityContributor();
diff --git a/.github/workflows/scripts/release-code-freeze.php b/.github/workflows/scripts/release-code-freeze.php
index 210e4f5767b..5990e89c36d 100644
--- a/.github/workflows/scripts/release-code-freeze.php
+++ b/.github/workflows/scripts/release-code-freeze.php
@@ -23,14 +23,14 @@ function set_output( $name, $value ) {
file_put_contents( getenv( 'GITHUB_OUTPUT' ), "{$name}={$value}" . PHP_EOL, FILE_APPEND );
}
-// Code freeze comes 26 days prior to release day.
-$release_time = strtotime( '+26 days', $now );
+// Code freeze comes 22 days prior to release day.
+$release_time = strtotime( '+22 days', $now );
$release_day_of_week = date( 'l', $release_time );
$release_day_of_month = (int) date( 'j', $release_time );
-// If 26 days from now isn't the second Tuesday, then it's not code freeze day.
+// If 22 days from now isn't the second Tuesday, then it's not code freeze day.
if ( 'Tuesday' !== $release_day_of_week || $release_day_of_month < 8 || $release_day_of_month > 14 ) {
- echo 'Info: Today is not the Thursday of the code freeze.' . PHP_EOL;
+ echo 'Info: Today is not the Monday of the code freeze.' . PHP_EOL;
exit( 1 );
}
diff --git a/.github/workflows/smoke-test-daily.yml b/.github/workflows/smoke-test-daily.yml
index 7c985e30813..51d762e0e7d 100644
--- a/.github/workflows/smoke-test-daily.yml
+++ b/.github/workflows/smoke-test-daily.yml
@@ -55,7 +55,8 @@ jobs:
working-directory: plugins/woocommerce
env:
E2E_MAX_FAILURES: 25
- run: pnpm exec playwright test --config=tests/e2e-pw/daily.playwright.config.js
+ RESET_SITE: true
+ run: pnpm exec playwright test --config=tests/e2e-pw/playwright.config.js
- name: Generate Playwright E2E Test report.
if: success() || failure()
@@ -79,8 +80,8 @@ jobs:
needs: [e2e-tests]
if: success() || failure()
env:
- ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/api-core-tests/api-test-report/allure-results
- ALLURE_REPORT_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/api-core-tests/api-test-report/allure-report
+ ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/api-core-tests/test-results/allure-results
+ ALLURE_REPORT_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/api-core-tests/test-results/allure-report
steps:
- uses: actions/checkout@v3
with:
@@ -163,7 +164,7 @@ jobs:
A_PW: ${{ secrets.SMOKE_TEST_PERF_ADMIN_PASSWORD }}
C_USER: ${{ secrets.SMOKE_TEST_PERF_ADMIN_USER }}
C_PW: ${{ secrets.SMOKE_TEST_PERF_ADMIN_PASSWORD }}
- P_ID: 274
+ P_ID: 22733
run: |
./k6 run plugins/woocommerce/tests/performance/tests/gh-action-daily-ext-requests.js
@@ -219,7 +220,7 @@ jobs:
working-directory: plugins/woocommerce
env:
E2E_MAX_FAILURES: 15
- run: pnpm exec playwright test --config=tests/e2e-pw/daily.playwright.config.js
+ run: pnpm exec playwright test --config=tests/e2e-pw/playwright.config.js
- name: Generate E2E Test report.
if: success() || failure()
diff --git a/.gitignore b/.gitignore
index 78d84df67a0..dfa505b1edd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -72,8 +72,8 @@ yarn.lock
# Editors
nbproject/private/
-# Test Results
-test-results.json
+# E2E and API Test Results
+test-results
# Admin Feature config
plugins/woocommerce/includes/react-admin/feature-config.php
@@ -89,13 +89,6 @@ allure-results
changes.json
.env
-# Playwright output & working files
-/plugins/woocommerce/tests/e2e-pw/output
-/plugins/woocommerce/tests/e2e-pw/report
-/plugins/woocommerce/tests/e2e-pw/storage
-/plugins/woocommerce/tests/e2e-pw/test-results.json
-/plugins/woocommerce/tests/api-core-tests/output
-
# Turborepo
.turbo
diff --git a/changelog.txt b/changelog.txt
index f65998cfc1a..2b78a742a29 100644
--- a/changelog.txt
+++ b/changelog.txt
@@ -1,5 +1,254 @@
== Changelog ==
+= 7.2.2 2022-12-21 =
+
+** WooCommerce**
+
+* Fix - Corrects a hard-coded reference to the WP post meta table within the HPOS Migration Helper, that would fail on some sites. [#36100](https://github.com/woocommerce/woocommerce/pull/36100)
+
+= 7.2.1 2022-12-16 =
+
+**WooCommerce**
+
+* Update - Include taxes migration in MigrationHelper::migrate_country_states [#35967](https://github.com/woocommerce/woocommerce/pull/35967)
+
+= 7.2.0 2022-12-14 =
+
+**WooCommerce**
+
+* Fix - Corrects a hard-coded reference to the WP post meta table within the HPOS Migration Helper, that would fail on some sites. [#36100](https://github.com/woocommerce/woocommerce/pull/36100)
+* Fix - Drop usage of WP 5.9 function in the product quantity selector template. [#36054](https://github.com/woocommerce/woocommerce/pull/36054)
+* Fix - Add a data migration for changed New Zealand and Ukraine state codes [#35669](https://github.com/woocommerce/woocommerce/pull/35669)
+* Fix - Fix error in onboarding wizard when plugin is activated but includes unexpected output. [#35866](https://github.com/woocommerce/woocommerce/pull/35866)
+* Fix - Increased margin so that overflow modal content doesn't clip header [#35780](https://github.com/woocommerce/woocommerce/pull/35780)
+* Fix - Added default additional content to emails via filter woocommerce_email_additional_content_. [#35195](https://github.com/woocommerce/woocommerce/pull/35195)
+* Fix - Corrects the currency symbol for Libyan Dinar (LYD). [#35395](https://github.com/woocommerce/woocommerce/pull/35395)
+* Fix - Fix 'Invalid payment method' error upon double click on Delete button of Payment methods table [#30884](https://github.com/woocommerce/woocommerce/pull/30884)
+* Fix - Fix bg color that was not covering the full page [#35476](https://github.com/woocommerce/woocommerce/pull/35476)
+* Fix - Fix class name for class FirstDownlaodableProduct [#35383](https://github.com/woocommerce/woocommerce/pull/35383)
+* Fix - Fixed "Unsupported operand types" error. [#34327](https://github.com/woocommerce/woocommerce/pull/34327)
+* Fix - Fix inconsistent return type of class WC_Shipping_Rate->get_shipping_tax() [#35453](https://github.com/woocommerce/woocommerce/pull/35453)
+* Fix - Fix invalid wcadmin_install_plugin_error event props [#35411](https://github.com/woocommerce/woocommerce/pull/35411)
+* Fix - Fix JS error when the business step is accessed directly via URL without completing the previous steps [#35045](https://github.com/woocommerce/woocommerce/pull/35045)
+* Fix - fix popper position for in-app marketplace tour [#35278](https://github.com/woocommerce/woocommerce/pull/35278)
+* Fix - Fix WooCommerce icons not loading in the site editor. [#35532](https://github.com/woocommerce/woocommerce/pull/35532)
+* Fix - FQCN for WP_Error in PHPDoc. [#35305](https://github.com/woocommerce/woocommerce/pull/35305)
+* Fix - Make the user search metabox for orders show the same information for the loaded user and for search results [#35244](https://github.com/woocommerce/woocommerce/pull/35244)
+* Fix - Override filter_meta_data method, since it should be a no-op anyway. [#35192](https://github.com/woocommerce/woocommerce/pull/35192)
+* Fix - Remove the direct dependency on `$_POST` when validating checkout data. [#35329](https://github.com/woocommerce/woocommerce/pull/35329)
+* Fix - Revert change that auto collapses the product short description field. [#35213](https://github.com/woocommerce/woocommerce/pull/35213)
+* Fix - Skip flaky settings API test [#35338](https://github.com/woocommerce/woocommerce/pull/35338)
+* Fix - Update Playwright from 1.26.1 to 1.27.1 [#35106](https://github.com/woocommerce/woocommerce/pull/35106)
+* Fix - When the minimum and maximum quantity are identical, render the quantity input and set it to disabled. [#34282](https://github.com/woocommerce/woocommerce/pull/34282)
+* Add - Add "Empty Trash" functionality to HPOS list table. [#35489](https://github.com/woocommerce/woocommerce/pull/35489)
+* Add - Add add attribute modal to the attribute field in the new product management MVP [#34999](https://github.com/woocommerce/woocommerce/pull/34999)
+* Add - Add add new option for the category dropdown within the product MVP [#35132](https://github.com/woocommerce/woocommerce/pull/35132)
+* Add - Add contextual product more menu [#35447](https://github.com/woocommerce/woocommerce/pull/35447)
+* Add - Added a guided tour for WooCommerce Extensions page [#35278](https://github.com/woocommerce/woocommerce/pull/35278)
+* Add - Added npm script for Playwright API Core Tests [#35283](https://github.com/woocommerce/woocommerce/pull/35283)
+* Add - Added states for Senegal. [#35199](https://github.com/woocommerce/woocommerce/pull/35199)
+* Add - Added the "Tour the WooCommerce Marketplace" task to onboarding tasks list [#35278](https://github.com/woocommerce/woocommerce/pull/35278)
+* Add - Added Ukrainian subdivisions. [#35493](https://github.com/woocommerce/woocommerce/pull/35493)
+* Add - Adding attribute edit modal for new product screen. [#35269](https://github.com/woocommerce/woocommerce/pull/35269)
+* Add - Add manual stock management section to product management experience [#35047](https://github.com/woocommerce/woocommerce/pull/35047)
+* Add - Add new Category dropdown field to the new Product Management screen. [#34400](https://github.com/woocommerce/woocommerce/pull/34400)
+* Add - add new track events for in-app marketplace tour [#35278](https://github.com/woocommerce/woocommerce/pull/35278)
+* Add - Add option and modal to create new attribute terms within MVP attribute modal. [#35131](https://github.com/woocommerce/woocommerce/pull/35131)
+* Add - Add placeholder to description field [#35286](https://github.com/woocommerce/woocommerce/pull/35286)
+* Add - Add playwright api-core-tests for data crud operations [#35347](https://github.com/woocommerce/woocommerce/pull/35347)
+* Add - Add playwright api-core-tests for payment gateways crud operations [#35279](https://github.com/woocommerce/woocommerce/pull/35279)
+* Add - Add playwright api-core-tests for product reviews crud operations [#35163](https://github.com/woocommerce/woocommerce/pull/35163)
+* Add - Add playwright api-core-tests for product variations crud operations [#35355](https://github.com/woocommerce/woocommerce/pull/35355)
+* Add - Add playwright api-core-tests for reports crud operations [#35388](https://github.com/woocommerce/woocommerce/pull/35388)
+* Add - Add playwright api-core-tests for settingss crud operations [#35253](https://github.com/woocommerce/woocommerce/pull/35253)
+* Add - Add playwright api-core-tests for system status crud operations [#35254](https://github.com/woocommerce/woocommerce/pull/35254)
+* Add - Add playwright api-core-tests for webhooks crud operations [#35292](https://github.com/woocommerce/woocommerce/pull/35292)
+* Add - Add Product description title in old editor for clarification. [#35154](https://github.com/woocommerce/woocommerce/pull/35154)
+* Add - Add product inventory advanced section [#35164](https://github.com/woocommerce/woocommerce/pull/35164)
+* Add - Add product management description to new product management experience [#34961](https://github.com/woocommerce/woocommerce/pull/34961)
+* Add - Add product state badge to product form header [#35460](https://github.com/woocommerce/woocommerce/pull/35460)
+* Add - Add product title to header when available [#35431](https://github.com/woocommerce/woocommerce/pull/35431)
+* Add - Add scheduled sale support to new product edit page. [#34538](https://github.com/woocommerce/woocommerce/pull/34538)
+* Add - Adds new Inbox Note to provide more information about WooCommerce Payments to users who dismiss the WCPay promo but say that they want more information in the exit survey. [#35581](https://github.com/woocommerce/woocommerce/pull/35581)
+* Add - Add summary to new product page experience [#35201](https://github.com/woocommerce/woocommerce/pull/35201)
+* Add - Include order datastore information in status report. [#35487](https://github.com/woocommerce/woocommerce/pull/35487)
+* Add - Make it possible to add custom bulk action handling to the admin order list screen (when HPOS is enabled). [#35442](https://github.com/woocommerce/woocommerce/pull/35442)
+* Add - Set In-App Marketplace Tour as completed on tour close [#35278](https://github.com/woocommerce/woocommerce/pull/35278)
+* Add - When custom order tables are not authoritative, admin UI requests will be redirected to the matching legacy order screen as appropriate. [#35463](https://github.com/woocommerce/woocommerce/pull/35463)
+* Update - Woo Blocks 8.9.2 [#35805](https://github.com/woocommerce/woocommerce/pull/35805)
+* Update - Comment: Update WooCommerce Blocks to 8.7.2 [#35101](https://github.com/woocommerce/woocommerce/pull/35101)
+* Update - Comment: Update WooCommerce Blocks to 8.7.3 [#35219](https://github.com/woocommerce/woocommerce/pull/35219)
+* Update - Comment: Update WooCommerce Blocks to 8.9.1 [#35564](https://github.com/woocommerce/woocommerce/pull/35564)
+* Update - CustomOrdersTableController::custom_orders_table_usage_is_enabled returns now false if the HPOS feature is disabled [#35597](https://github.com/woocommerce/woocommerce/pull/35597)
+* Update - Disable inventory stock toggle when product stock management is disabled [#35059](https://github.com/woocommerce/woocommerce/pull/35059)
+* Update - Improve the loading time of WooCommerce setup widget for large databases [#35334](https://github.com/woocommerce/woocommerce/pull/35334)
+* Update - Permit showing a guided tour for WooCommerce Extensions page on desktops only [#35278](https://github.com/woocommerce/woocommerce/pull/35278)
+* Update - Remove adding and managing products note [#35319](https://github.com/woocommerce/woocommerce/pull/35319)
+* Update - Remove first downloadable product note [#35318](https://github.com/woocommerce/woocommerce/pull/35318)
+* Update - Remove InsightFirstProductAndPayment note [#35309](https://github.com/woocommerce/woocommerce/pull/35309)
+* Update - Remove insight on first sale note [#35341](https://github.com/woocommerce/woocommerce/pull/35341)
+* Update - Remove manage store activity note [#35320](https://github.com/woocommerce/woocommerce/pull/35320)
+* Update - Remove Popover.Slot usage and make use of exported SelectControlMenuSlot. [#35353](https://github.com/woocommerce/woocommerce/pull/35353)
+* Update - Remove update store details note [#35322](https://github.com/woocommerce/woocommerce/pull/35322)
+* Update - Update Array checks in playwright api-core-tests as some of the existing tests would produce false positives [#35462](https://github.com/woocommerce/woocommerce/pull/35462)
+* Update - Update playwright api-core-tests for shipping crud operations [#35332](https://github.com/woocommerce/woocommerce/pull/35332)
+* Update - Update playwright api-core-tests to execute for both base test environment and base JN environment with WooCommerce [#35522](https://github.com/woocommerce/woocommerce/pull/35522)
+* Update - Update products task list UI [#35611](https://github.com/woocommerce/woocommerce/pull/35611)
+* Update - Update ShippingLabelBanner add_meta_box action to only trigger on shop_order pages and remove deprecated function call. [#35212](https://github.com/woocommerce/woocommerce/pull/35212)
+* Update - Update WooCommerce Blocks to 8.9.0 [#35521](https://github.com/woocommerce/woocommerce/pull/35521)
+* Dev - Add variation price shortcut [#34948](https://github.com/woocommerce/woocommerce/pull/34948)
+* Dev - Cleanup and deprecate unused Task properties and methods [#35450](https://github.com/woocommerce/woocommerce/pull/35450)
+* Dev - Enable Playwright tests on Daily Smoke Test workflow and upload its Allure reports to S3 bucket. [#35114](https://github.com/woocommerce/woocommerce/pull/35114)
+* Dev - Move product action buttons to header menu [#35214](https://github.com/woocommerce/woocommerce/pull/35214)
+* Dev - Revert the changes introduced in PR #35282 [#35337](https://github.com/woocommerce/woocommerce/pull/35337)
+* Dev - Show a dismissible snackbar if the server responds with an error [#35160](https://github.com/woocommerce/woocommerce/pull/35160)
+* Dev - Update api-core-tests readme for consistency with new command and updates to other commands too. [#35303](https://github.com/woocommerce/woocommerce/pull/35303)
+* Dev - Updated the COT plugin URL now that this feature can be enabled in a different way. [#34990](https://github.com/woocommerce/woocommerce/pull/34990)
+* Dev - Update the list of tags for WC plugin on .org [#35573](https://github.com/woocommerce/woocommerce/pull/35573)
+* Dev - Update unit test install script for db sockets. [#35152](https://github.com/woocommerce/woocommerce/pull/35152)
+* Dev - Use plugins/woocommerce/tests/e2e-pw folder for saving test outputs [#35206](https://github.com/woocommerce/woocommerce/pull/35206)
+* Dev - Uses the globa-setup.js to setup permalinks structure [#35282](https://github.com/woocommerce/woocommerce/pull/35282)
+* Tweak - Move HPOS hook woocommerce_before_delete_order before deleting order. [#35517](https://github.com/woocommerce/woocommerce/pull/35517)
+* Tweak - Adds new filter `woocommerce_get_customer_payment_tokens_limit` to set limit on number of payment methods fetched within the My Account page. [#29850](https://github.com/woocommerce/woocommerce/pull/29850)
+* Tweak - Add source parameter for calls to the subscriptions endpoint on WooCommerce.com [#35051](https://github.com/woocommerce/woocommerce/pull/35051)
+* Tweak - Fix @version header in form-login.php [#35479](https://github.com/woocommerce/woocommerce/pull/35479)
+* Tweak - Move HPOS hook woocommerce_before_delete_order before deleting order. [#35517](https://github.com/woocommerce/woocommerce/pull/35517)
+* Tweak - typo fix [#35111](https://github.com/woocommerce/woocommerce/pull/35111)
+* Tweak - Unwrap product page input props and pass via getInputProps [#35034](https://github.com/woocommerce/woocommerce/pull/35034)
+* Tweak - Updates the currency symbol used for the Azerbaijani manat. [#30605](https://github.com/woocommerce/woocommerce/pull/30605)
+* Tweak - Use new Tooltip component instead of EnrichedLabel [#35024](https://github.com/woocommerce/woocommerce/pull/35024)
+* Enhancement - Change the product info section title to Product Details [#35255](https://github.com/woocommerce/woocommerce/pull/35255)
+* Enhancement - Fix the display of letter descenders in the shipping class dropdown menu [#35258](https://github.com/woocommerce/woocommerce/pull/35258)
+* Enhancement - Improve the communication around required and optional [#35266](https://github.com/woocommerce/woocommerce/pull/35266)
+* Enhancement - Increase the spacing between the shipping box illustration and the dimensions fields [#35259](https://github.com/woocommerce/woocommerce/pull/35259)
+* Enhancement - Optimize query usage in the Onboarding tasks [#35065](https://github.com/woocommerce/woocommerce/pull/35065)
+* Enhancement - Remove some placeholder values [#35267](https://github.com/woocommerce/woocommerce/pull/35267)
+* Enhancement - Replace the trash can icon in the attribute list [#35133](https://github.com/woocommerce/woocommerce/pull/35133)
+* Enhancement - Select the current new added shipping class [#35123](https://github.com/woocommerce/woocommerce/pull/35123)
+* Enhancement - Tweaks the PR template for GitHub pull requests [#34597](https://github.com/woocommerce/woocommerce/pull/34597)
+
+
+= 7.2.1 2022-12-16 =
+
+**WooCommerce**
+
+* Update - Include taxes migration in MigrationHelper::migrate_country_states [#35967](https://github.com/woocommerce/woocommerce/pull/35967)
+
+= 7.2.0 2022-12-14 =
+
+**WooCommerce**
+
+* Fix - Drop usage of WP 5.9 function in the product quantity selector template. [#36054](https://github.com/woocommerce/woocommerce/pull/36054)
+* Fix - Add a data migration for changed New Zealand and Ukraine state codes [#35669](https://github.com/woocommerce/woocommerce/pull/35669)
+* Fix - Fix error in onboarding wizard when plugin is activated but includes unexpected output. [#35866](https://github.com/woocommerce/woocommerce/pull/35866)
+* Fix - Increased margin so that overflow modal content doesn't clip header [#35780](https://github.com/woocommerce/woocommerce/pull/35780)
+* Fix - Added default additional content to emails via filter woocommerce_email_additional_content_. [#35195](https://github.com/woocommerce/woocommerce/pull/35195)
+* Fix - Corrects the currency symbol for Libyan Dinar (LYD). [#35395](https://github.com/woocommerce/woocommerce/pull/35395)
+* Fix - Fix 'Invalid payment method' error upon double click on Delete button of Payment methods table [#30884](https://github.com/woocommerce/woocommerce/pull/30884)
+* Fix - Fix bg color that was not covering the full page [#35476](https://github.com/woocommerce/woocommerce/pull/35476)
+* Fix - Fix class name for class FirstDownlaodableProduct [#35383](https://github.com/woocommerce/woocommerce/pull/35383)
+* Fix - Fixed "Unsupported operand types" error. [#34327](https://github.com/woocommerce/woocommerce/pull/34327)
+* Fix - Fix inconsistent return type of class WC_Shipping_Rate->get_shipping_tax() [#35453](https://github.com/woocommerce/woocommerce/pull/35453)
+* Fix - Fix invalid wcadmin_install_plugin_error event props [#35411](https://github.com/woocommerce/woocommerce/pull/35411)
+* Fix - Fix JS error when the business step is accessed directly via URL without completing the previous steps [#35045](https://github.com/woocommerce/woocommerce/pull/35045)
+* Fix - fix popper position for in-app marketplace tour [#35278](https://github.com/woocommerce/woocommerce/pull/35278)
+* Fix - Fix WooCommerce icons not loading in the site editor. [#35532](https://github.com/woocommerce/woocommerce/pull/35532)
+* Fix - FQCN for WP_Error in PHPDoc. [#35305](https://github.com/woocommerce/woocommerce/pull/35305)
+* Fix - Make the user search metabox for orders show the same information for the loaded user and for search results [#35244](https://github.com/woocommerce/woocommerce/pull/35244)
+* Fix - Override filter_meta_data method, since it should be a no-op anyway. [#35192](https://github.com/woocommerce/woocommerce/pull/35192)
+* Fix - Remove the direct dependency on `$_POST` when validating checkout data. [#35329](https://github.com/woocommerce/woocommerce/pull/35329)
+* Fix - Revert change that auto collapses the product short description field. [#35213](https://github.com/woocommerce/woocommerce/pull/35213)
+* Fix - Skip flaky settings API test [#35338](https://github.com/woocommerce/woocommerce/pull/35338)
+* Fix - Update Playwright from 1.26.1 to 1.27.1 [#35106](https://github.com/woocommerce/woocommerce/pull/35106)
+* Fix - When the minimum and maximum quantity are identical, render the quantity input and set it to disabled. [#34282](https://github.com/woocommerce/woocommerce/pull/34282)
+* Add - Add "Empty Trash" functionality to HPOS list table. [#35489](https://github.com/woocommerce/woocommerce/pull/35489)
+* Add - Add add attribute modal to the attribute field in the new product management MVP [#34999](https://github.com/woocommerce/woocommerce/pull/34999)
+* Add - Add add new option for the category dropdown within the product MVP [#35132](https://github.com/woocommerce/woocommerce/pull/35132)
+* Add - Add contextual product more menu [#35447](https://github.com/woocommerce/woocommerce/pull/35447)
+* Add - Added a guided tour for WooCommerce Extensions page [#35278](https://github.com/woocommerce/woocommerce/pull/35278)
+* Add - Added npm script for Playwright API Core Tests [#35283](https://github.com/woocommerce/woocommerce/pull/35283)
+* Add - Added states for Senegal. [#35199](https://github.com/woocommerce/woocommerce/pull/35199)
+* Add - Added the "Tour the WooCommerce Marketplace" task to onboarding tasks list [#35278](https://github.com/woocommerce/woocommerce/pull/35278)
+* Add - Added Ukrainian subdivisions. [#35493](https://github.com/woocommerce/woocommerce/pull/35493)
+* Add - Adding attribute edit modal for new product screen. [#35269](https://github.com/woocommerce/woocommerce/pull/35269)
+* Add - Add manual stock management section to product management experience [#35047](https://github.com/woocommerce/woocommerce/pull/35047)
+* Add - Add new Category dropdown field to the new Product Management screen. [#34400](https://github.com/woocommerce/woocommerce/pull/34400)
+* Add - add new track events for in-app marketplace tour [#35278](https://github.com/woocommerce/woocommerce/pull/35278)
+* Add - Add option and modal to create new attribute terms within MVP attribute modal. [#35131](https://github.com/woocommerce/woocommerce/pull/35131)
+* Add - Add placeholder to description field [#35286](https://github.com/woocommerce/woocommerce/pull/35286)
+* Add - Add playwright api-core-tests for data crud operations [#35347](https://github.com/woocommerce/woocommerce/pull/35347)
+* Add - Add playwright api-core-tests for payment gateways crud operations [#35279](https://github.com/woocommerce/woocommerce/pull/35279)
+* Add - Add playwright api-core-tests for product reviews crud operations [#35163](https://github.com/woocommerce/woocommerce/pull/35163)
+* Add - Add playwright api-core-tests for product variations crud operations [#35355](https://github.com/woocommerce/woocommerce/pull/35355)
+* Add - Add playwright api-core-tests for reports crud operations [#35388](https://github.com/woocommerce/woocommerce/pull/35388)
+* Add - Add playwright api-core-tests for settingss crud operations [#35253](https://github.com/woocommerce/woocommerce/pull/35253)
+* Add - Add playwright api-core-tests for system status crud operations [#35254](https://github.com/woocommerce/woocommerce/pull/35254)
+* Add - Add playwright api-core-tests for webhooks crud operations [#35292](https://github.com/woocommerce/woocommerce/pull/35292)
+* Add - Add Product description title in old editor for clarification. [#35154](https://github.com/woocommerce/woocommerce/pull/35154)
+* Add - Add product inventory advanced section [#35164](https://github.com/woocommerce/woocommerce/pull/35164)
+* Add - Add product management description to new product management experience [#34961](https://github.com/woocommerce/woocommerce/pull/34961)
+* Add - Add product state badge to product form header [#35460](https://github.com/woocommerce/woocommerce/pull/35460)
+* Add - Add product title to header when available [#35431](https://github.com/woocommerce/woocommerce/pull/35431)
+* Add - Add scheduled sale support to new product edit page. [#34538](https://github.com/woocommerce/woocommerce/pull/34538)
+* Add - Adds new Inbox Note to provide more information about WooCommerce Payments to users who dismiss the WCPay promo but say that they want more information in the exit survey. [#35581](https://github.com/woocommerce/woocommerce/pull/35581)
+* Add - Add summary to new product page experience [#35201](https://github.com/woocommerce/woocommerce/pull/35201)
+* Add - Include order datastore information in status report. [#35487](https://github.com/woocommerce/woocommerce/pull/35487)
+* Add - Make it possible to add custom bulk action handling to the admin order list screen (when HPOS is enabled). [#35442](https://github.com/woocommerce/woocommerce/pull/35442)
+* Add - Set In-App Marketplace Tour as completed on tour close [#35278](https://github.com/woocommerce/woocommerce/pull/35278)
+* Add - When custom order tables are not authoritative, admin UI requests will be redirected to the matching legacy order screen as appropriate. [#35463](https://github.com/woocommerce/woocommerce/pull/35463)
+* Update - Woo Blocks 8.9.2 [#35805](https://github.com/woocommerce/woocommerce/pull/35805)
+* Update - Comment: Update WooCommerce Blocks to 8.7.2 [#35101](https://github.com/woocommerce/woocommerce/pull/35101)
+* Update - Comment: Update WooCommerce Blocks to 8.7.3 [#35219](https://github.com/woocommerce/woocommerce/pull/35219)
+* Update - Comment: Update WooCommerce Blocks to 8.9.1 [#35564](https://github.com/woocommerce/woocommerce/pull/35564)
+* Update - CustomOrdersTableController::custom_orders_table_usage_is_enabled returns now false if the HPOS feature is disabled [#35597](https://github.com/woocommerce/woocommerce/pull/35597)
+* Update - Disable inventory stock toggle when product stock management is disabled [#35059](https://github.com/woocommerce/woocommerce/pull/35059)
+* Update - Improve the loading time of WooCommerce setup widget for large databases [#35334](https://github.com/woocommerce/woocommerce/pull/35334)
+* Update - Permit showing a guided tour for WooCommerce Extensions page on desktops only [#35278](https://github.com/woocommerce/woocommerce/pull/35278)
+* Update - Remove adding and managing products note [#35319](https://github.com/woocommerce/woocommerce/pull/35319)
+* Update - Remove first downloadable product note [#35318](https://github.com/woocommerce/woocommerce/pull/35318)
+* Update - Remove InsightFirstProductAndPayment note [#35309](https://github.com/woocommerce/woocommerce/pull/35309)
+* Update - Remove insight on first sale note [#35341](https://github.com/woocommerce/woocommerce/pull/35341)
+* Update - Remove manage store activity note [#35320](https://github.com/woocommerce/woocommerce/pull/35320)
+* Update - Remove Popover.Slot usage and make use of exported SelectControlMenuSlot. [#35353](https://github.com/woocommerce/woocommerce/pull/35353)
+* Update - Remove update store details note [#35322](https://github.com/woocommerce/woocommerce/pull/35322)
+* Update - Update Array checks in playwright api-core-tests as some of the existing tests would produce false positives [#35462](https://github.com/woocommerce/woocommerce/pull/35462)
+* Update - Update playwright api-core-tests for shipping crud operations [#35332](https://github.com/woocommerce/woocommerce/pull/35332)
+* Update - Update playwright api-core-tests to execute for both base test environment and base JN environment with WooCommerce [#35522](https://github.com/woocommerce/woocommerce/pull/35522)
+* Update - Update products task list UI [#35611](https://github.com/woocommerce/woocommerce/pull/35611)
+* Update - Update ShippingLabelBanner add_meta_box action to only trigger on shop_order pages and remove deprecated function call. [#35212](https://github.com/woocommerce/woocommerce/pull/35212)
+* Update - Update WooCommerce Blocks to 8.9.0 [#35521](https://github.com/woocommerce/woocommerce/pull/35521)
+* Dev - Add variation price shortcut [#34948](https://github.com/woocommerce/woocommerce/pull/34948)
+* Dev - Cleanup and deprecate unused Task properties and methods [#35450](https://github.com/woocommerce/woocommerce/pull/35450)
+* Dev - Enable Playwright tests on Daily Smoke Test workflow and upload its Allure reports to S3 bucket. [#35114](https://github.com/woocommerce/woocommerce/pull/35114)
+* Dev - Move product action buttons to header menu [#35214](https://github.com/woocommerce/woocommerce/pull/35214)
+* Dev - Revert the changes introduced in PR #35282 [#35337](https://github.com/woocommerce/woocommerce/pull/35337)
+* Dev - Show a dismissible snackbar if the server responds with an error [#35160](https://github.com/woocommerce/woocommerce/pull/35160)
+* Dev - Update api-core-tests readme for consistency with new command and updates to other commands too. [#35303](https://github.com/woocommerce/woocommerce/pull/35303)
+* Dev - Updated the COT plugin URL now that this feature can be enabled in a different way. [#34990](https://github.com/woocommerce/woocommerce/pull/34990)
+* Dev - Update the list of tags for WC plugin on .org [#35573](https://github.com/woocommerce/woocommerce/pull/35573)
+* Dev - Update unit test install script for db sockets. [#35152](https://github.com/woocommerce/woocommerce/pull/35152)
+* Dev - Use plugins/woocommerce/tests/e2e-pw folder for saving test outputs [#35206](https://github.com/woocommerce/woocommerce/pull/35206)
+* Dev - Uses the globa-setup.js to setup permalinks structure [#35282](https://github.com/woocommerce/woocommerce/pull/35282)
+* Tweak - Move HPOS hook woocommerce_before_delete_order before deleting order. [#35517](https://github.com/woocommerce/woocommerce/pull/35517)
+* Tweak - Adds new filter `woocommerce_get_customer_payment_tokens_limit` to set limit on number of payment methods fetched within the My Account page. [#29850](https://github.com/woocommerce/woocommerce/pull/29850)
+* Tweak - Add source parameter for calls to the subscriptions endpoint on WooCommerce.com [#35051](https://github.com/woocommerce/woocommerce/pull/35051)
+* Tweak - Fix @version header in form-login.php [#35479](https://github.com/woocommerce/woocommerce/pull/35479)
+* Tweak - Move HPOS hook woocommerce_before_delete_order before deleting order. [#35517](https://github.com/woocommerce/woocommerce/pull/35517)
+* Tweak - typo fix [#35111](https://github.com/woocommerce/woocommerce/pull/35111)
+* Tweak - Unwrap product page input props and pass via getInputProps [#35034](https://github.com/woocommerce/woocommerce/pull/35034)
+* Tweak - Updates the currency symbol used for the Azerbaijani manat. [#30605](https://github.com/woocommerce/woocommerce/pull/30605)
+* Tweak - Use new Tooltip component instead of EnrichedLabel [#35024](https://github.com/woocommerce/woocommerce/pull/35024)
+* Enhancement - Change the product info section title to Product Details [#35255](https://github.com/woocommerce/woocommerce/pull/35255)
+* Enhancement - Fix the display of letter descenders in the shipping class dropdown menu [#35258](https://github.com/woocommerce/woocommerce/pull/35258)
+* Enhancement - Improve the communication around required and optional [#35266](https://github.com/woocommerce/woocommerce/pull/35266)
+* Enhancement - Increase the spacing between the shipping box illustration and the dimensions fields [#35259](https://github.com/woocommerce/woocommerce/pull/35259)
+* Enhancement - Optimize query usage in the Onboarding tasks [#35065](https://github.com/woocommerce/woocommerce/pull/35065)
+* Enhancement - Remove some placeholder values [#35267](https://github.com/woocommerce/woocommerce/pull/35267)
+* Enhancement - Replace the trash can icon in the attribute list [#35133](https://github.com/woocommerce/woocommerce/pull/35133)
+* Enhancement - Select the current new added shipping class [#35123](https://github.com/woocommerce/woocommerce/pull/35123)
+* Enhancement - Tweaks the PR template for GitHub pull requests [#34597](https://github.com/woocommerce/woocommerce/pull/34597)
+
+
= 7.1.1 2022-12-07 =
**WooCommerce**
diff --git a/packages/js/components/changelog/add-35301-delayed-ces-prompt b/packages/js/components/changelog/add-35301-delayed-ces-prompt
new file mode 100644
index 00000000000..a0589d9d4ab
--- /dev/null
+++ b/packages/js/components/changelog/add-35301-delayed-ces-prompt
@@ -0,0 +1,4 @@
+Significance: minor
+Type: add
+
+Adding isHidden option for primary button in TourKit component.
diff --git a/packages/js/components/changelog/add-35789_set_variations_list_fixed_height b/packages/js/components/changelog/add-35789_set_variations_list_fixed_height
new file mode 100644
index 00000000000..6d397019d36
--- /dev/null
+++ b/packages/js/components/changelog/add-35789_set_variations_list_fixed_height
@@ -0,0 +1,4 @@
+Significance: minor
+Type: add
+
+Add className prop to Sortable
diff --git a/packages/js/components/changelog/enhancement-table-add-no-data-label-property b/packages/js/components/changelog/enhancement-table-add-no-data-label-property
new file mode 100644
index 00000000000..70efa89f698
--- /dev/null
+++ b/packages/js/components/changelog/enhancement-table-add-no-data-label-property
@@ -0,0 +1,4 @@
+Significance: minor
+Type: enhancement
+
+Add noDataLabel property into table.js component to allow No Data label customization.
diff --git a/packages/js/components/changelog/fix-36129-table-className b/packages/js/components/changelog/fix-36129-table-className
new file mode 100644
index 00000000000..1b601edb7bf
--- /dev/null
+++ b/packages/js/components/changelog/fix-36129-table-className
@@ -0,0 +1,4 @@
+Significance: minor
+Type: add
+
+Make Table component accept className prop.
diff --git a/packages/js/components/changelog/list-item-classname b/packages/js/components/changelog/list-item-classname
new file mode 100644
index 00000000000..9f5a5ea0d55
--- /dev/null
+++ b/packages/js/components/changelog/list-item-classname
@@ -0,0 +1,4 @@
+Significance: minor
+Type: add
+
+Add className prop to ListItem.
diff --git a/packages/js/components/changelog/update-add-aria-label-for-simple-select-dropdown b/packages/js/components/changelog/update-add-aria-label-for-simple-select-dropdown
new file mode 100644
index 00000000000..ff75398a39b
--- /dev/null
+++ b/packages/js/components/changelog/update-add-aria-label-for-simple-select-dropdown
@@ -0,0 +1,4 @@
+Significance: patch
+Type: add
+
+Add aria-label for simple select dropdown
diff --git a/packages/js/components/src/list-item/list-item.tsx b/packages/js/components/src/list-item/list-item.tsx
index d6b77112e6e..f36c7815304 100644
--- a/packages/js/components/src/list-item/list-item.tsx
+++ b/packages/js/components/src/list-item/list-item.tsx
@@ -12,19 +12,21 @@ import { SortableHandle } from '../sortable';
export type ListItemProps = {
children: JSX.Element | JSX.Element[] | string;
+ className?: string;
onDragStart?: DragEventHandler< HTMLDivElement >;
onDragEnd?: DragEventHandler< HTMLDivElement >;
};
export const ListItem = ( {
children,
+ className,
onDragStart,
onDragEnd,
}: ListItemProps ) => {
const isDraggable = onDragEnd && onDragStart;
return (
-
+
{ isDraggable && }
{ children }
diff --git a/packages/js/components/src/select-control/control.js b/packages/js/components/src/select-control/control.js
index c1baa3bf07d..931a4e425a2 100644
--- a/packages/js/components/src/select-control/control.js
+++ b/packages/js/components/src/select-control/control.js
@@ -154,6 +154,7 @@ class Control extends Component {
: null
}
disabled={ disabled }
+ aria-label={ this.props.ariaLabel ?? this.props.label }
/>
);
}
diff --git a/packages/js/components/src/table/README.md b/packages/js/components/src/table/README.md
index 21e30c4a83f..54378b6dd25 100644
--- a/packages/js/components/src/table/README.md
+++ b/packages/js/components/src/table/README.md
@@ -241,6 +241,7 @@ Name | Type | Default | Description
`rows` | Array | `null` | (required) An array of arrays of display/value object pairs
`rowHeader` | One of type: number, bool | `0` | Which column should be the row header, defaults to the first item (`0`) (but could be set to `1`, if the first col is checkboxes, for example). Set to false to disable row headers
`rowKey` | Function(row, index): string | `null` | Function used to get the row key.
+`emptyMessage` | String | `undefined` | Customize the message to show when there are no rows in the table.
### `headers` structure
diff --git a/packages/js/components/src/table/index.js b/packages/js/components/src/table/index.js
index b40d94b87d4..2723ceb6c32 100644
--- a/packages/js/components/src/table/index.js
+++ b/packages/js/components/src/table/index.js
@@ -153,6 +153,7 @@ class TableCard extends Component {
title,
totalRows,
rowKey,
+ emptyMessage,
} = this.props;
const { showCols } = this.state;
const allHeaders = this.props.headers;
@@ -237,6 +238,7 @@ class TableCard extends Component {
query={ query }
onSort={ onSort || onQueryChange( 'sort' ) }
rowKey={ rowKey }
+ emptyMessage={ emptyMessage }
/>
) }
@@ -361,6 +363,10 @@ TableCard.propTypes = {
* This uses the index if not defined.
*/
rowKey: PropTypes.func,
+ /**
+ * Customize the message to show when there are no rows in the table.
+ */
+ emptyMessage: PropTypes.string,
};
TableCard.defaultProps = {
@@ -372,6 +378,7 @@ TableCard.defaultProps = {
rowHeader: 0,
rows: [],
showMenu: true,
+ emptyMessage: undefined,
};
export default TableCard;
diff --git a/packages/js/components/src/table/placeholder.js b/packages/js/components/src/table/placeholder.js
index 956730ad1eb..cd6e2cbf999 100644
--- a/packages/js/components/src/table/placeholder.js
+++ b/packages/js/components/src/table/placeholder.js
@@ -25,7 +25,7 @@ class TablePlaceholder extends Component {
return (
row[ 0 ].value }
+ emptyMessage="Custom empty message"
+ />
+
+);
+
export default {
title: 'WooCommerce Admin/components/Table',
component: Table,
diff --git a/packages/js/components/src/table/table.js b/packages/js/components/src/table/table.js
index 89def764924..0f484027b69 100644
--- a/packages/js/components/src/table/table.js
+++ b/packages/js/components/src/table/table.js
@@ -14,6 +14,7 @@ import { find, get, noop } from 'lodash';
import PropTypes from 'prop-types';
import { withInstanceId } from '@wordpress/compose';
import { Icon, chevronUp, chevronDown } from '@wordpress/icons';
+import deprecated from '@wordpress/deprecated';
const ASC = 'asc';
const DESC = 'desc';
@@ -140,18 +141,35 @@ class Table extends Component {
const {
ariaHidden,
caption,
+ className,
classNames,
headers,
instanceId,
query,
rowHeader,
rows,
+ emptyMessage,
} = this.props;
const { isScrollableRight, isScrollableLeft, tabIndex } = this.state;
- const classes = classnames( 'woocommerce-table__table', classNames, {
- 'is-scrollable-right': isScrollableRight,
- 'is-scrollable-left': isScrollableLeft,
- } );
+
+ if ( classNames ) {
+ deprecated( `Table component's classNames prop`, {
+ since: '11.1.0',
+ version: '12.0.0',
+ alternative: 'className',
+ plugin: '@woocommerce/components',
+ } );
+ }
+
+ const classes = classnames(
+ 'woocommerce-table__table',
+ classNames,
+ className,
+ {
+ 'is-scrollable-right': isScrollableRight,
+ 'is-scrollable-left': isScrollableLeft,
+ }
+ );
const sortedBy =
query.orderby ||
get( find( headers, { defaultSort: true } ), 'key', false );
@@ -344,10 +362,11 @@ class Table extends Component {
className="woocommerce-table__empty-item"
colSpan={ headers.length }
>
- { __(
- 'No data to display',
- 'woocommerce'
- ) }
+ { emptyMessage ??
+ __(
+ 'No data to display',
+ 'woocommerce'
+ ) }
) }
@@ -454,6 +473,10 @@ Table.propTypes = {
* Defaults to index.
*/
rowKey: PropTypes.func,
+ /**
+ * Customize the message to show when there are no rows in the table.
+ */
+ emptyMessage: PropTypes.string,
};
Table.defaultProps = {
@@ -462,6 +485,7 @@ Table.defaultProps = {
onSort: noop,
query: {},
rowHeader: 0,
+ emptyMessage: undefined,
};
export default withInstanceId( Table );
diff --git a/packages/js/components/src/table/test/index.js b/packages/js/components/src/table/test/index.js
index d46df160c27..84acf0a0dbe 100644
--- a/packages/js/components/src/table/test/index.js
+++ b/packages/js/components/src/table/test/index.js
@@ -10,6 +10,7 @@ import { createElement } from '@wordpress/element';
* Internal dependencies
*/
import TableCard from '../index';
+import Table from '../table';
import mockHeaders from './data/table-mock-headers';
import mockData from './data/table-mock-data';
import mockSummary from './data/table-mock-summary';
@@ -171,4 +172,69 @@ describe( 'TableCard', () => {
'is-left-aligned'
);
} );
+
+ it( 'should render the default "No data to display" when there are no data and emptyMessage is unset', () => {
+ render(
+
+ );
+
+ expect(
+ screen.queryByText( 'No data to display' )
+ ).toBeInTheDocument();
+ } );
+
+ it( 'should render the custom label set in emptyMessage when there are no data.', () => {
+ const emptyMessage = 'My no data label';
+
+ render(
+
+ );
+
+ expect( screen.queryByText( emptyMessage ) ).toBeInTheDocument();
+ } );
+} );
+
+describe( 'Table', () => {
+ it( 'should accept className prop and renders it in the HTML output', () => {
+ render(
+
+ );
+
+ const el = screen.getByLabelText( 'Table with className' );
+
+ expect( el ).toHaveClass( 'class-111' );
+ } );
+
+ it( 'should still work with classNames prop and renders it in the HTML output, for backward compatibility reason', () => {
+ render(
+