Merge branch 'feature/34903-multichannel-marketing-frontend/main' into feature/34903-multichannel-marketing-frontend/34906-channels-card
This commit is contained in:
commit
b326ba1204
|
@ -1,5 +1,6 @@
|
|||
name: Setup WooCommerce Monorepo
|
||||
description: Handles the installation, building, and caching of the projects within the monorepo.
|
||||
permissions: {}
|
||||
|
||||
inputs:
|
||||
install-filters:
|
||||
|
|
|
@ -6,10 +6,15 @@ on:
|
|||
description: 'By default the zip file is generated from the branch the workflow runs from, but you can specify an explicit reference to use instead here (e.g. refs/tags/tag_name or refs/heads/release/x.x). The resulting file will be available as an artifact on the workflow run.'
|
||||
required: false
|
||||
default: ''
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build release zip file
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
|
|
|
@ -2,10 +2,15 @@ name: Build release asset
|
|||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build release asset
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
|
|
|
@ -0,0 +1,287 @@
|
|||
name: Bump WP L-2 Support
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
releaseBranch:
|
||||
description: Provide the release branch you want to bump the WP L-2 support. Example release/6.9. Note that trunk will also be bumped to match.
|
||||
default: ''
|
||||
required: true
|
||||
|
||||
permissions: {}
|
||||
|
||||
env:
|
||||
GIT_COMMITTER_NAME: 'WooCommerce Bot'
|
||||
GIT_COMMITTER_EMAIL: 'no-reply@woocommerce.com'
|
||||
GIT_AUTHOR_NAME: 'WooCommerce Bot'
|
||||
GIT_AUTHOR_EMAIL: 'no-reply@woocommerce.com'
|
||||
|
||||
jobs:
|
||||
check-release-branch-exists:
|
||||
name: Check for existence of release branch
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Check for release branch
|
||||
id: release-branch-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: '${{ inputs.releaseBranch }}',
|
||||
} );
|
||||
|
||||
validate-bump:
|
||||
name: Validate and bump WP L-2 support version
|
||||
runs-on: ubuntu-20.04
|
||||
needs: check-release-branch-exists
|
||||
if: success()
|
||||
permissions:
|
||||
actions: write
|
||||
contents: write
|
||||
pull-requests: write
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Get latest WP version
|
||||
id: latestWP
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: |
|
||||
const https = require( 'https' );
|
||||
|
||||
https.get( 'https://api.wordpress.org/core/stable-check/1.0/', ( resp ) => {
|
||||
let data = '';
|
||||
|
||||
// A chunk of data has been received.
|
||||
resp.on( 'data', ( chunk ) => {
|
||||
data += chunk;
|
||||
} );
|
||||
|
||||
// The whole response has been received. Print out the result.
|
||||
resp.on( 'end', () => {
|
||||
JSON.parse(data, ( key, val ) => {
|
||||
if ( val === 'latest' ) {
|
||||
core.setOutput( 'version', key )
|
||||
}
|
||||
} );
|
||||
} );
|
||||
|
||||
} ).on( 'error', ( err ) => {
|
||||
console.log( 'Error: ' + err.message );
|
||||
} );
|
||||
|
||||
- name: Get L-2 WP version
|
||||
id: l2Version
|
||||
if: steps.latestWP.outputs.version != '' && steps.latestWP.outputs.version != null
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: |
|
||||
const version = "${{ steps.latestWP.outputs.version }}";
|
||||
const latestWPVersionMajor = version.split( '.' )[0];
|
||||
const latestWPVersionMinor = version.split( '.' )[1];
|
||||
const l2 = (parseInt( ( latestWPVersionMajor + latestWPVersionMinor ), 10 ) - 2 ).toString();
|
||||
const l2Major = l2.split( '' )[0];
|
||||
const l2Minor = l2.split( '' )[1];
|
||||
core.setOutput( 'version', l2Major + '.' + l2Minor );
|
||||
|
||||
- name: Git fetch the release branch
|
||||
run: git fetch origin ${{ inputs.releaseBranch }}
|
||||
|
||||
- name: Checkout release branch
|
||||
run: git checkout ${{ inputs.releaseBranch }}
|
||||
|
||||
- name: Create a PR branch based on release branch
|
||||
run: git checkout -b WP-L-2-version-support-${{ steps.l2Version.outputs.version }}/${{ inputs.releaseBranch }}
|
||||
|
||||
- name: Check if WP L-2 support needs to be bumped the release branch
|
||||
id: readmeWPVersion
|
||||
if: steps.l2Version.outputs.version != '' && steps.l2Version.outputs.version != null
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: |
|
||||
const fs = require( 'node:fs' );
|
||||
const l2Version = "${{ steps.l2Version.outputs.version }}";
|
||||
let readme = '';
|
||||
|
||||
fs.readFile( './plugins/woocommerce/readme.txt', 'utf-8', function( err, data ) {
|
||||
if ( err ) {
|
||||
console.error( err );
|
||||
}
|
||||
|
||||
readme = data.split( "\n" );
|
||||
const newReadme = [];
|
||||
let needsChange = false;
|
||||
|
||||
for ( const line of readme ) {
|
||||
if ( line.match( /Requires\sat\sleast:\s\d+\.\d/ ) ) {
|
||||
const readmeVersion = line.match( /\d+\.\d/ );
|
||||
|
||||
// If the versions don't match, means we need to make a change.
|
||||
if ( readmeVersion != l2Version ) {
|
||||
needsChange = true;
|
||||
|
||||
newReadme.push( 'Requires at least: ' + l2Version );
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
newReadme.push( line );
|
||||
}
|
||||
|
||||
if ( needsChange ) {
|
||||
fs.writeFile( './plugins/woocommerce/readme.txt', newReadme.join( "\n" ), err => {
|
||||
if ( err ) {
|
||||
core.setFailed( `Unable to bump the WP L-2 support version. ${err}` );
|
||||
}
|
||||
|
||||
core.setOutput( 'needsChange', needsChange );
|
||||
|
||||
// Copy the readme.txt file to the root of VM to be used later.
|
||||
fs.writeFile( '../../readme.txt', newReadme.join( "\n" ), err => {
|
||||
if ( err ) {
|
||||
core.setFailed( `Unable to copy the readme.txt file to the root of VM. ${err}` );
|
||||
}
|
||||
} );
|
||||
} );
|
||||
} else {
|
||||
core.setFailed( 'No changes needed. WP Version is L-2 compatible.' );
|
||||
}
|
||||
} );
|
||||
|
||||
- name: Commit changes
|
||||
if: steps.readmeWPVersion.outputs.needsChange == 'true'
|
||||
run: git commit --no-verify -am "Update readme.txt WP L-2 support version."
|
||||
|
||||
- name: Push changes
|
||||
if: steps.readmeWPVersion.outputs.needsChange == 'true'
|
||||
run: git push origin WP-L-2-version-support-${{ steps.l2Version.outputs.version }}/${{ inputs.releaseBranch }}
|
||||
|
||||
- name: Push the PR up to GitHub
|
||||
id: release-branch-pr
|
||||
if: steps.readmeWPVersion.outputs.needsChange == 'true'
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: |
|
||||
const PRBody = "This PR bumps the WP version to L-2 compatible for the release branch ${{ inputs.releaseBranch }}.\n";
|
||||
|
||||
const pr = await github.rest.pulls.create( {
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
title: "Bump WP Version to L-2 compatible for ${{ inputs.releaseBranch }}",
|
||||
head: "WP-L-2-version-support-${{ steps.l2Version.outputs.version }}/${{ inputs.releaseBranch }}",
|
||||
base: "${{ inputs.releaseBranch }}",
|
||||
body: PRBody
|
||||
} );
|
||||
|
||||
if ( pr.status != 201 ) {
|
||||
core.setFailed( "Unable to push WP-L-2-version-support-${{ steps.l2Version.outputs.version }}/${{ inputs.releaseBranch }} to GitHub." );
|
||||
}
|
||||
|
||||
core.setOutput( 'pr', pr.data.number );
|
||||
|
||||
await github.rest.pulls.requestReviewers( {
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
pull_number: pr.data.number,
|
||||
reviewers: [ context.actor ]
|
||||
} );
|
||||
|
||||
- name: Checkout trunk branch
|
||||
if: steps.release-branch-pr.outputs.pr != '' && steps.release-branch-pr.outputs.pr != null
|
||||
run: git checkout trunk
|
||||
|
||||
- name: Create a branch based on trunk branch
|
||||
if: steps.release-branch-pr.outputs.pr != '' && steps.release-branch-pr.outputs.pr != null
|
||||
run: git checkout -b WP-L-2-version-support-${{ steps.l2Version.outputs.version }}/trunk
|
||||
|
||||
- name: Check if WP L-2 support needs to be bumped for trunk
|
||||
id: readmeWPVersionTrunk
|
||||
if: steps.release-branch-pr.outputs.pr != '' && steps.release-branch-pr.outputs.pr != null
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: |
|
||||
const fs = require( 'node:fs' );
|
||||
const l2Version = "${{ steps.l2Version.outputs.version }}";
|
||||
let readme = '';
|
||||
|
||||
fs.readFile( './plugins/woocommerce/readme.txt', 'utf-8', function( err, data ) {
|
||||
if ( err ) {
|
||||
console.error( err );
|
||||
}
|
||||
|
||||
readme = data.split( "\n" );
|
||||
const newReadme = [];
|
||||
let needsChange = false;
|
||||
|
||||
for ( const line of readme ) {
|
||||
if ( line.match( /Requires\sat\sleast:\s\d+\.\d/ ) ) {
|
||||
const readmeVersion = line.match( /\d+\.\d/ );
|
||||
|
||||
// If the versions don't match, means we need to make a change.
|
||||
if ( readmeVersion != l2Version ) {
|
||||
needsChange = true;
|
||||
|
||||
newReadme.push( 'Requires at least: ' + l2Version );
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
newReadme.push( line );
|
||||
}
|
||||
|
||||
if ( needsChange ) {
|
||||
fs.writeFile( './plugins/woocommerce/readme.txt', newReadme.join( "\n" ), err => {
|
||||
if ( err ) {
|
||||
core.setFailed( `Unable to bump the WP L-2 support version. ${err}` );
|
||||
}
|
||||
|
||||
core.setOutput( 'needsChange', needsChange );
|
||||
|
||||
// Copy the readme.txt file to the root of VM to be used later.
|
||||
fs.writeFile( '../../readme.txt', newReadme.join( "\n" ), err => {
|
||||
if ( err ) {
|
||||
core.setFailed( `Unable to copy the readme.txt file to the root of VM. ${err}` );
|
||||
}
|
||||
} );
|
||||
} );
|
||||
} else {
|
||||
core.setFailed( 'No changes needed. WP Version is L-2 compatible.' );
|
||||
}
|
||||
} );
|
||||
|
||||
- name: Commit changes
|
||||
if: steps.readmeWPVersionTrunk.outputs.needsChange == 'true'
|
||||
run: git commit --no-verify -am "Update readme.txt WP L-2 support version."
|
||||
|
||||
- name: Push changes
|
||||
if: steps.readmeWPVersionTrunk.outputs.needsChange == 'true'
|
||||
run: git push origin WP-L-2-version-support-${{ steps.l2Version.outputs.version }}/trunk
|
||||
|
||||
- name: Push the PR up to GitHub
|
||||
if: steps.readmeWPVersionTrunk.outputs.needsChange == 'true'
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: |
|
||||
const PRBody = "This PR bumps the WP version to L-2 compatible for trunk.\n";
|
||||
|
||||
const pr = await github.rest.pulls.create( {
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
title: "Bump WP Version to L-2 compatible for trunk",
|
||||
head: "WP-L-2-version-support-${{ steps.l2Version.outputs.version }}/trunk",
|
||||
base: "trunk",
|
||||
body: PRBody
|
||||
} );
|
||||
|
||||
if ( pr.status != 201 ) {
|
||||
core.setFailed( "Unable to push WP-L-2-version-support-${{ steps.l2Version.outputs.version }}/trunk to GitHub." );
|
||||
}
|
||||
|
||||
await github.rest.pulls.requestReviewers( {
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
pull_number: pr.data.number,
|
||||
reviewers: [ context.actor ]
|
||||
} );
|
|
@ -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'
|
||||
|
@ -30,321 +30,328 @@ env:
|
|||
GIT_AUTHOR_NAME: 'WooCommerce Bot'
|
||||
GIT_AUTHOR_EMAIL: 'no-reply@woocommerce.com'
|
||||
|
||||
permissions: {}
|
||||
|
||||
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
|
||||
permissions:
|
||||
actions: write
|
||||
contents: write
|
||||
pull-requests: write
|
||||
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 }}
|
||||
|
|
|
@ -12,11 +12,16 @@ defaults:
|
|||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: PHP ${{ matrix.php }} WP ${{ matrix.wp }}
|
||||
timeout-minutes: 30
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
contents: read
|
||||
continue-on-error: ${{ matrix.wp == 'nightly' }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
|
|
|
@ -1,38 +1,45 @@
|
|||
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
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
verify:
|
||||
name: Verify
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
verify:
|
||||
name: Verify
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
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 }}
|
||||
|
|
|
@ -8,10 +8,14 @@ concurrency:
|
|||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
cot-e2e-tests-run:
|
||||
name: Runs E2E tests with COT enabled.
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
contents: read
|
||||
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
|
||||
|
@ -66,6 +70,8 @@ jobs:
|
|||
cot-api-tests-run:
|
||||
name: Runs API tests with COT enabled.
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
contents: read
|
||||
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
|
||||
|
@ -124,6 +130,8 @@ jobs:
|
|||
contains( needs.*.result, 'failure' )
|
||||
)
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
contents: read
|
||||
needs: [cot-api-tests-run, cot-e2e-tests-run]
|
||||
steps:
|
||||
- name: Create dirs
|
||||
|
|
|
@ -8,11 +8,15 @@ concurrency:
|
|||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
cot-e2e-tests-run:
|
||||
name: Runs E2E tests with COT enabled.
|
||||
if: "${{ github.event_name == 'workflow_dispatch' || github.event.label.name == 'focus: custom order tables' }}"
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
contents: read
|
||||
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
|
||||
|
@ -68,6 +72,8 @@ jobs:
|
|||
name: Runs API tests with COT enabled.
|
||||
if: "${{ github.event_name == 'workflow_dispatch' || github.event.label.name == 'focus: custom order tables' }}"
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
contents: read
|
||||
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
|
||||
|
@ -126,6 +132,8 @@ jobs:
|
|||
contains( needs.*.result, 'failure' )
|
||||
)
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
contents: read
|
||||
needs: [cot-api-tests-run, cot-e2e-tests-run]
|
||||
steps:
|
||||
- name: Create dirs
|
||||
|
|
|
@ -4,11 +4,15 @@ on:
|
|||
branches: ["trunk", "release/**"]
|
||||
workflow_dispatch:
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
if: github.repository == 'woocommerce/woocommerce'
|
||||
name: Build WooCommerce zip
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
|
@ -35,6 +39,8 @@ jobs:
|
|||
name: Push to Mirror
|
||||
needs: [build]
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- name: Create directories
|
||||
run: |
|
||||
|
|
|
@ -3,6 +3,9 @@ on:
|
|||
schedule:
|
||||
- cron: '0 0 * * *' # Run at 12 AM UTC.
|
||||
workflow_dispatch:
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
if: github.repository_owner == 'woocommerce'
|
||||
|
@ -12,6 +15,8 @@ jobs:
|
|||
matrix:
|
||||
build: [trunk]
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
|
@ -40,6 +45,8 @@ jobs:
|
|||
update:
|
||||
name: Update nightly tag commit ref
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- name: Update nightly tag
|
||||
uses: richardsimko/github-tag-action@v1.0.5
|
||||
|
|
|
@ -6,10 +6,15 @@ on:
|
|||
description: 'Enter a specific package to release, or releases separated by commas, ie @woocommerce/components,@woocommerce/number. Leaving this input blank will release all eligible packages.'
|
||||
required: false
|
||||
default: '-a'
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
release:
|
||||
name: Run packages release script
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
name: Run post release processes
|
||||
on:
|
||||
release:
|
||||
types: [released]
|
||||
on:
|
||||
release:
|
||||
types: [released]
|
||||
|
||||
env:
|
||||
GIT_COMMITTER_NAME: 'WooCommerce Bot'
|
||||
|
@ -9,120 +9,125 @@ env:
|
|||
GIT_AUTHOR_NAME: 'WooCommerce Bot'
|
||||
GIT_AUTHOR_EMAIL: 'no-reply@woocommerce.com'
|
||||
|
||||
permissions: {}
|
||||
|
||||
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
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
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 }}"]
|
||||
})
|
||||
|
|
|
@ -7,13 +7,17 @@ concurrency:
|
|||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
e2e-tests-run:
|
||||
name: Runs E2E tests.
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
contents: read
|
||||
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:
|
||||
|
@ -79,9 +83,11 @@ jobs:
|
|||
api-tests-run:
|
||||
name: Runs API tests.
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
contents: read
|
||||
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
|
||||
|
||||
|
@ -129,6 +135,8 @@ jobs:
|
|||
k6-tests-run:
|
||||
name: Runs k6 Performance tests
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
|
@ -162,6 +170,10 @@ jobs:
|
|||
)
|
||||
runs-on: ubuntu-20.04
|
||||
needs: [api-tests-run, e2e-tests-run]
|
||||
permissions:
|
||||
contents: read
|
||||
issues: write
|
||||
pull-requests: write
|
||||
env:
|
||||
E2E_GRAND_TOTAL: ${{needs.e2e-tests-run.outputs.E2E_GRAND_TOTAL}}
|
||||
steps:
|
||||
|
|
|
@ -7,10 +7,14 @@ concurrency:
|
|||
group: build-${{ github.event_name == 'push' && github.run_id || 'pr' }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
if: github.repository_owner == 'woocommerce'
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
|
|
|
@ -8,11 +8,16 @@ defaults:
|
|||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Code coverage (PHP 7.4, WP Latest)
|
||||
timeout-minutes: 30
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
contents: read
|
||||
services:
|
||||
database:
|
||||
image: mysql:5.6
|
||||
|
|
|
@ -8,11 +8,16 @@ concurrency:
|
|||
cancel-in-progress: true
|
||||
env:
|
||||
PHPCS: ./plugins/woocommerce/vendor/bin/phpcs # Run WooCommerce phpcs setup in phpcs-changed instead of default
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Code sniff (PHP 7.4, WP Latest)
|
||||
timeout-minutes: 15
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
|
|
|
@ -1,9 +1,14 @@
|
|||
name: Highlight templates changes
|
||||
on: pull_request
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Check pull request changes to highlight
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
contents: read
|
||||
outputs:
|
||||
results: ${{ steps.results.outputs.results }}
|
||||
steps:
|
||||
|
|
|
@ -6,10 +6,15 @@ on:
|
|||
concurrency:
|
||||
group: changelogger-${{ github.event_name }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
changelogger_used:
|
||||
name: Changelogger use
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
contents: read
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
|
|
@ -5,10 +5,14 @@ concurrency:
|
|||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
lint-test-js:
|
||||
name: Lint and Test JS
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
|
|
|
@ -8,9 +8,14 @@ concurrency:
|
|||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
label_project:
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
steps:
|
||||
- uses: actions/labeler@v3
|
||||
with:
|
||||
|
|
|
@ -9,11 +9,16 @@ concurrency:
|
|||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
prcheck:
|
||||
name: Smoke test a pull request.
|
||||
if: "${{ contains(github.event.label.name, 'run: smoke tests') }}"
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
|
|
|
@ -8,11 +8,15 @@ concurrency:
|
|||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: PHP ${{ matrix.php }} WP ${{ matrix.wp }}
|
||||
timeout-minutes: 30
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
contents: read
|
||||
continue-on-error: ${{ matrix.wp == 'nightly' }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
|
|
|
@ -6,10 +6,16 @@ on:
|
|||
description: 'Enter a specific package to release, or packages separated by commas, ie @woocommerce/components,@woocommerce/number. Leaving this input to the default "-a" will prepare to release all eligible packages.'
|
||||
required: false
|
||||
default: '-a'
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
prepare:
|
||||
name: Run prepare script
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
|
|
|
@ -9,10 +9,14 @@ concurrency:
|
|||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
prime:
|
||||
name: Prime cache
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
|
|
|
@ -3,11 +3,15 @@ on:
|
|||
pull_request_target:
|
||||
types: [closed]
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
process-pull-request-after-merge:
|
||||
name: "Process a pull request after it's merged"
|
||||
if: github.event.pull_request.merged == true
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
pull-requests: write
|
||||
steps:
|
||||
- name: "Get the action scripts"
|
||||
run: |
|
||||
|
|
|
@ -15,9 +15,14 @@ env:
|
|||
GIT_AUTHOR_NAME: 'WooCommerce Bot'
|
||||
GIT_AUTHOR_EMAIL: 'no-reply@woocommerce.com'
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
create-changelog-prs:
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
|
|
@ -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:
|
||||
|
@ -20,6 +20,8 @@ env:
|
|||
GIT_AUTHOR_NAME: 'WooCommerce Bot'
|
||||
GIT_AUTHOR_EMAIL: 'no-reply@woocommerce.com'
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
verify-code-freeze:
|
||||
name: 'Verify that today is the day of the code freeze'
|
||||
|
@ -42,12 +44,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 {
|
||||
|
@ -57,6 +59,8 @@ jobs:
|
|||
maybe-create-next-milestone-and-release-branch:
|
||||
name: 'Maybe create next milestone and release branch'
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
contents: read
|
||||
needs: verify-code-freeze
|
||||
if: needs.verify-code-freeze.outputs.freeze == 0
|
||||
outputs:
|
||||
|
@ -84,6 +88,9 @@ jobs:
|
|||
prep-trunk:
|
||||
name: Preps trunk for next development cycle
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
needs: maybe-create-next-milestone-and-release-branch
|
||||
steps:
|
||||
- name: Checkout code
|
||||
|
@ -151,6 +158,8 @@ jobs:
|
|||
trigger-changelog-action:
|
||||
name: 'Trigger changelog action'
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
actions: write
|
||||
needs: maybe-create-next-milestone-and-release-branch
|
||||
steps:
|
||||
- name: 'Trigger changelog action'
|
||||
|
@ -163,7 +172,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 }}"
|
||||
}
|
||||
})
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
// phpcs:ignoreFile
|
||||
/**
|
||||
* Script to automatically enforce the release code freeze.
|
||||
*
|
||||
|
@ -12,14 +13,24 @@ if ( getenv( 'TIME_OVERRIDE' ) ) {
|
|||
$now = strtotime( getenv( 'TIME_OVERRIDE' ) );
|
||||
}
|
||||
|
||||
// Code freeze comes 26 days prior to release day.
|
||||
$release_time = strtotime( '+26 days', $now );
|
||||
/**
|
||||
* Set an output for the GitHub action.
|
||||
*
|
||||
* @param string $name The name of the output.
|
||||
* @param string $value The value of the output.
|
||||
*/
|
||||
function set_output( $name, $value ) {
|
||||
file_put_contents( getenv( 'GITHUB_OUTPUT' ), "{$name}={$value}" . PHP_EOL, FILE_APPEND );
|
||||
}
|
||||
|
||||
// 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 );
|
||||
}
|
||||
|
||||
|
@ -41,10 +52,11 @@ $milestone_to_create = "{$milestone_major_minor}.0";
|
|||
|
||||
if ( getenv( 'GITHUB_OUTPUTS' ) ) {
|
||||
echo 'Including GitHub Outputs...' . PHP_EOL;
|
||||
echo '::set-output name=next_version::' . $milestone_major_minor . PHP_EOL;
|
||||
echo '::set-output name=release_version::' . $branch_major_minor . PHP_EOL;
|
||||
echo '::set-output name=branch::' . $release_branch_to_create . PHP_EOL;
|
||||
echo '::set-output name=milestone::' . $milestone_to_create . PHP_EOL;
|
||||
|
||||
set_output( 'next_version', $milestone_major_minor );
|
||||
set_output( 'release_version', $branch_major_minor );
|
||||
set_output( 'branch', $release_branch_to_create );
|
||||
set_output( 'milestone', $milestone_to_create );
|
||||
}
|
||||
|
||||
if ( getenv( 'DRY_RUN' ) ) {
|
||||
|
@ -56,7 +68,7 @@ if ( getenv( 'DRY_RUN' ) ) {
|
|||
|
||||
if ( create_github_milestone( $milestone_to_create ) ) {
|
||||
echo "Created milestone {$milestone_to_create}" . PHP_EOL;
|
||||
} else if ( '422' === $github_api_response_code ) {
|
||||
} elseif ( '422' === $github_api_response_code ) {
|
||||
// The milestone already existed when GitHub returns a 422 status.
|
||||
echo "Notice: Unable to create {$milestone_to_create} milestone. Maybe it already exists? Skipping..." . PHP_EOL;
|
||||
} else {
|
||||
|
@ -65,7 +77,7 @@ if ( create_github_milestone( $milestone_to_create ) ) {
|
|||
|
||||
if ( create_github_branch_from_branch( 'trunk', $release_branch_to_create ) ) {
|
||||
echo "Created branch {$release_branch_to_create}" . PHP_EOL;
|
||||
} else if ( '422' === $github_api_response_code ) {
|
||||
} elseif ( '422' === $github_api_response_code ) {
|
||||
// The release branch already existed when GitHub returns a 422 status.
|
||||
echo "Notice: Unable to create {$release_branch_to_create} branch. Maybe it already exists? Skipping..." . PHP_EOL;
|
||||
exit( 1 );
|
||||
|
|
|
@ -3,6 +3,8 @@ on:
|
|||
schedule:
|
||||
- cron: '25 7 * * *'
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
ping_site:
|
||||
runs-on: ubuntu-20.04
|
||||
|
|
|
@ -14,10 +14,14 @@ concurrency:
|
|||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
e2e-tests:
|
||||
name: E2E tests on nightly build
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
contents: read
|
||||
env:
|
||||
ADMIN_PASSWORD: ${{ secrets.SMOKE_TEST_ADMIN_PASSWORD }}
|
||||
ADMIN_USER: ${{ secrets.SMOKE_TEST_ADMIN_USER }}
|
||||
|
@ -55,7 +59,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()
|
||||
|
@ -76,11 +81,13 @@ jobs:
|
|||
api-tests:
|
||||
name: API tests on nightly build
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
contents: read
|
||||
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:
|
||||
|
@ -120,6 +127,8 @@ jobs:
|
|||
k6-tests:
|
||||
name: k6 tests on nightly build
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
contents: read
|
||||
needs: [api-tests]
|
||||
if: success() || failure()
|
||||
steps:
|
||||
|
@ -163,13 +172,15 @@ 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
|
||||
|
||||
test-plugins:
|
||||
name: Smoke tests on trunk with ${{ matrix.plugin }} plugin installed
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
contents: read
|
||||
env:
|
||||
USE_WP_ENV: 1
|
||||
ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/allure-results
|
||||
|
@ -219,7 +230,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()
|
||||
|
@ -243,6 +254,8 @@ jobs:
|
|||
( success() || failure() ) &&
|
||||
! github.event.pull_request.head.repo.fork
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
contents: read
|
||||
needs: [test-plugins, k6-tests]
|
||||
steps:
|
||||
- name: Create dirs
|
||||
|
|
|
@ -5,10 +5,15 @@ on:
|
|||
release_id:
|
||||
description: 'WooCommerce Release Id'
|
||||
required: true
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
login-run:
|
||||
name: Daily smoke test on release.
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
|
@ -49,6 +54,8 @@ jobs:
|
|||
test-wp-version:
|
||||
name: Smoke test on L-${{ matrix.wp }} WordPress version
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
contents: read
|
||||
strategy:
|
||||
matrix:
|
||||
wp: ['1', '2']
|
||||
|
@ -104,6 +111,8 @@ jobs:
|
|||
test-plugins:
|
||||
name: Smoke tests with ${{ matrix.plugin }} plugin installed
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
contents: read
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
|
|
|
@ -3,11 +3,17 @@ on:
|
|||
schedule:
|
||||
- cron: '21 0 * * *'
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
if: |
|
||||
! contains(github.event.issue.labels.*.name, 'type: enhancement')
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
contents: read
|
||||
issues: write
|
||||
pull-requests: write
|
||||
steps:
|
||||
- uses: actions/stale@v3
|
||||
with:
|
||||
|
|
|
@ -6,9 +6,14 @@ on:
|
|||
- trunk
|
||||
paths:
|
||||
- '**/package.json'
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
syncpack:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
name: syncpack
|
||||
steps:
|
||||
- name: 'Checkout'
|
||||
|
|
|
@ -4,9 +4,14 @@ on:
|
|||
issues:
|
||||
types: opened
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
add_label:
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
contents: read
|
||||
issues: write
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions-ecosystem/action-add-labels@v1
|
||||
|
|
|
@ -3,6 +3,9 @@ on:
|
|||
issues:
|
||||
types:
|
||||
- labeled
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
add-dev-comment:
|
||||
if: "github.event.label.name == 'needs: developer feedback'"
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
name: 'Update contributor feedback labels on comment'
|
||||
on: 'issue_comment'
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
feedback:
|
||||
if: |
|
||||
|
@ -10,6 +12,8 @@ jobs:
|
|||
github.event.issue.state == 'open' &&
|
||||
contains(github.event.issue.labels.*.name, 'needs: author feedback')
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
issues: write
|
||||
steps:
|
||||
- name: Add has feedback
|
||||
uses: actions-ecosystem/action-add-labels@v1
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
249
changelog.txt
249
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**
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
"scripts": {
|
||||
"build": "pnpm exec turbo run turbo:build",
|
||||
"test": "pnpm exec turbo run turbo:test",
|
||||
"clean": "pnpm store prune && git clean -fx **/node_modules && pnpm i",
|
||||
"preinstall": "npx only-allow pnpm",
|
||||
"postinstall": "pnpm git:update-hooks",
|
||||
"git:update-hooks": "rm -r .git/hooks && mkdir -p .git/hooks && husky install",
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
Significance: patch
|
||||
Type: fix
|
||||
Comment: Dev dependency update.
|
||||
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
"license": "GPL-3.0-or-later",
|
||||
"minimum-stability": "dev",
|
||||
"require-dev": {
|
||||
"automattic/jetpack-changelogger": "3.1.3"
|
||||
"automattic/jetpack-changelogger": "3.3.0"
|
||||
},
|
||||
"config": {
|
||||
"platform": {
|
||||
|
|
|
@ -4,32 +4,32 @@
|
|||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "cae17ca18e2a2a6cefe200df88081346",
|
||||
"content-hash": "959b38edbc3ae0c3853c02e86852f583",
|
||||
"packages": [],
|
||||
"packages-dev": [
|
||||
{
|
||||
"name": "automattic/jetpack-changelogger",
|
||||
"version": "v3.1.3",
|
||||
"version": "v3.3.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Automattic/jetpack-changelogger.git",
|
||||
"reference": "cdd256d8ba6369f82d9377de7e9e2598e3e16ae0"
|
||||
"reference": "8f63c829b8d1b0d7b1d5de93510d78523ed18959"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/Automattic/jetpack-changelogger/zipball/cdd256d8ba6369f82d9377de7e9e2598e3e16ae0",
|
||||
"reference": "cdd256d8ba6369f82d9377de7e9e2598e3e16ae0",
|
||||
"url": "https://api.github.com/repos/Automattic/jetpack-changelogger/zipball/8f63c829b8d1b0d7b1d5de93510d78523ed18959",
|
||||
"reference": "8f63c829b8d1b0d7b1d5de93510d78523ed18959",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.6",
|
||||
"symfony/console": "^3.4 || ^5.2",
|
||||
"symfony/process": "^3.4 || ^5.2",
|
||||
"symfony/console": "^3.4 || ^5.2 || ^6.0",
|
||||
"symfony/process": "^3.4 || ^5.2 || ^6.0",
|
||||
"wikimedia/at-ease": "^1.2 || ^2.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"wikimedia/testing-access-wrapper": "^1.0 || ^2.0",
|
||||
"yoast/phpunit-polyfills": "1.0.3"
|
||||
"yoast/phpunit-polyfills": "1.0.4"
|
||||
},
|
||||
"bin": [
|
||||
"bin/changelogger"
|
||||
|
@ -38,7 +38,7 @@
|
|||
"extra": {
|
||||
"autotagger": true,
|
||||
"branch-alias": {
|
||||
"dev-trunk": "3.1.x-dev"
|
||||
"dev-trunk": "3.3.x-dev"
|
||||
},
|
||||
"mirror-repo": "Automattic/jetpack-changelogger",
|
||||
"version-constants": {
|
||||
|
@ -60,9 +60,9 @@
|
|||
],
|
||||
"description": "Jetpack Changelogger tool. Allows for managing changelogs by dropping change files into a changelog directory with each PR.",
|
||||
"support": {
|
||||
"source": "https://github.com/Automattic/jetpack-changelogger/tree/v3.1.3"
|
||||
"source": "https://github.com/Automattic/jetpack-changelogger/tree/v3.3.0"
|
||||
},
|
||||
"time": "2022-06-21T07:31:56+00:00"
|
||||
"time": "2022-12-26T13:49:01+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/log",
|
||||
|
@ -204,12 +204,12 @@
|
|||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/debug.git",
|
||||
"reference": "6637e62480b60817b9a6984154a533e8e64c6bd5"
|
||||
"reference": "1a692492190773c5310bc7877cb590c04c2f05be"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/debug/zipball/6637e62480b60817b9a6984154a533e8e64c6bd5",
|
||||
"reference": "6637e62480b60817b9a6984154a533e8e64c6bd5",
|
||||
"url": "https://api.github.com/repos/symfony/debug/zipball/1a692492190773c5310bc7877cb590c04c2f05be",
|
||||
"reference": "1a692492190773c5310bc7877cb590c04c2f05be",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -249,7 +249,7 @@
|
|||
"description": "Provides tools to ease debugging PHP code",
|
||||
"homepage": "https://symfony.com",
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/debug/tree/v4.4.41"
|
||||
"source": "https://github.com/symfony/debug/tree/v4.4.44"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
@ -266,7 +266,7 @@
|
|||
}
|
||||
],
|
||||
"abandoned": "symfony/error-handler",
|
||||
"time": "2022-04-12T15:19:55+00:00"
|
||||
"time": "2022-07-28T16:29:46+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-mbstring",
|
||||
|
@ -274,12 +274,12 @@
|
|||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-mbstring.git",
|
||||
"reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e"
|
||||
"reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
|
||||
"reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
|
||||
"reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -295,7 +295,7 @@
|
|||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "1.26-dev"
|
||||
"dev-main": "1.27-dev"
|
||||
},
|
||||
"thanks": {
|
||||
"name": "symfony/polyfill",
|
||||
|
@ -334,7 +334,7 @@
|
|||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0"
|
||||
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
@ -350,7 +350,7 @@
|
|||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2022-05-24T11:49:31+00:00"
|
||||
"time": "2022-11-03T14:55:06+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/process",
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
Significance: patch
|
||||
Type: fix
|
||||
Comment: Dev dependency update.
|
||||
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
"license": "GPL-3.0-or-later",
|
||||
"minimum-stability": "dev",
|
||||
"require-dev": {
|
||||
"automattic/jetpack-changelogger": "3.1.3"
|
||||
"automattic/jetpack-changelogger": "3.3.0"
|
||||
},
|
||||
"config": {
|
||||
"platform": {
|
||||
|
|
|
@ -4,32 +4,32 @@
|
|||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "2ac4a9ea3ab4687cb26b0075128628de",
|
||||
"content-hash": "8cdc2ba8c2e8669b3d48cf7e4cb3c379",
|
||||
"packages": [],
|
||||
"packages-dev": [
|
||||
{
|
||||
"name": "automattic/jetpack-changelogger",
|
||||
"version": "v3.1.3",
|
||||
"version": "v3.3.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Automattic/jetpack-changelogger.git",
|
||||
"reference": "cdd256d8ba6369f82d9377de7e9e2598e3e16ae0"
|
||||
"reference": "8f63c829b8d1b0d7b1d5de93510d78523ed18959"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/Automattic/jetpack-changelogger/zipball/cdd256d8ba6369f82d9377de7e9e2598e3e16ae0",
|
||||
"reference": "cdd256d8ba6369f82d9377de7e9e2598e3e16ae0",
|
||||
"url": "https://api.github.com/repos/Automattic/jetpack-changelogger/zipball/8f63c829b8d1b0d7b1d5de93510d78523ed18959",
|
||||
"reference": "8f63c829b8d1b0d7b1d5de93510d78523ed18959",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.6",
|
||||
"symfony/console": "^3.4 || ^5.2",
|
||||
"symfony/process": "^3.4 || ^5.2",
|
||||
"symfony/console": "^3.4 || ^5.2 || ^6.0",
|
||||
"symfony/process": "^3.4 || ^5.2 || ^6.0",
|
||||
"wikimedia/at-ease": "^1.2 || ^2.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"wikimedia/testing-access-wrapper": "^1.0 || ^2.0",
|
||||
"yoast/phpunit-polyfills": "1.0.3"
|
||||
"yoast/phpunit-polyfills": "1.0.4"
|
||||
},
|
||||
"bin": [
|
||||
"bin/changelogger"
|
||||
|
@ -38,7 +38,7 @@
|
|||
"extra": {
|
||||
"autotagger": true,
|
||||
"branch-alias": {
|
||||
"dev-trunk": "3.1.x-dev"
|
||||
"dev-trunk": "3.3.x-dev"
|
||||
},
|
||||
"mirror-repo": "Automattic/jetpack-changelogger",
|
||||
"version-constants": {
|
||||
|
@ -60,9 +60,9 @@
|
|||
],
|
||||
"description": "Jetpack Changelogger tool. Allows for managing changelogs by dropping change files into a changelog directory with each PR.",
|
||||
"support": {
|
||||
"source": "https://github.com/Automattic/jetpack-changelogger/tree/v3.1.3"
|
||||
"source": "https://github.com/Automattic/jetpack-changelogger/tree/v3.3.0"
|
||||
},
|
||||
"time": "2022-06-21T07:31:56+00:00"
|
||||
"time": "2022-12-26T13:49:01+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/log",
|
||||
|
@ -204,12 +204,12 @@
|
|||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/debug.git",
|
||||
"reference": "6637e62480b60817b9a6984154a533e8e64c6bd5"
|
||||
"reference": "1a692492190773c5310bc7877cb590c04c2f05be"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/debug/zipball/6637e62480b60817b9a6984154a533e8e64c6bd5",
|
||||
"reference": "6637e62480b60817b9a6984154a533e8e64c6bd5",
|
||||
"url": "https://api.github.com/repos/symfony/debug/zipball/1a692492190773c5310bc7877cb590c04c2f05be",
|
||||
"reference": "1a692492190773c5310bc7877cb590c04c2f05be",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -249,7 +249,7 @@
|
|||
"description": "Provides tools to ease debugging PHP code",
|
||||
"homepage": "https://symfony.com",
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/debug/tree/v4.4.41"
|
||||
"source": "https://github.com/symfony/debug/tree/v4.4.44"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
@ -266,7 +266,7 @@
|
|||
}
|
||||
],
|
||||
"abandoned": "symfony/error-handler",
|
||||
"time": "2022-04-12T15:19:55+00:00"
|
||||
"time": "2022-07-28T16:29:46+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-mbstring",
|
||||
|
@ -274,12 +274,12 @@
|
|||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-mbstring.git",
|
||||
"reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e"
|
||||
"reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
|
||||
"reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
|
||||
"reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -295,7 +295,7 @@
|
|||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "1.26-dev"
|
||||
"dev-main": "1.27-dev"
|
||||
},
|
||||
"thanks": {
|
||||
"name": "symfony/polyfill",
|
||||
|
@ -334,7 +334,7 @@
|
|||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0"
|
||||
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
@ -350,7 +350,7 @@
|
|||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2022-05-24T11:49:31+00:00"
|
||||
"time": "2022-11-03T14:55:06+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/process",
|
||||
|
|
|
@ -2,6 +2,41 @@
|
|||
|
||||
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [12.0.0](https://www.npmjs.com/package/@woocommerce/components/v/12.0.0) - 2022-12-28
|
||||
|
||||
- Patch - Add name to exported popover slot used to display SelectControl Menu, so it is only used for SelectControl menus. [#36124]
|
||||
- Patch - Close DateTimePickerControl's dropdown when blurring from input. [#36124]
|
||||
- Patch - DateTimePickerControl's onChange now only fires when there is an actual change to the datetime. [#36124]
|
||||
- Patch - Fix DateTimePickerControl's popover styling when slot-fill is used. [#36124]
|
||||
- Patch - Fixed DatePicker to work in WordPress 6.1 when currentDate is set to a moment instance. [#36124]
|
||||
- Patch - Fix pagination label text from uppercase to normal and font styles [#36124]
|
||||
- Patch - Include react-dates styles (no longer in WP 6.1+). [#36124]
|
||||
- Minor - Set editor mode on initialization to prevent initial text editor focus [#36124]
|
||||
- Patch - Set initial values prop from reset form function as optional [#36124]
|
||||
- Patch - Add aria-label for simple select dropdown [#36124]
|
||||
- Patch - Add async filtering support to the `__experimentalSelectControl` component [#36124]
|
||||
- Minor - Add className prop to ListItem. [#36124]
|
||||
- Minor - Add className prop to Sortable [#36124]
|
||||
- Minor - Added ability to force time when DateTimePickerControl is date-only (timeForDateOnly prop). [#36124]
|
||||
- Minor - Add experimental ConditionalWrapper component [#36124]
|
||||
- Patch - Add experimental open menu when user focus the select control input element [#36124]
|
||||
- Minor - Adding isHidden option for primary button in TourKit component. [#36124]
|
||||
- Minor - Add support for custom suffix prop on SelectControl. [#36124]
|
||||
- Minor - Make Table component accept className prop. [#36124]
|
||||
- Minor - Move classname down in SelectControl Menu so it is on the actual Menu element. [#36124]
|
||||
- Major [ **BREAKING CHANGE** ] - Switch DateTimePickerControl formatting to PHP style, for WP compatibility. [#36124]
|
||||
- Patch - Updating downshift to 6.1.12. [#36124]
|
||||
- Minor - Allow the user to select multiple images in the Media Library [#36124]
|
||||
- Patch - Migrate search component to TS [#36124]
|
||||
- Minor - Move file picker by clicking card into the MediaUploader component [#36124]
|
||||
- Minor - Fix up initial block selection in RichTextEditor and add media blocks [#36124]
|
||||
- Patch - Updated image gallery toolbar position and tooltips. [#36124]
|
||||
- Patch - Update variable name within useFormContext. [#36124]
|
||||
- Minor - Add noDataLabel property into table.js component to allow No Data label customization. [#36124]
|
||||
- Patch - Align the field height across the whole form [#36124]
|
||||
- Patch - Fade the value selection field in the Attributes modal when no attribute is added [#36124]
|
||||
- Patch - Update font size and spacing in the tooltip component [#36124]
|
||||
|
||||
## [11.1.0](https://www.npmjs.com/package/@woocommerce/components/v/11.1.0) - 2022-10-24
|
||||
|
||||
- Minor - Allow passing of additional props to form inputs [#35160]
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
Significance: patch
|
||||
Type: update
|
||||
|
||||
Updating downshift to 6.1.12.
|
|
@ -1,4 +0,0 @@
|
|||
Significance: minor
|
||||
Type: update
|
||||
|
||||
Move classname down in SelectControl Menu so it is on the actual Menu element.
|
|
@ -1,4 +0,0 @@
|
|||
Significance: minor
|
||||
Type: add
|
||||
|
||||
Add experimental ConditionalWrapper component
|
|
@ -1,4 +0,0 @@
|
|||
Significance: patch
|
||||
Type: add
|
||||
|
||||
Add async filtering support to the `__experimentalSelectControl` component
|
|
@ -1,4 +0,0 @@
|
|||
Significance: patch
|
||||
Type: add
|
||||
|
||||
Add experimental open menu when user focus the select control input element
|
|
@ -1,4 +0,0 @@
|
|||
Significance: minor
|
||||
Type: dev
|
||||
|
||||
Allow the user to select multiple images in the Media Library
|
|
@ -1,4 +0,0 @@
|
|||
Significance: minor
|
||||
Type: add
|
||||
|
||||
Add support for custom suffix prop on SelectControl.
|
|
@ -1,4 +0,0 @@
|
|||
Significance: minor
|
||||
Type: dev
|
||||
|
||||
Move file picker by clicking card into the MediaUploader component
|
|
@ -1,4 +1,4 @@
|
|||
Significance: patch
|
||||
Type: dev
|
||||
|
||||
Migrate search component to TS
|
||||
Migrate Tag component to TS
|
|
@ -1,4 +0,0 @@
|
|||
Significance: patch
|
||||
Type: enhancement
|
||||
|
||||
Update font size and spacing in the tooltip component
|
|
@ -1,4 +0,0 @@
|
|||
Significance: patch
|
||||
Type: enhancement
|
||||
|
||||
Align the field height across the whole form
|
|
@ -1,4 +0,0 @@
|
|||
Significance: patch
|
||||
Type: enhancement
|
||||
|
||||
Fade the value selection field in the Attributes modal when no attribute is added
|
|
@ -1,4 +0,0 @@
|
|||
Significance: minor
|
||||
Type: fix
|
||||
|
||||
Set editor mode on initialization to prevent initial text editor focus
|
|
@ -0,0 +1,4 @@
|
|||
Significance: minor
|
||||
Type: fix
|
||||
|
||||
Fix SortableItem duplicated id
|
|
@ -1,4 +0,0 @@
|
|||
Significance: patch
|
||||
Type: fix
|
||||
|
||||
Include react-dates styles (no longer in WP 6.1+).
|
|
@ -1,4 +0,0 @@
|
|||
Significance: patch
|
||||
Type: fix
|
||||
|
||||
Close DateTimePickerControl's dropdown when blurring from input.
|
|
@ -1,4 +0,0 @@
|
|||
Significance: patch
|
||||
Type: fix
|
||||
|
||||
DateTimePickerControl's onChange now only fires when there is an actual change to the datetime.
|
|
@ -1,5 +0,0 @@
|
|||
Significance: patch
|
||||
Type: fix
|
||||
Comment: Just a minor tweak to the CSS for the DateTimePickerControl suffix.
|
||||
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
Significance: patch
|
||||
Type: fix
|
||||
|
||||
Fixed DatePicker to work in WordPress 6.1 when currentDate is set to a moment instance.
|
|
@ -1,4 +0,0 @@
|
|||
Significance: patch
|
||||
Type: tweak
|
||||
|
||||
Update variable name within useFormContext.
|
|
@ -1,4 +0,0 @@
|
|||
Significance: patch
|
||||
Type: tweak
|
||||
|
||||
Updated image gallery toolbar position and tooltips.
|
|
@ -1,4 +0,0 @@
|
|||
Significance: minor
|
||||
Type: tweak
|
||||
|
||||
Fix up initial block selection in RichTextEditor and add media blocks
|
|
@ -1,4 +0,0 @@
|
|||
Significance: patch
|
||||
Type: fix
|
||||
|
||||
Add name to exported popover slot used to display SelectControl Menu, so it is only used for SelectControl menus.
|
|
@ -1,4 +0,0 @@
|
|||
Significance: patch
|
||||
Type: fix
|
||||
|
||||
Set initial values prop from reset form function as optional
|
|
@ -0,0 +1,5 @@
|
|||
Significance: patch
|
||||
Type: fix
|
||||
Comment: Dev dependency update.
|
||||
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
Significance: minor
|
||||
Type: add
|
||||
|
||||
Added ability to force time when DateTimePickerControl is date-only (timeForDateOnly prop).
|
|
@ -1,4 +0,0 @@
|
|||
Significance: major
|
||||
Type: update
|
||||
|
||||
Switch DateTimePickerControl formatting to PHP style, for WP compatibility.
|
|
@ -1,4 +0,0 @@
|
|||
Significance: patch
|
||||
Type: fix
|
||||
|
||||
Fix DateTimePickerControl's popover styling when slot-fill is used.
|
|
@ -5,7 +5,7 @@
|
|||
"license": "GPL-3.0-or-later",
|
||||
"minimum-stability": "dev",
|
||||
"require-dev": {
|
||||
"automattic/jetpack-changelogger": "3.1.3"
|
||||
"automattic/jetpack-changelogger": "3.3.0"
|
||||
},
|
||||
"config": {
|
||||
"platform": {
|
||||
|
|
|
@ -4,32 +4,32 @@
|
|||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "75af54f4e83b1e2c7c96371c3288e355",
|
||||
"content-hash": "0e715b7322bdb353060f76a3279195e1",
|
||||
"packages": [],
|
||||
"packages-dev": [
|
||||
{
|
||||
"name": "automattic/jetpack-changelogger",
|
||||
"version": "v3.1.3",
|
||||
"version": "v3.3.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Automattic/jetpack-changelogger.git",
|
||||
"reference": "cdd256d8ba6369f82d9377de7e9e2598e3e16ae0"
|
||||
"reference": "8f63c829b8d1b0d7b1d5de93510d78523ed18959"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/Automattic/jetpack-changelogger/zipball/cdd256d8ba6369f82d9377de7e9e2598e3e16ae0",
|
||||
"reference": "cdd256d8ba6369f82d9377de7e9e2598e3e16ae0",
|
||||
"url": "https://api.github.com/repos/Automattic/jetpack-changelogger/zipball/8f63c829b8d1b0d7b1d5de93510d78523ed18959",
|
||||
"reference": "8f63c829b8d1b0d7b1d5de93510d78523ed18959",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.6",
|
||||
"symfony/console": "^3.4 || ^5.2",
|
||||
"symfony/process": "^3.4 || ^5.2",
|
||||
"symfony/console": "^3.4 || ^5.2 || ^6.0",
|
||||
"symfony/process": "^3.4 || ^5.2 || ^6.0",
|
||||
"wikimedia/at-ease": "^1.2 || ^2.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"wikimedia/testing-access-wrapper": "^1.0 || ^2.0",
|
||||
"yoast/phpunit-polyfills": "1.0.3"
|
||||
"yoast/phpunit-polyfills": "1.0.4"
|
||||
},
|
||||
"bin": [
|
||||
"bin/changelogger"
|
||||
|
@ -38,7 +38,7 @@
|
|||
"extra": {
|
||||
"autotagger": true,
|
||||
"branch-alias": {
|
||||
"dev-trunk": "3.1.x-dev"
|
||||
"dev-trunk": "3.3.x-dev"
|
||||
},
|
||||
"mirror-repo": "Automattic/jetpack-changelogger",
|
||||
"version-constants": {
|
||||
|
@ -60,9 +60,9 @@
|
|||
],
|
||||
"description": "Jetpack Changelogger tool. Allows for managing changelogs by dropping change files into a changelog directory with each PR.",
|
||||
"support": {
|
||||
"source": "https://github.com/Automattic/jetpack-changelogger/tree/v3.1.3"
|
||||
"source": "https://github.com/Automattic/jetpack-changelogger/tree/v3.3.0"
|
||||
},
|
||||
"time": "2022-06-21T07:31:56+00:00"
|
||||
"time": "2022-12-26T13:49:01+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/log",
|
||||
|
@ -204,12 +204,12 @@
|
|||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/debug.git",
|
||||
"reference": "6637e62480b60817b9a6984154a533e8e64c6bd5"
|
||||
"reference": "1a692492190773c5310bc7877cb590c04c2f05be"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/debug/zipball/6637e62480b60817b9a6984154a533e8e64c6bd5",
|
||||
"reference": "6637e62480b60817b9a6984154a533e8e64c6bd5",
|
||||
"url": "https://api.github.com/repos/symfony/debug/zipball/1a692492190773c5310bc7877cb590c04c2f05be",
|
||||
"reference": "1a692492190773c5310bc7877cb590c04c2f05be",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -249,7 +249,7 @@
|
|||
"description": "Provides tools to ease debugging PHP code",
|
||||
"homepage": "https://symfony.com",
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/debug/tree/v4.4.41"
|
||||
"source": "https://github.com/symfony/debug/tree/v4.4.44"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
@ -266,7 +266,7 @@
|
|||
}
|
||||
],
|
||||
"abandoned": "symfony/error-handler",
|
||||
"time": "2022-04-12T15:19:55+00:00"
|
||||
"time": "2022-07-28T16:29:46+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-mbstring",
|
||||
|
@ -274,12 +274,12 @@
|
|||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-mbstring.git",
|
||||
"reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e"
|
||||
"reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
|
||||
"reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
|
||||
"reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -295,7 +295,7 @@
|
|||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "1.26-dev"
|
||||
"dev-main": "1.27-dev"
|
||||
},
|
||||
"thanks": {
|
||||
"name": "symfony/polyfill",
|
||||
|
@ -334,7 +334,7 @@
|
|||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0"
|
||||
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
@ -350,7 +350,7 @@
|
|||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2022-05-24T11:49:31+00:00"
|
||||
"time": "2022-11-03T14:55:06+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/process",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@woocommerce/components",
|
||||
"version": "11.1.0",
|
||||
"version": "12.0.0",
|
||||
"description": "UI components for WooCommerce.",
|
||||
"author": "Automattic",
|
||||
"license": "GPL-3.0-or-later",
|
||||
|
@ -118,6 +118,7 @@
|
|||
"@types/prop-types": "^15.7.4",
|
||||
"@types/react": "^17.0.2",
|
||||
"@types/testing-library__jest-dom": "^5.14.3",
|
||||
"@types/uuid": "^8.3.0",
|
||||
"@types/wordpress__components": "^19.10.1",
|
||||
"@types/wordpress__data": "^6.0.0",
|
||||
"@types/wordpress__media-utils": "^3.0.0",
|
||||
|
@ -137,6 +138,7 @@
|
|||
"sass-loader": "^10.2.1",
|
||||
"ts-jest": "^27.1.3",
|
||||
"typescript": "^4.8.3",
|
||||
"uuid": "^8.3.0",
|
||||
"webpack": "^5.70.0",
|
||||
"webpack-cli": "^3.3.12"
|
||||
},
|
||||
|
|
|
@ -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 (
|
||||
<div className={ classnames( 'woocommerce-list-item' ) }>
|
||||
<div className={ classnames( 'woocommerce-list-item', className ) }>
|
||||
{ isDraggable && <SortableHandle /> }
|
||||
{ children }
|
||||
</div>
|
||||
|
|
|
@ -100,6 +100,12 @@
|
|||
.components-base-control__label {
|
||||
margin-right: math.div($spacing, 2);
|
||||
}
|
||||
|
||||
label.components-input-control__label {
|
||||
@include font-size(13, 18px);
|
||||
font-weight: 400;
|
||||
text-transform: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -154,6 +154,7 @@ class Control extends Component {
|
|||
: null
|
||||
}
|
||||
disabled={ disabled }
|
||||
aria-label={ this.props.ariaLabel ?? this.props.label }
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ import {
|
|||
import { DragEvent, DragEventHandler, KeyboardEvent } from 'react';
|
||||
import { speak } from '@wordpress/a11y';
|
||||
import { throttle } from 'lodash';
|
||||
import { v4 } from 'uuid';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
|
@ -265,7 +266,7 @@ export const Sortable = ( {
|
|||
<SortableItem
|
||||
key={ child.key || index }
|
||||
className={ itemClasses }
|
||||
id={ index }
|
||||
id={ `${ index }-${ v4() }` }
|
||||
index={ index }
|
||||
isDragging={ isDragging }
|
||||
isSelected={ selectedIndex === index }
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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 }
|
||||
/>
|
||||
) }
|
||||
</CardBody>
|
||||
|
@ -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;
|
||||
|
|
|
@ -25,7 +25,7 @@ class TablePlaceholder extends Component {
|
|||
return (
|
||||
<Table
|
||||
ariaHidden={ true }
|
||||
classNames="is-loading"
|
||||
className="is-loading"
|
||||
rows={ rows }
|
||||
{ ...tableProps }
|
||||
/>
|
||||
|
|
|
@ -20,6 +20,18 @@ export const Basic = () => (
|
|||
</Card>
|
||||
);
|
||||
|
||||
export const NoDataCustomMessage = () => (
|
||||
<Card size={ null }>
|
||||
<Table
|
||||
caption="Revenue last week"
|
||||
rows={ [] }
|
||||
headers={ headers }
|
||||
rowKey={ ( row ) => row[ 0 ].value }
|
||||
emptyMessage="Custom empty message"
|
||||
/>
|
||||
</Card>
|
||||
);
|
||||
|
||||
export default {
|
||||
title: 'WooCommerce Admin/components/Table',
|
||||
component: Table,
|
||||
|
|
|
@ -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'
|
||||
) }
|
||||
</td>
|
||||
</tr>
|
||||
) }
|
||||
|
@ -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 );
|
||||
|
|
|
@ -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(
|
||||
<TableCard
|
||||
title="My table"
|
||||
headers={ mockHeaders }
|
||||
isLoading={ false }
|
||||
rows={ [] }
|
||||
rowsPerPage={ 5 }
|
||||
/>
|
||||
);
|
||||
|
||||
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(
|
||||
<TableCard
|
||||
title="My table"
|
||||
headers={ mockHeaders }
|
||||
isLoading={ false }
|
||||
rows={ [] }
|
||||
rowsPerPage={ 5 }
|
||||
emptyMessage={ emptyMessage }
|
||||
/>
|
||||
);
|
||||
|
||||
expect( screen.queryByText( emptyMessage ) ).toBeInTheDocument();
|
||||
} );
|
||||
} );
|
||||
|
||||
describe( 'Table', () => {
|
||||
it( 'should accept className prop and renders it in the HTML output', () => {
|
||||
render(
|
||||
<Table
|
||||
className="class-111"
|
||||
caption="Table with className"
|
||||
headers={ mockHeaders }
|
||||
rows={ mockData }
|
||||
/>
|
||||
);
|
||||
|
||||
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(
|
||||
<Table
|
||||
classNames="class-222"
|
||||
caption="Table with classNames"
|
||||
headers={ mockHeaders }
|
||||
rows={ mockData }
|
||||
/>
|
||||
);
|
||||
|
||||
const el = screen.getByLabelText( 'Table with classNames' );
|
||||
|
||||
expect( el ).toHaveClass( 'class-222' );
|
||||
} );
|
||||
} );
|
||||
|
|
|
@ -7,24 +7,28 @@ import classnames from 'classnames';
|
|||
import { Button, Popover } from '@wordpress/components';
|
||||
import { Icon, closeSmall } from '@wordpress/icons';
|
||||
import { decodeEntities } from '@wordpress/html-entities';
|
||||
import PropTypes from 'prop-types';
|
||||
import { withInstanceId } from '@wordpress/compose';
|
||||
|
||||
/**
|
||||
* This component can be used to show an item styled as a "tag", optionally with an `X` + "remove"
|
||||
* or with a popover that is shown on click.
|
||||
*
|
||||
* @param {Object} props
|
||||
* @param {number|string} props.id
|
||||
* @param {string} props.instanceId
|
||||
* @param {string} props.label
|
||||
* @param {Object} props.popoverContents
|
||||
* @param {Function} props.remove
|
||||
* @param {string} props.screenReaderLabel
|
||||
* @param {string} props.className
|
||||
* @return {Object} -
|
||||
*/
|
||||
const Tag = ( {
|
||||
type Props = {
|
||||
/** A unique ID for this instance of the component. This is automatically generated by withInstanceId. */
|
||||
instanceId: number | string;
|
||||
/** The name for this item, displayed as the tag's text. */
|
||||
label: string;
|
||||
/** A unique ID for this item. This is used to identify the item when the remove button is clicked. */
|
||||
id?: number | string;
|
||||
/** Contents to display on click in a popover */
|
||||
popoverContents?: React.ReactNode;
|
||||
/** A function called when the remove X is clicked. If not used, no X icon will display.*/
|
||||
remove?: (
|
||||
id: number | string | undefined
|
||||
) => React.MouseEventHandler< HTMLButtonElement >;
|
||||
/** A more descriptive label for screen reader users. Defaults to the `name` prop. */
|
||||
screenReaderLabel?: string;
|
||||
/** Additional CSS classes. */
|
||||
className?: string;
|
||||
};
|
||||
|
||||
const Tag: React.VFC< Props > = ( {
|
||||
id,
|
||||
instanceId,
|
||||
label,
|
||||
|
@ -77,6 +81,7 @@ const Tag = ( {
|
|||
<Button
|
||||
className="woocommerce-tag__remove"
|
||||
onClick={ remove( id ) }
|
||||
// translators: %s is the name of the tag being removed.
|
||||
label={ sprintf( __( 'Remove %s', 'woocommerce' ), label ) }
|
||||
aria-describedby={ labelId }
|
||||
>
|
||||
|
@ -91,28 +96,4 @@ const Tag = ( {
|
|||
);
|
||||
};
|
||||
|
||||
Tag.propTypes = {
|
||||
/**
|
||||
* The ID for this item, used in the remove function.
|
||||
*/
|
||||
id: PropTypes.oneOfType( [ PropTypes.number, PropTypes.string ] ),
|
||||
|
||||
/**
|
||||
* The name for this item, displayed as the tag's text.
|
||||
*/
|
||||
label: PropTypes.string.isRequired,
|
||||
/**
|
||||
* Contents to display on click in a popover
|
||||
*/
|
||||
popoverContents: PropTypes.node,
|
||||
/**
|
||||
* A function called when the remove X is clicked. If not used, no X icon will display.
|
||||
*/
|
||||
remove: PropTypes.func,
|
||||
/**
|
||||
* A more descriptive label for screen reader users. Defaults to the `name` prop.
|
||||
*/
|
||||
screenReaderLabel: PropTypes.string,
|
||||
};
|
||||
|
||||
export default withInstanceId( Tag );
|
|
@ -1,20 +0,0 @@
|
|||
/**
|
||||
* External dependencies
|
||||
*/
|
||||
import { Tag } from '@woocommerce/components';
|
||||
|
||||
export const Basic = () => (
|
||||
<>
|
||||
<Tag label="My tag" id={ 1 } />
|
||||
<Tag label="Removable tag" id={ 2 } remove={ () => {} } />
|
||||
<Tag
|
||||
label="Tag with popover"
|
||||
popoverContents={ <p>This is a popover</p> }
|
||||
/>
|
||||
</>
|
||||
);
|
||||
|
||||
export default {
|
||||
title: 'WooCommerce Admin/components/Tag',
|
||||
component: Tag,
|
||||
};
|
|
@ -0,0 +1,31 @@
|
|||
/**
|
||||
* External dependencies
|
||||
*/
|
||||
import React from 'react';
|
||||
import { createElement } from '@wordpress/element';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import Tag from '../';
|
||||
|
||||
export const Basic = () => (
|
||||
<>
|
||||
<Tag label="My tag" id={ 1 } />
|
||||
<Tag
|
||||
label="Removable tag"
|
||||
id={ 2 }
|
||||
// eslint-disable-next-line no-alert
|
||||
remove={ ( id ) => () => window.alert( `Remove ID ${ id }` ) }
|
||||
/>
|
||||
<Tag
|
||||
label="Tag with popover"
|
||||
popoverContents={ <p>This is a popover</p> }
|
||||
/>
|
||||
</>
|
||||
);
|
||||
|
||||
export default {
|
||||
title: 'WooCommerce Admin/components/Tag',
|
||||
component: Tag,
|
||||
};
|
|
@ -1,15 +1,15 @@
|
|||
/**
|
||||
* External dependencies
|
||||
*/
|
||||
import { render, fireEvent } from '@testing-library/react';
|
||||
import { render, fireEvent, screen } from '@testing-library/react';
|
||||
import { createElement } from '@wordpress/element';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import Tag from '../';
|
||||
import Tag from '..';
|
||||
|
||||
const noop = () => {};
|
||||
const noop = () => () => {};
|
||||
|
||||
describe( 'Tag', () => {
|
||||
test( '<Tag label="foo" /> should render a tag with the label foo', () => {
|
||||
|
@ -44,17 +44,14 @@ describe( 'Tag', () => {
|
|||
} );
|
||||
|
||||
test( 'Show popoverContents after clicking the button', () => {
|
||||
const { queryByText, queryByRole } = render(
|
||||
<Tag
|
||||
label="foo"
|
||||
instanceId="1"
|
||||
popoverContents={ <p>This is a popover</p> }
|
||||
/>
|
||||
const { queryByText } = render(
|
||||
<Tag label="foo" popoverContents={ <p>This is a popover</p> } />
|
||||
);
|
||||
|
||||
fireEvent.click(
|
||||
queryByRole( 'button', { id: 'woocommerce-tag__label-1' } )
|
||||
);
|
||||
const button = screen.getByRole( 'button', {
|
||||
name: 'foo',
|
||||
} );
|
||||
fireEvent.click( button );
|
||||
expect( queryByText( 'This is a popover' ) ).toBeDefined();
|
||||
} );
|
||||
} );
|
|
@ -25,7 +25,7 @@ const StepNavigation: React.FunctionComponent< Props > = ( {
|
|||
const isFirstStep = currentStepIndex === 0;
|
||||
const isLastStep = currentStepIndex === steps.length - 1;
|
||||
|
||||
const { primaryButton = { text: '', isDisabled: false } } =
|
||||
const { primaryButton = { text: '', isDisabled: false, isHidden: false } } =
|
||||
steps[ currentStepIndex ].meta;
|
||||
|
||||
const NextButton = (
|
||||
|
@ -80,6 +80,10 @@ const StepNavigation: React.FunctionComponent< Props > = ( {
|
|||
);
|
||||
};
|
||||
|
||||
if ( primaryButton.isHidden ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="woocommerce-tour-kit-step-navigation">
|
||||
<div className="woocommerce-tour-kit-step-navigation__step">
|
||||
|
|
|
@ -22,6 +22,7 @@ export interface WooStep extends Step {
|
|||
text?: string;
|
||||
/** Disable the button or not. Default to False */
|
||||
isDisabled?: boolean;
|
||||
isHidden?: boolean;
|
||||
};
|
||||
};
|
||||
/** Auto apply the focus state for the element. Default to null */
|
||||
|
|
|
@ -1,84 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Plugin Name: {{title}}
|
||||
{{#description}}
|
||||
* Description: {{description}}
|
||||
{{/description}}
|
||||
* Version: {{version}}
|
||||
{{#author}}
|
||||
* Author: {{author}}
|
||||
{{/author}}
|
||||
* Author URI: https://woocommerce.com
|
||||
* Text Domain: {{textdomain}}
|
||||
* Domain Path: /languages
|
||||
*
|
||||
* License: GNU General Public License v3.0
|
||||
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
||||
*
|
||||
* @package {{namespace}}
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
if ( ! defined( 'MAIN_PLUGIN_FILE' ) ) {
|
||||
define( 'MAIN_PLUGIN_FILE', __FILE__ );
|
||||
}
|
||||
|
||||
require_once plugin_dir_path( __FILE__ ) . '/vendor/autoload_packages.php';
|
||||
|
||||
use {{slugPascalCase}}\Admin\Setup;
|
||||
|
||||
/**
|
||||
* {{slugPascalCase}} class.
|
||||
*/
|
||||
class {{slugPascalCase}} {
|
||||
/**
|
||||
* This class instance.
|
||||
*
|
||||
* @var \{{slugPascalCase}} single instance of this class.
|
||||
*/
|
||||
private static $instance;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public function __construct() {
|
||||
add_action( 'plugins_loaded', array( $this, 'init' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Init the plugin once WP is loaded.
|
||||
*/
|
||||
public function init() {
|
||||
// If WooCommerce does not exist, deactivate plugin.
|
||||
if ( ! class_exists( 'WooCommerce' ) ) {
|
||||
deactivate_plugins( plugin_basename( __FILE__ ) );
|
||||
}
|
||||
|
||||
if ( is_admin() ) {
|
||||
// Load plugin translations.
|
||||
$plugin_rel_path = basename( dirname( __FILE__ ) ) . '/languages'; /* Relative to WP_PLUGIN_DIR */
|
||||
load_plugin_textdomain( '{{slug}}', false, $plugin_rel_path );
|
||||
|
||||
new Setup();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the main instance.
|
||||
*
|
||||
* Ensures only one instance can be loaded.
|
||||
*
|
||||
* @return \{{slugPascalCase}}
|
||||
*/
|
||||
public static function instance() {
|
||||
|
||||
if ( null === self::$instance ) {
|
||||
self::$instance = new self();
|
||||
}
|
||||
|
||||
return self::$instance;
|
||||
}
|
||||
}
|
||||
|
||||
{{slugPascalCase}}::instance();
|
|
@ -1,19 +0,0 @@
|
|||
# @woocommerce/create-extension
|
||||
|
||||
This is a template to be used with `@wordpress/create-block` to create a WooCommerce Extension starting point.
|
||||
|
||||
## Installation
|
||||
|
||||
```
|
||||
npx @wordpress/create-block -t @woocommerce/create-extension
|
||||
```
|
||||
|
||||
When this has completed, go to your WordPress plugins page and activate the plugin.
|
||||
|
||||
## Development
|
||||
|
||||
Install from a local directory.
|
||||
|
||||
```
|
||||
npx @wordpress/create-block -t ./path/to/woocommerce/packages/js/create-extension
|
||||
```
|
|
@ -1,27 +0,0 @@
|
|||
/**
|
||||
* External dependencies
|
||||
*/
|
||||
import { addFilter } from '@wordpress/hooks';
|
||||
import { __ } from '@wordpress/i18n';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import './index.scss';
|
||||
|
||||
const MyExamplePage = () => (
|
||||
<h2>{ __( 'My Example Extension', '{{textdomain}}' ) }</h2>
|
||||
);
|
||||
|
||||
addFilter( 'woocommerce_admin_pages_list', '{{slug}}', ( pages ) => {
|
||||
pages.push( {
|
||||
container: MyExamplePage,
|
||||
path: '/{{slug}}',
|
||||
breadcrumbs: [ __( '{{title}}', '{{textdomain}}' ) ],
|
||||
navArgs: {
|
||||
id: '{{slugSnakeCase}}',
|
||||
},
|
||||
} );
|
||||
|
||||
return pages;
|
||||
} );
|
|
@ -0,0 +1,127 @@
|
|||
<?php
|
||||
/**
|
||||
* Plugin Name: {{title}}
|
||||
{{#description}}
|
||||
* Description: {{description}}
|
||||
{{/description}}
|
||||
* Version: {{version}}
|
||||
{{#author}}
|
||||
* Author: {{author}}
|
||||
{{/author}}
|
||||
* Author URI: https://woocommerce.com
|
||||
* Text Domain: {{textdomain}}
|
||||
* Domain Path: /languages
|
||||
*
|
||||
* License: GNU General Public License v3.0
|
||||
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
||||
*
|
||||
* @package {{namespace}}
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
if ( ! defined( 'MAIN_PLUGIN_FILE' ) ) {
|
||||
define( 'MAIN_PLUGIN_FILE', __FILE__ );
|
||||
}
|
||||
|
||||
require_once plugin_dir_path( __FILE__ ) . '/vendor/autoload_packages.php';
|
||||
|
||||
use {{slugPascalCase}}\Admin\Setup;
|
||||
|
||||
// phpcs:disable WordPress.Files.FileName
|
||||
|
||||
/**
|
||||
* WooCommerce fallback notice.
|
||||
*
|
||||
* @since {{version}}
|
||||
*/
|
||||
function {{slugSnakeCase}}_missing_wc_notice() {
|
||||
/* translators: %s WC download URL link. */
|
||||
echo '<div class="error"><p><strong>' . sprintf( esc_html__( '{{title}} requires WooCommerce to be installed and active. You can download %s here.', '{{slugSnakeCase}}' ), '<a href="https://woocommerce.com/" target="_blank">WooCommerce</a>' ) . '</strong></p></div>';
|
||||
}
|
||||
|
||||
register_activation_hook( __FILE__, '{{slugSnakeCase}}_activate' );
|
||||
|
||||
/**
|
||||
* Activation hook.
|
||||
*
|
||||
* @since {{version}}
|
||||
*/
|
||||
function {{slugSnakeCase}}_activate() {
|
||||
if ( ! class_exists( 'WooCommerce' ) ) {
|
||||
add_action( 'admin_notices', '{{slugSnakeCase}}_missing_wc_notice' );
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! class_exists( '{{slugSnakeCase}}' ) ) :
|
||||
/**
|
||||
* The {{slugSnakeCase}} class.
|
||||
*/
|
||||
class {{slugSnakeCase}} {
|
||||
/**
|
||||
* This class instance.
|
||||
*
|
||||
* @var \{{slugSnakeCase}} single instance of this class.
|
||||
*/
|
||||
private static $instance;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public function __construct() {
|
||||
if ( is_admin() ) {
|
||||
new Setup();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Cloning is forbidden.
|
||||
*/
|
||||
public function __clone() {
|
||||
wc_doing_it_wrong( __FUNCTION__, __( 'Cloning is forbidden.', '{{slugSnakeCase}}' ), $this->version );
|
||||
}
|
||||
|
||||
/**
|
||||
* Unserializing instances of this class is forbidden.
|
||||
*/
|
||||
public function __wakeup() {
|
||||
wc_doing_it_wrong( __FUNCTION__, __( 'Unserializing instances of this class is forbidden.', '{{slugSnakeCase}}' ), $this->version );
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the main instance.
|
||||
*
|
||||
* Ensures only one instance can be loaded.
|
||||
*
|
||||
* @return \{{slugSnakeCase}}
|
||||
*/
|
||||
public static function instance() {
|
||||
|
||||
if ( null === self::$instance ) {
|
||||
self::$instance = new self();
|
||||
}
|
||||
|
||||
return self::$instance;
|
||||
}
|
||||
}
|
||||
endif;
|
||||
|
||||
add_action( 'plugins_loaded', '{{slugSnakeCase}}_init', 10 );
|
||||
|
||||
/**
|
||||
* Initialize the plugin.
|
||||
*
|
||||
* @since {{version}}
|
||||
*/
|
||||
function {{slugSnakeCase}}_init() {
|
||||
load_plugin_textdomain( '{{slugSnakeCase}}', false, plugin_basename( dirname( __FILE__ ) ) . '/languages' );
|
||||
|
||||
if ( ! class_exists( 'WooCommerce' ) ) {
|
||||
add_action( 'admin_notices', '{{slugSnakeCase}}_missing_wc_notice' );
|
||||
return;
|
||||
}
|
||||
|
||||
{{slugSnakeCase}}::instance();
|
||||
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue