Merge branch 'trunk' into gatewaySession

This commit is contained in:
Alexis Urien 2024-07-11 10:08:52 -07:00 committed by GitHub
commit 39203b0bb7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3330 changed files with 113951 additions and 211604 deletions

View File

@ -1 +1,2 @@
node_modules
!.github

View File

@ -74,7 +74,7 @@ body:
Without this report we won't be able to fully evaluate this issue.
placeholder: |
The System Status Report is found in your WordPress admin under **WooCommerce > Status**.
Please select “Get system report”, then “Copy for support”, and then paste it here.
Please select “Get system report”, then “Copy for GitHub”, and then paste it here.
validations:
required: true
- type: checkboxes

View File

@ -35,8 +35,14 @@ Using the [WooCommerce Testing Instructions Guide](https://github.com/woocommerc
- [ ] Automatically create a changelog entry from the details below.
<!-- If no changelog entry is required for this PR, you can specify that below and provide a comment explaining why. This cannot be used if you selected the option to automatically create a changelog entry above. -->
- [ ] This Pull Request does not require a changelog entry. (Comment required below)
<details>
<summary>Changelog Entry Details</summary>
#### Significance
<!-- Choose only one -->
@ -59,6 +65,12 @@ Using the [WooCommerce Testing Instructions Guide](https://github.com/woocommerc
#### Message <!-- Add a changelog message here -->
#### Comment <!-- If the changes in this pull request don't warrant a changelog entry, you can alternatively supply a comment here. Note that comments are only accepted with a significance of "Patch" -->
</details>
<details>
<summary>Changelog Entry Comment</summary>
#### Comment <!-- If your Pull Request doesn't require a changelog entry, a comment explaining why is required instead -->
</details>

View File

@ -10,6 +10,15 @@ inputs:
build:
description: 'Given a boolean or PNPM filter, runs the build command for monorepo project(s).'
default: false
build-type:
description: 'Given "full" or "backend" will perform optimized build steps.'
default: 'full'
pull-playwright-cache:
description: 'Given a boolean value, invokes Playwright dependencies caching.'
default: false
pull-package-deps:
description: 'Given a string value, will pull the package specific dependencies cache.'
default: false
runs:
using: 'composite'
steps:
@ -25,21 +34,40 @@ runs:
uses: 'actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65'
with:
node-version-file: '.nvmrc'
# We only want to use the cache if something is being installed.
cache: ${{ inputs.install != 'false' && 'pnpm' || '' }}
# The built-in caching is not fit to per-package caching we are aiming.
cache: ''
- name: 'Setup PHP'
if: ${{ inputs.php-version != 'false' }}
uses: 'shivammathur/setup-php@a36e1e52ff4a1c9e9c9be31551ee4712a6cb6bd0'
with:
php-version: '${{ inputs.php-version }}'
coverage: 'none'
- name: 'Cache: identify pnpm caching directory'
if: ${{ inputs.pull-package-deps != 'false' }}
shell: 'bash'
run: |
echo "PNPM_STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: 'Cache: pnpm downloads'
if: ${{ inputs.pull-package-deps != 'false' }}
uses: 'actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319'
with:
path: "${{ env.PNPM_STORE_PATH }}"
key: "${{ runner.os }}-pnpm-${{ inputs.pull-package-deps }}-${{ hashFiles( 'pnpm-lock.yaml' ) }}"
restore-keys: '${{ runner.os }}-pnpm-${{ inputs.pull-package-deps }}-'
- name: 'Cache Composer Dependencies'
if: ${{ inputs.php-version != 'false' }}
if: ${{ inputs.pull-package-deps != 'false' }}
uses: 'actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319'
with:
path: '~/.cache/composer/files'
key: "${{ runner.os }}-composer-${{ hashFiles( '**/composer.lock' ) }}"
restore-keys: '${{ runner.os }}-composer-'
key: "${{ runner.os }}-composer-${{ inputs.pull-package-deps }}-${{ hashFiles( 'packages/*/*/composer.lock', 'plugins/*/composer.lock' ) }}"
restore-keys: '${{ runner.os }}-composer-${{ inputs.pull-package-deps }}-'
- name: 'Cache: playwright downloads'
if: ${{ inputs.pull-playwright-cache != 'false' }}
uses: 'actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319'
with:
path: '~/.cache/ms-playwright/'
key: "${{ runner.os }}-playwright-${{ hashFiles( 'pnpm-lock.yaml' ) }}"
restore-keys: '${{ runner.os }}-playwright-'
- name: 'Parse Project Filters'
id: 'project-filters'
shell: 'bash'
@ -50,9 +78,8 @@ runs:
# Boolean inputs aren't parsed into filters so it'll either be "true" or there will be a filter.
if: ${{ inputs.install == 'true' || steps.project-filters.outputs.install != '' }}
shell: 'bash'
run: 'pnpm install'
# `pnpm install` filtering is broken: https://github.com/pnpm/pnpm/issues/6300
# run: 'pnpm install ${{ steps.project-filters.outputs.install }}'
# The installation command is a bit odd as it's a workaround for know bug - https://github.com/pnpm/pnpm/issues/6300.
run: "pnpm install ${{ steps.project-filters.outputs.install }} --frozen-lockfile ${{ steps.project-filters.outputs.install != '' && '--config.dedupe-peer-dependents=false' || '' }}"
# We want to include an option to build projects using this action so that we can make
# sure that the build cache is always used when building projects.
- name: 'Cache Build Output'
@ -62,5 +89,13 @@ runs:
- name: 'Build'
# Boolean inputs aren't parsed into filters so it'll either be "true" or there will be a filter.
if: ${{ inputs.build == 'true' || steps.project-filters.outputs.build != '' }}
env:
BROWSERSLIST_IGNORE_OLD_DATA: true
shell: 'bash'
run: 'pnpm ${{ steps.project-filters.outputs.build }} build'
run: |
if [[ '${{ inputs.build-type }}' == 'backend' ]]; then
pnpm --filter="@woocommerce/admin-library" build:project:feature-config
fi
if [[ '${{ inputs.build-type }}' == 'full' ]]; then
pnpm ${{ steps.project-filters.outputs.build }} build
fi

View File

@ -1,50 +0,0 @@
name: Run API tests
description: Runs the WooCommerce Core API tests and generates Allure report.
inputs:
report-name:
description: Name of Allure report to be generated.
required: true
tests:
description: Specific tests to run, separated by single whitespace. See https://playwright.dev/docs/test-cli
playwright-config:
description: Playwright config file to be used
default: playwright.config.js
outputs:
result:
description: Whether the test passed or failed.
value: ${{ steps.run-api-tests.conclusion }}
runs:
using: composite
steps:
- name: Download and install Chromium browser.
working-directory: plugins/woocommerce
shell: bash
run: pnpm exec playwright install chromium
- name: Run API tests.
id: run-api-tests
working-directory: plugins/woocommerce
shell: bash
run: |
pnpm exec playwright test \
--config=tests/api-core-tests/${{ inputs.playwright-config }} \
${{ inputs.tests }}
- name: Generate Test report.
if: success() || ( failure() && steps.run-api-tests.conclusion == 'failure' )
working-directory: plugins/woocommerce
shell: bash
run: pnpm exec allure generate --clean ${{ env.ALLURE_RESULTS_DIR }} --output ${{ env.ALLURE_REPORT_DIR }}
- name: Archive test report
if: success() || ( failure() && steps.run-api-tests.conclusion == 'failure' )
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.report-name }}
path: |
${{ env.ALLURE_RESULTS_DIR }}
${{ env.ALLURE_REPORT_DIR }}
retention-days: 20

View File

@ -1,54 +0,0 @@
name: Run E2E tests
description: Runs the WooCommerce Core E2E tests and generates Allure report.
permissions: {}
inputs:
report-name:
description: Name of Allure report to be generated.
required: true
tests:
description: Specific tests to run, separated by single whitespace. See https://playwright.dev/docs/test-cli
playwright-config:
description: The Playwright configuration file to use.
default: playwright.config.js
outputs:
result:
description: Whether the test passed or failed.
value: ${{ steps.run-e2e-tests.conclusion }}
runs:
using: composite
steps:
- name: Download and install Chromium browser.
working-directory: plugins/woocommerce
shell: bash
run: pnpm exec playwright install chromium
- name: Run E2E tests.
id: run-e2e-tests
env:
FORCE_COLOR: 1
USE_WP_ENV: 1
working-directory: plugins/woocommerce
shell: bash
run: |
pnpm exec playwright test \
--config=tests/e2e-pw/${{ inputs.playwright-config }} \
${{ inputs.tests }}
- name: Generate Test report.
if: success() || ( failure() && steps.run-e2e-tests.conclusion == 'failure' )
working-directory: plugins/woocommerce
shell: bash
run: pnpm exec allure generate --clean ${{ env.ALLURE_RESULTS_DIR }} --output ${{ env.ALLURE_REPORT_DIR }}
- name: Archive test report
if: success() || ( failure() && steps.run-e2e-tests.conclusion == 'failure' )
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.report-name }}
path: |
${{ env.ALLURE_RESULTS_DIR }}
${{ env.ALLURE_REPORT_DIR }}
retention-days: 20

View File

@ -1,17 +0,0 @@
name: Run k6 performance tests
description: Runs the WooCommerce Core k6 performance tests.
permissions: {}
runs:
using: composite
steps:
- name: Install k6
shell: bash
run: |
curl https://github.com/grafana/k6/releases/download/v0.33.0/k6-v0.33.0-linux-amd64.tar.gz -L | tar xvz --strip-components 1
- name: Run k6 performance tests
id: run-k6-tests
shell: bash
run: |
./k6 run plugins/woocommerce/tests/performance/tests/gh-action-pr-requests.js

View File

@ -1,29 +0,0 @@
name: Setup local test environment
description: Set up a wp-env testing environment
permissions: {}
inputs:
test-type:
required: true
type: choice
options:
- e2e
- api
- k6
runs:
using: composite
steps:
- name: Load docker images and start containers for E2E or API tests
if: ( inputs.test-type == 'e2e' ) || ( inputs.test-type == 'api' )
working-directory: plugins/woocommerce
shell: bash
run: pnpm env:test
- name: Load docker images and start containers for k6 performance tests
if: inputs.test-type == 'k6'
working-directory: plugins/woocommerce
shell: bash
run: |
pnpm --filter=@woocommerce/plugin-woocommerce env:dev
pnpm --filter=@woocommerce/plugin-woocommerce env:performance-init

View File

@ -1,41 +0,0 @@
name: Send Slack alert on PR merge test failure
description: Send a Slack alert when automated tests failed on trunk after PR merge.
permissions: {}
inputs:
slack-bot-token:
required: true
channel-id:
required: true
test-type:
required: true
type: choice
options:
- E2E
- API
- k6
runs:
using: composite
steps:
- name: Compose Slack message
id: compose-slack-message
uses: actions/github-script@v6
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
PR_TITLE: ${{ github.event.pull_request.title }}
SHA: ${{ github.event.pull_request.merge_commit_sha }}
TEST_TYPE: ${{ inputs.test-type }}
with:
script: |
const script = require('./.github/actions/tests/slack-alert-on-pr-merge/scripts/compose-slack-message.js')
const slackMessage = script()
core.setOutput('slack-message', slackMessage)
- name: Send Slack alert
uses: slackapi/slack-github-action@v1.23.0
env:
SLACK_BOT_TOKEN: ${{ inputs.slack-bot-token }}
with:
channel-id: ${{ inputs.channel-id }}
payload: ${{ steps.compose-slack-message.outputs.slack-message }}

View File

@ -1,114 +0,0 @@
module.exports = () => {
const {
GITHUB_BASE_REF,
GITHUB_RUN_ID,
PR_NUMBER,
PR_TITLE,
SHA,
TEST_TYPE,
} = process.env;
// Slack message blocks
const blocks = [];
const dividerBlock = {
type: 'divider',
};
const introBlock = {
type: 'section',
text: {
type: 'mrkdwn',
text: `${ TEST_TYPE } tests failed on \`${ GITHUB_BASE_REF }\` after merging PR <https://github.com/woocommerce/woocommerce/pull/${ PR_NUMBER }|#${ PR_NUMBER }>`,
},
};
const prTitleBlock = {
type: 'header',
text: {
type: 'plain_text',
text: PR_TITLE,
emoji: true,
},
};
const prButtonBlock = {
type: 'actions',
elements: [
{
type: 'button',
text: {
type: 'plain_text',
text: 'View pull request :pr-merged:',
emoji: true,
},
value: 'view_pr',
url: `https://github.com/woocommerce/woocommerce/pull/${ PR_NUMBER }`,
action_id: 'view-pr',
},
],
};
const mergeCommitBlock = {
type: 'actions',
elements: [
{
type: 'button',
text: {
type: 'plain_text',
text: `View merge commit ${ SHA.substring(
0,
7
) } :alphabet-yellow-hash:`,
emoji: true,
},
value: 'view_commit',
url: `https://github.com/woocommerce/woocommerce/commit/${ SHA }`,
action_id: 'view-commit',
},
],
};
const githubBlock = {
type: 'actions',
elements: [
{
type: 'button',
text: {
type: 'plain_text',
text: 'View GitHub run log :github:',
emoji: true,
},
value: 'view_github',
url: `https://github.com/woocommerce/woocommerce/actions/runs/${ GITHUB_RUN_ID }`,
action_id: 'view-github',
},
],
};
const reportBlock = {
type: 'actions',
elements: [
{
type: 'button',
text: {
type: 'plain_text',
text: 'View test report :colorful-bar-chart:',
emoji: true,
},
value: 'view_report',
url: `https://woocommerce.github.io/woocommerce-test-reports/pr-merge/${ PR_NUMBER }/${ TEST_TYPE.toLowerCase() }`,
action_id: 'view-report',
},
],
};
// Assemble blocks
blocks.push( dividerBlock );
blocks.push( introBlock );
blocks.push( prTitleBlock );
blocks.push( prButtonBlock );
blocks.push( mergeCommitBlock );
blocks.push( githubBlock );
if ( [ 'e2e', 'api' ].includes( TEST_TYPE.toLowerCase() ) ) {
blocks.push( reportBlock );
}
blocks.push( dividerBlock );
return { blocks };
};

View File

@ -1,175 +0,0 @@
module.exports = async ( { context, core, github } ) => {
const {
API_RESULT,
E2E_RESULT,
k6_RESULT,
PLUGINS_BLOCKS_PATH,
PLUGIN_TESTS_RESULT,
GITHUB_REF_NAME,
GITHUB_RUN_ID,
} = process.env;
const {
selectEmoji,
readContextBlocksFromJsonFiles,
} = require( './utils' );
const URL_GITHUB_RUN_LOG = `https://github.com/woocommerce/woocommerce/actions/runs/${ GITHUB_RUN_ID }`;
const create_blockGroup_header = async () => {
const getRunStartDate = async () => {
const response = await github.rest.actions.getWorkflowRun( {
owner: context.repo.owner,
repo: context.repo.repo,
run_id: GITHUB_RUN_ID,
} );
const runStartedAt = new Date( response.data.run_started_at );
const intlDateTimeFormatOptions = {
dateStyle: 'full',
timeStyle: 'long',
};
const date = new Intl.DateTimeFormat(
'en-US',
intlDateTimeFormatOptions
).format( runStartedAt );
return date;
};
const readableDate = await getRunStartDate();
const blocks = [
{
type: 'header',
text: {
type: 'plain_text',
text: 'Daily test results',
emoji: true,
},
},
{
type: 'divider',
},
{
type: 'context',
elements: [
{
type: 'mrkdwn',
text: `*Run started:* ${ readableDate }`,
},
],
},
{
type: 'context',
elements: [
{
type: 'mrkdwn',
text: `*Branch:* \`${ GITHUB_REF_NAME }\``,
},
],
},
{
type: 'context',
elements: [
{
type: 'mrkdwn',
text: `*GitHub run logs:* <${ URL_GITHUB_RUN_LOG }|${ GITHUB_RUN_ID }>`,
},
],
},
{
type: 'context',
elements: [
{
type: 'mrkdwn',
text: '*Test reports dashboard:* <https://woocommerce.github.io/woocommerce-test-reports/daily/|Daily smoke tests>',
},
],
},
{
type: 'divider',
},
];
return blocks;
};
const create_blockGroup_nightlySite = () => {
const emoji_API = selectEmoji( API_RESULT );
const emoji_E2E = selectEmoji( E2E_RESULT );
const emoji_k6 = selectEmoji( k6_RESULT );
const url_API =
'https://woocommerce.github.io/woocommerce-test-reports/daily/nightly-site/api';
const url_E2E =
'https://woocommerce.github.io/woocommerce-test-reports/daily/nightly-site/e2e';
const url_k6 = URL_GITHUB_RUN_LOG;
const blocks = [
{
type: 'section',
text: {
type: 'mrkdwn',
text: `<${ URL_GITHUB_RUN_LOG }|*Smoke tests on daily build*>`,
},
},
{
type: 'context',
elements: [
{
type: 'mrkdwn',
text: `<${ url_API }|API> ${ emoji_API }\t<${ url_E2E }|E2E> ${ emoji_E2E }\t<${ url_k6 }|k6> ${ emoji_k6 }`,
},
],
},
{
type: 'divider',
},
];
return blocks;
};
const create_blockGroups_plugins = () => {
const pluginTestsSkipped = PLUGIN_TESTS_RESULT === 'skipped';
const blocks_pluginTestsSkipped = [
{
type: 'section',
text: {
type: 'mrkdwn',
text: ':warning: *Plugin tests were not run!*',
},
},
{
type: 'context',
elements: [
{
type: 'mrkdwn',
text: `Head over to the <${ URL_GITHUB_RUN_LOG }|GitHub workflow run log> to see what went wrong.`,
},
],
},
{
type: 'divider',
},
];
return pluginTestsSkipped
? blocks_pluginTestsSkipped
: readContextBlocksFromJsonFiles( PLUGINS_BLOCKS_PATH );
};
const blockGroup_header = await create_blockGroup_header();
const blockGroup_nightlySite = create_blockGroup_nightlySite();
const blockGroups_plugins = create_blockGroups_plugins();
const blocks_all = [
...blockGroup_header,
...blockGroup_nightlySite,
...blockGroups_plugins.flat(),
];
const payload = {
text: 'Daily test results',
blocks: blocks_all,
};
const payload_stringified = JSON.stringify( payload );
core.setOutput( 'payload', payload_stringified );
};

View File

@ -1,37 +0,0 @@
module.exports = ( { core } ) => {
const { UPLOAD_RESULT, E2E_RESULT, PLUGIN_NAME, PLUGIN_SLUG } = process.env;
const { selectEmoji } = require( './utils' );
const fs = require( 'fs' );
const emoji_UPLOAD = selectEmoji( UPLOAD_RESULT );
const emoji_E2E = selectEmoji( E2E_RESULT );
const reportURL = `https://woocommerce.github.io/woocommerce-test-reports/daily/${ PLUGIN_SLUG }/e2e`;
const blockGroup = [
{
type: 'section',
text: {
type: 'mrkdwn',
text: `<${ reportURL }|*${ PLUGIN_NAME }*>`,
},
},
{
type: 'context',
elements: [
{
type: 'mrkdwn',
text: `"Upload plugin" test ${ emoji_UPLOAD }\tOther E2E tests ${ emoji_E2E }`,
},
],
},
{
type: 'divider',
},
];
const blockGroup_stringified = JSON.stringify( blockGroup );
const path = `/tmp/${ PLUGIN_SLUG }.json`;
fs.writeFileSync( path, blockGroup_stringified );
core.setOutput( 'path', path );
};

View File

@ -1,26 +0,0 @@
const fs = require( 'fs' );
const path = require( 'path' );
/**
* @param {string} blocksDir
* @returns {any[][]}
*/
const readContextBlocksFromJsonFiles = ( blocksDir ) => {
const jsonsDir = path.resolve( blocksDir );
const jsons = fs.readdirSync( jsonsDir );
let contextBlocks = [];
for ( const json of jsons ) {
const jsonPath = path.resolve( jsonsDir, json );
const contextBlock = require( jsonPath );
contextBlocks.push( contextBlock );
}
return contextBlocks;
};
module.exports = {
readContextBlocksFromJsonFiles,
};

View File

@ -1,7 +0,0 @@
const { readContextBlocksFromJsonFiles } = require( './get-context-blocks' );
const { selectEmoji } = require( './select-emoji' );
module.exports = {
readContextBlocksFromJsonFiles,
selectEmoji,
};

View File

@ -1,26 +0,0 @@
const emojis = {
PASSED: ':workflow-passed:',
FAILED: ':workflow-failed:',
SKIPPED: ':workflow-skipped:',
CANCELLED: ':workflow-cancelled:',
UNKNOWN: ':grey_question:',
};
const selectEmoji = ( result ) => {
switch ( result ) {
case 'success':
return emojis.PASSED;
case 'failure':
return emojis.FAILED;
case 'skipped':
return emojis.SKIPPED;
case 'cancelled':
return emojis.CANCELLED;
default:
return emojis.UNKNOWN;
}
};
module.exports = {
selectEmoji,
};

View File

@ -1,59 +0,0 @@
name: Compose a Slack block for release tests
description: Create a Slack block that shows the API and E2E test results from one of the release tests, and upload it as an artifact.
permissions: {}
inputs:
test-name:
required: true
api-result:
required: true
type: choice
default: skipped
options:
- success
- failure
- cancelled
- skipped
e2e-result:
required: true
type: choice
default: skipped
options:
- success
- failure
- cancelled
- skipped
env-slug:
required: true
release-version:
required: true
runs:
using: composite
steps:
- name: Create context block as a JSON object
id: generate-json
uses: actions/github-script@v6
with:
script: |
const script = require('./.github/actions/tests/slack-summary-on-release/slack-blocks/scripts/create-result-block');
return script();
env:
API_RESULT: ${{ inputs.api-result }}
E2E_RESULT: ${{ inputs.e2e-result }}
ENV_SLUG: ${{ inputs.env-slug }}
TEST_NAME: ${{ inputs.test-name }}
RELEASE_VERSION: ${{ inputs.release-version }}
- name: Write JSON file
working-directory: /tmp
shell: bash
env:
CONTEXT_JSON: ${{ toJSON(steps.generate-json.outputs.result) }}
run: echo ${{ env.CONTEXT_JSON }} > "${{ inputs.test-name }}.json"
- name: Upload JSON file as artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.SLACK_BLOCKS_ARTIFACT }}
path: /tmp/${{ inputs.test-name }}.json

View File

@ -1,31 +0,0 @@
module.exports = () => {
const { API_RESULT, E2E_RESULT, ENV_SLUG, TEST_NAME, RELEASE_VERSION } =
process.env;
const { setElementText } = require( './utils' );
const apiLinkText = setElementText( {
testType: 'API',
result: API_RESULT,
envSlug: ENV_SLUG,
releaseVersion: RELEASE_VERSION,
} );
const e2eLinkText = setElementText( {
testType: 'E2E',
result: E2E_RESULT,
envSlug: ENV_SLUG,
releaseVersion: RELEASE_VERSION,
} );
const elementText = `*${ TEST_NAME }*\n ${ apiLinkText } ${ e2eLinkText }`;
const contextBlock = {
type: 'context',
elements: [
{
type: 'mrkdwn',
text: elementText,
},
],
};
return contextBlock;
};

View File

@ -1,5 +0,0 @@
const { setElementText } = require( './set-element-text' );
module.exports = {
setElementText,
};

View File

@ -1,26 +0,0 @@
const emojis = {
PASSED: ':workflow-passed:',
FAILED: ':workflow-failed:',
SKIPPED: ':workflow-skipped:',
CANCELLED: ':workflow-cancelled:',
UNKNOWN: ':grey_question:',
};
const selectEmoji = ( result ) => {
switch ( result ) {
case 'success':
return emojis.PASSED;
case 'failure':
return emojis.FAILED;
case 'skipped':
return emojis.SKIPPED;
case 'cancelled':
return emojis.CANCELLED;
default:
return emojis.UNKNOWN;
}
};
module.exports = {
selectEmoji,
};

View File

@ -1,12 +0,0 @@
const setElementText = ( { testType, result, envSlug, releaseVersion } ) => {
const { selectEmoji } = require( './select-emoji' );
const allureReportURL = `https://woocommerce.github.io/woocommerce-test-reports/release/${ releaseVersion }/${ envSlug }/${ testType.toLowerCase() }`;
const emoji = selectEmoji( result );
const textValue = `<${ allureReportURL }|${ testType.toUpperCase() } ${ emoji }>`;
return textValue;
};
module.exports = {
setElementText,
};

View File

@ -1,27 +0,0 @@
name: Combine all Slack blocks
description: Combine all Slack blocks to construct the payload for the Slack GitHub action
permissions: {}
inputs:
release-version:
required: true
blocks-dir:
require: true
outputs:
payload:
value: ${{ steps.payload.outputs.result }}
runs:
using: composite
steps:
- name: Construct payload from all blocks
id: payload
uses: actions/github-script@v6
env:
RELEASE_VERSION: ${{ inputs.release-version }}
BLOCKS_DIR: ${{ inputs.blocks-dir }}
with:
script: |
const script = require('./.github/actions/tests/slack-summary-on-release/slack-payload/scripts/construct-payload');
return script();

View File

@ -1,36 +0,0 @@
module.exports = () => {
const { RELEASE_VERSION, BLOCKS_DIR } = process.env;
const {
filterContextBlocks,
readContextBlocksFromJsonFiles,
} = require( './utils' );
const headerText = `Test summary for ${ RELEASE_VERSION }`;
const headerBlock = {
type: 'header',
text: {
type: 'plain_text',
text: headerText,
emoji: true,
},
};
const blocks_all = readContextBlocksFromJsonFiles( BLOCKS_DIR );
const blocks_wcUpdate = filterContextBlocks( blocks_all, 'WC Update' );
const blocks_wpVersions = filterContextBlocks( blocks_all, 'WP Latest' );
const blocks_phpVersions = filterContextBlocks( blocks_all, 'PHP' );
const blocks_plugins = filterContextBlocks( blocks_all, 'With' );
const blocksPayload = [ headerBlock ]
.concat( blocks_wcUpdate )
.concat( blocks_wpVersions )
.concat( blocks_phpVersions )
.concat( blocks_plugins );
const payload = {
text: headerText,
blocks: blocksPayload,
};
return payload;
};

View File

@ -1,42 +0,0 @@
const fs = require( 'fs' );
const path = require( 'path' );
const readContextBlocksFromJsonFiles = ( blocksDir ) => {
const jsonsDir = path.resolve( blocksDir );
const jsons = fs.readdirSync( jsonsDir );
let contextBlocks = [];
for ( const json of jsons ) {
const jsonPath = path.resolve( jsonsDir, json );
const contextBlock = require( jsonPath );
contextBlocks.push( contextBlock );
}
return contextBlocks;
};
const filterContextBlocks = ( blocks, testName ) => {
const divider = {
type: 'divider',
};
let filteredBlocks = [];
const matchingBlocks = blocks.filter( ( { elements } ) =>
elements[ 0 ].text.includes( testName )
);
matchingBlocks.forEach( ( block ) => {
filteredBlocks.push( block );
filteredBlocks.push( divider );
} );
return filteredBlocks;
};
module.exports = {
filterContextBlocks,
readContextBlocksFromJsonFiles,
};

View File

@ -1,6 +0,0 @@
const {
filterContextBlocks,
readContextBlocksFromJsonFiles,
} = require( './get-context-blocks' );
module.exports = { filterContextBlocks, readContextBlocksFromJsonFiles };

View File

@ -1,37 +0,0 @@
name: Upload Allure files to bucket
description: Upload Allure files to bucket.
permissions: {}
inputs:
artifact-name:
description: Name of the artifact that contains the allure-report and/or allure-results folders.
required: true
aws-region:
required: true
aws-access-key-id:
required: true
aws-secret-access-key:
required: true
s3-bucket:
required: true
include-allure-results:
dafault: false
runs:
using: composite
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1-node16
with:
aws-region: ${{ inputs.aws-region }}
aws-access-key-id: ${{ inputs.aws-access-key-id }}
aws-secret-access-key: ${{ inputs.aws-secret-access-key }}
- name: Upload Allure artifact
env:
ARTIFACT_NAME: ${{ inputs.artifact-name }}
S3_BUCKET: ${{ inputs.s3-bucket }}
INCLUDE_ALLURE_RESULTS: ${{ inputs.include-allure-results }}
shell: bash
working-directory: .github/actions/tests/upload-allure-files-to-bucket/scripts
run: bash upload-allure-artifact.sh

View File

@ -1,30 +0,0 @@
#!/usr/bin/env bash
s3_upload () {
aws s3 cp "$1" "$2" \
--recursive
}
upload_allure_results () {
if [[ $INCLUDE_ALLURE_RESULTS != "true" ]]; then
return
fi
SOURCE="$ALLURE_RESULTS_DIR"
DESTINATION="$S3_BUCKET/artifacts/$GITHUB_RUN_ID/$ARTIFACT_NAME/allure-results"
s3_upload "$SOURCE" "$DESTINATION"
}
upload_allure_report () {
SOURCE="$ALLURE_REPORT_DIR"
DESTINATION="$S3_BUCKET/artifacts/$GITHUB_RUN_ID/$ARTIFACT_NAME/allure-report"
s3_upload "$SOURCE" "$DESTINATION"
}
upload_allure_results
upload_allure_report
EXIT_CODE=$(echo $?)
exit $EXIT_CODE

View File

@ -13,22 +13,22 @@
- team: developer-advocacy
"packages/js/api/**/*":
- team: solaris
- team: vortex
"packages/js/e2e-utils/**/*":
- team: solaris
- team: vortex
"packages/js/e2e-environment/**/*":
- team: solaris
- team: vortex
"packages/js/api-core-tests/**/*":
- team: solaris
- team: vortex
"packages/js/e2e-core-tests/**/*":
- team: solaris
- team: vortex
"packages/js/admin-e2e-tests/**/*":
- team: solaris
- team: vortex
"packages/js/components/**/*":
- team: mothra
@ -51,10 +51,10 @@
- team: mothra
"packages/js/dependency-extraction-webpack-plugin/**/*":
- team: mothra
- team: vortex
"packages/js/eslint-plugin/**/*":
- team: mothra
- team: vortex
"packages/js/experimental/**/*":
- team: mothra
@ -81,6 +81,13 @@
"plugins/woocommerce/**/*":
- team: proton
"plugins/woocommerce/templates/**/*":
- team: rubik
- team: woo-fse
"plugins/woocommerce/templates/emails/**/*":
- team: proton
"plugins/woocommerce/src/Admin/**/*":
- team: mothra
- team: ghidorah

View File

@ -79,7 +79,7 @@
'focus: documentation':
- docs/**/*
'tool: monorepo infrastructure':
'focus: monorepo infrastructure':
- .github/**/*
- bin/**/*
- tools/**/*

View File

@ -1,105 +0,0 @@
name: Run Blocks E2E Tests
on:
pull_request:
paths:
- 'plugins/woocommerce-blocks/**'
- 'plugins/woocommerce/src/Blocks/**'
- 'plugins/woocommerce/templates/**'
- 'plugins/woocommerce/patterns/**'
jobs:
JSE2EWithGutenberg:
if: ${{ false }} # disable until we've fixed failing tests.
strategy:
fail-fast: false
matrix:
part: [1, 2, 3, 4, 5]
name: JavaScript E2E Tests (WP latest with Gutenberg plugin)
runs-on: ubuntu-latest
defaults:
run:
working-directory: plugins/woocommerce-blocks
steps:
- uses: actions/checkout@v3
- name: Setup WooCommerce Monorepo
uses: ./.github/actions/setup-woocommerce-monorepo
with:
install: '@woocommerce/plugin-woocommerce...'
build: '@woocommerce/plugin-woocommerce'
- name: Install Jest
run: pnpm install -g jest
- name: E2E Tests (WP latest with Gutenberg plugin)
env:
WOOCOMMERCE_BLOCKS_PHASE: 3
run: |
node ./bin/wp-env-with-gutenberg.js
npm run wp-env start
npm run wp-env:config && npx cross-env NODE_CONFIG_DIR=tests/e2e-jest/config wp-scripts test-e2e --config tests/e2e-jest/config/jest.config.js --listTests > ~/.jest-e2e-tests
npx cross-env JEST_PUPPETEER_CONFIG=tests/e2e-jest/config/jest-puppeteer.config.js cross-env NODE_CONFIG_DIR=tests/e2e-jest/config wp-scripts test-e2e --config tests/e2e-jest/config/jest.config.js --runInBand --runTestsByPath $( awk 'NR % 5 == ${{ matrix.part }} - 1' < ~/.jest-e2e-tests )
- name: Upload artifacts on failure
if: ${{ failure() }}
uses: actions/upload-artifact@v3.1.2
with:
name: e2e-with-gutenberg-test-report-${{matrix.part}}
path: reports/e2e
- name: Archive flaky tests report
uses: actions/upload-artifact@v3.1.2
if: always()
with:
name: flaky-tests-report-${{ matrix.part }}
path: flaky-tests
if-no-files-found: ignore
JSE2ETests:
name: JavaScript E2E Tests (latest)
strategy:
fail-fast: false
matrix:
part: [1, 2, 3, 4, 5]
runs-on: ubuntu-latest
defaults:
run:
working-directory: plugins/woocommerce-blocks
steps:
- uses: actions/checkout@v3
- name: Setup WooCommerce Monorepo
uses: ./.github/actions/setup-woocommerce-monorepo
with:
install: '@woocommerce/plugin-woocommerce...'
build: '@woocommerce/plugin-woocommerce'
- name: Install Jest
run: pnpm install -g jest
- name: E2E Tests (WP latest)
env:
WOOCOMMERCE_BLOCKS_PHASE: 3
run: |
node ./bin/wp-env-with-wp-641.js
pnpm --filter='@woocommerce/block-library' wp-env start
pnpm wp-env:config
pnpm --filter='@woocommerce/block-library' exec cross-env NODE_CONFIG_DIR=tests/e2e-jest/config wp-scripts test-e2e --config tests/e2e-jest/config/jest.config.js --listTests > ~/.jest-e2e-tests
pnpm --filter='@woocommerce/block-library' exec cross-env JEST_PUPPETEER_CONFIG=tests/e2e-jest/config/jest-puppeteer.config.js cross-env NODE_CONFIG_DIR=tests/e2e-jest/config wp-scripts test-e2e --config tests/e2e-jest/config/jest.config.js --runInBand --runTestsByPath $( awk 'NR % 5 == ${{ matrix.part }} - 1' < ~/.jest-e2e-tests ) --listTests
pnpm --filter='@woocommerce/block-library' exec cross-env JEST_PUPPETEER_CONFIG=tests/e2e-jest/config/jest-puppeteer.config.js cross-env NODE_CONFIG_DIR=tests/e2e-jest/config wp-scripts test-e2e --config tests/e2e-jest/config/jest.config.js --runInBand --runTestsByPath $( awk 'NR % 5 == ${{ matrix.part }} - 1' < ~/.jest-e2e-tests )
- name: Upload artifacts on failure
if: ${{ failure() }}
uses: actions/upload-artifact@v3.1.2
with:
name: e2e-test-report-${{matrix.part}}
path: reports/e2e
- name: Archive flaky tests report
uses: actions/upload-artifact@v3.1.2 # v2.2.2
if: always()
with:
name: flaky-tests-report-${{ matrix.part }}
path: flaky-tests
if-no-files-found: ignore

View File

@ -1,72 +0,0 @@
name: Run Blocks Playwright Tests
on:
pull_request:
paths:
- '.github/workflows/blocks-playwright.yml' # This file
- 'plugins/woocommerce-blocks/**'
- 'plugins/woocommerce/src/Blocks/**'
- 'plugins/woocommerce/templates/**'
- 'plugins/woocommerce/patterns/**'
# Allow manually triggering the workflow.
workflow_dispatch:
env:
FORCE_COLOR: 1
jobs:
e2e:
name: ${{ matrix.config.name }} [${{ matrix.shards.name }}]
timeout-minutes: 60
runs-on: ubuntu-latest
defaults:
run:
working-directory: plugins/woocommerce-blocks
strategy:
fail-fast: false
matrix:
config:
- name: Default (Block) Theme
file: playwright.config.ts
resultPath: test-results
- name: Classic Theme
file: playwright.classic-theme.config.ts
resultPath: test-results-classic-theme
- name: Side Effects
file: playwright.side-effects.config.ts
resultPath: test-results-side-effects
- name: Block Theme With Templates
file: playwright.block-theme-with-templates.config.ts
resultPath: test-results-block-theme-with-templates
shards:
- name: 1/5
- name: 2/5
- name: 3/5
- name: 4/5
- name: 5/5
steps:
- uses: actions/checkout@v3
- name: Setup WooCommerce Monorepo
uses: ./.github/actions/setup-woocommerce-monorepo
with:
install: '@woocommerce/plugin-woocommerce...'
build: '@woocommerce/plugin-woocommerce'
- name: Install Playwright
run: pnpm --filter='@woocommerce/block-library' exec playwright install --with-deps
- name: Start wp-env
run: pnpm --filter='@woocommerce/block-library' env:start
- name: Run Playwright tests
working-directory: plugins/woocommerce-blocks
run: pnpm playwright test --config=tests/e2e/${{ matrix.config.file }} --shard ${{ matrix.shards.name }}
- uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: playwright-report-${{ matrix.config.name }}
path: plugins/woocommerce-blocks/tests/e2e/artifacts/${{ matrix.config.resultPath }}
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`

View File

@ -17,7 +17,7 @@ jobs:
permissions:
contents: read
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Get current version
id: version
@ -30,16 +30,16 @@ jobs:
- name: Setup WooCommerce Monorepo
uses: ./.github/actions/setup-woocommerce-monorepo
with:
pull-package-deps: '@woocommerce/plugin-woocommerce'
- name: Prepare plugin zips
id: prepare
env:
CURRENT_VERSION: ${{ steps.version.outputs.version }}
# Build with experimental blocks.
WOOCOMMERCE_BLOCKS_PHASE: 3
run: |
# Current version must compare greather than any previously used current version for this PR.
# Current version must compare greater than any previously used current version for this PR.
# Assume GH run IDs are monotonic.
VERSUFFIX="${GITHUB_RUN_ID}-g$(git rev-parse --short HEAD)"
@ -52,12 +52,12 @@ jobs:
bash bin/build-zip.sh
mkdir "$GITHUB_WORKSPACE/zips"
cp "$GITHUB_WORKSPACE/plugins/woocommerce/woocommerce.zip" "$GITHUB_WORKSPACE/zips/woocommerce.zip"
mv "$GITHUB_WORKSPACE/plugins/woocommerce/woocommerce.zip" "$GITHUB_WORKSPACE/zips/woocommerce.zip"
cd "$GITHUB_WORKSPACE/zips"
unzip woocommerce.zip
unzip -qq woocommerce.zip
rm woocommerce.zip
mv woocommerce woocommerce-dev
zip -q -r "woocommerce-dev.zip" "woocommerce-dev/"
zip -q -r -9 "woocommerce-dev.zip" "woocommerce-dev/"
rm -fR "$GITHUB_WORKSPACE/zips/woocommerce-dev"
# Plugin data is passed as a JSON object.
@ -66,7 +66,7 @@ jobs:
echo "plugin-data=$PLUGIN_DATA" >> $GITHUB_OUTPUT
- name: Create plugins artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: steps.prepare.outputs.plugin-data != '{}'
with:
name: plugins

View File

@ -20,6 +20,8 @@ jobs:
- name: Setup WooCommerce Monorepo
uses: ./.github/actions/setup-woocommerce-monorepo
with:
pull-package-deps: '@woocommerce/plugin-woocommerce'
- name: Build zip
working-directory: plugins/woocommerce

View File

@ -23,11 +23,8 @@ jobs:
- name: Setup WooCommerce Monorepo
uses: ./.github/actions/setup-woocommerce-monorepo
with:
install: 'monorepo-utils...'
build: 'monorepo-utils'
- name: Generate Changelog File
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.PR_CREATE_TOKEN || secrets.GITHUB_TOKEN }}
run: pnpm utils changefile ${{github.event.number || inputs.prNumber}} -o ${{ github.repository_owner }}

View File

@ -39,18 +39,34 @@ jobs:
outputs:
run: ${{ steps.check.outputs.run }}
steps:
- name: Fetch Pull Request Details
if: github.event.issue.pull_request
id: fetch_pr_details
uses: actions/github-script@v6
with:
script: |
const issue = context.payload.issue;
const pullRequestUrl = issue.pull_request.url;
const prDetails = await github.request(pullRequestUrl);
core.setOutput('base_ref', prDetails.data.base.ref);
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: check
id: check
uses: actions/github-script@v6
with:
script: |
const baseRef = process.env.BASE_REF;
console.log("baseRef:", baseRef);
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 isMergedMilestonedIssue = context.payload.issue && context.payload.issue.pull_request != null && context.payload.issue.pull_request.merged_at != null && context.payload.issue.milestone != null && baseRef == 'trunk';
const isMergedMilestonedPR = context.payload.pull_request && context.payload.pull_request != null && context.payload.pull_request.merged == true && context.payload.pull_request.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 && baseRef == 'trunk';
const isBot = context.payload.pull_request && ( context.payload.pull_request.user.login == 'github-actions[bot]' || context.payload.pull_request.user.type == 'Bot' );
@ -59,6 +75,9 @@ jobs:
} else {
core.setOutput( 'run', 'false' );
}
env:
BASE_REF: ${{ steps.fetch_pr_details.outputs.base_ref }}
prep:
name: Prep inputs
runs-on: ubuntu-20.04

View File

@ -1,392 +1,440 @@
name: 'CI'
on:
pull_request:
push:
branches:
- 'trunk'
- 'release/*'
pull_request:
push:
branches:
- 'trunk'
- 'release/*'
release:
types: [ published, edited ]
workflow_call:
inputs:
trigger:
description: 'Type of run to trigger. E.g. daily-e2e, release-checks, etc.'
required: true
default: 'default'
type: string
workflow_dispatch:
inputs:
pr_simulate:
description: 'Would you like to run CI on a pull request? If so, enter the PR number here. If blank, the entire suite will be run.'
type: string
default: ''
concurrency:
group: '${{ github.workflow }}-${{ github.ref }}'
cancel-in-progress: true
group: '${{ github.workflow }}-${{ github.ref }}'
cancel-in-progress: true
env:
FORCE_COLOR: 1
jobs:
project-jobs:
# Since this is a monorepo, not every pull request or change is going to impact every project.
# Instead of running CI tasks on all projects indiscriminately, we use a command to detect
# which projects have changed and what kind of change occurred. This lets us build the
# matrices that we can use to run CI tasks only on the projects that need them.
name: 'Build Project Jobs'
runs-on: 'ubuntu-20.04'
outputs:
lint-jobs: ${{ steps.project-jobs.outputs.lint-jobs }}
default-test-jobs: ${{ steps.project-jobs.outputs.default-test-jobs }}
e2e-test-jobs: ${{ steps.project-jobs.outputs.e2e-test-jobs }}
api-test-jobs: ${{ steps.project-jobs.outputs.api-test-jobs }}
performance-test-jobs: ${{ steps.project-jobs.outputs.performance-test-jobs }}
steps:
- uses: 'actions/checkout@v4'
name: 'Checkout'
with:
fetch-depth: 0
- uses: './.github/actions/setup-woocommerce-monorepo'
name: 'Setup Monorepo'
with:
php-version: false # We don't want to waste time installing PHP since we aren't using it in this job.
- uses: actions/github-script@v7
name: 'Build Matrix'
id: 'project-jobs'
with:
script: |
let baseRef = ${{ toJson( github.base_ref ) }};
if ( baseRef ) {
baseRef = `--base-ref origin/${ baseRef }`;
}
dispatch-handler:
name: 'Handle dispatched workflow'
runs-on: 'ubuntu-20.04'
if: ${{ github.event_name == 'workflow_dispatch' && inputs.pr_simulate }}
outputs:
head: ${{ steps.pr-info.outputs.head }}
base: ${{ steps.pr-info.outputs.base }}
let githubEvent = ${{ toJson( github.event_name ) }};
const child_process = require( 'node:child_process' );
child_process.execSync( `pnpm utils ci-jobs ${ baseRef } --event ${ githubEvent }` );
project-lint-jobs:
name: 'Lint - ${{ matrix.projectName }}'
runs-on: 'ubuntu-20.04'
needs: 'project-jobs'
if: ${{ needs.project-jobs.outputs.lint-jobs != '[]' }}
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON( needs.project-jobs.outputs.lint-jobs ) }}
steps:
- uses: 'actions/checkout@v4'
name: 'Checkout'
with:
fetch-depth: 0
- uses: './.github/actions/setup-woocommerce-monorepo'
name: 'Setup Monorepo'
id: 'setup-monorepo'
with:
install: '${{ matrix.projectName }}...'
build: '${{ matrix.projectName }}'
- name: 'Lint'
run: 'pnpm --filter="${{ matrix.projectName }}" ${{ matrix.command }}'
project-default-test-jobs:
name: 'Test - ${{ matrix.projectName }} - ${{ matrix.name }}'
runs-on: 'ubuntu-20.04'
needs: 'project-jobs'
if: ${{ needs.project-jobs.outputs.default-test-jobs != '[]' }}
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON( needs.project-jobs.outputs.default-test-jobs ) }}
steps:
- uses: 'actions/checkout@v4'
name: 'Checkout'
- uses: './.github/actions/setup-woocommerce-monorepo'
name: 'Setup Monorepo'
id: 'setup-monorepo'
with:
install: '${{ matrix.projectName }}...'
build: '${{ matrix.projectName }}'
- name: 'Prepare Test Environment'
id: 'prepare-test-environment'
if: ${{ matrix.testEnv.shouldCreate }}
env: ${{ matrix.testEnv.envVars }}
run: 'pnpm --filter="${{ matrix.projectName }}" ${{ matrix.testEnv.start }}'
- name: 'Test'
run: 'pnpm --filter="${{ matrix.projectName }}" ${{ matrix.command }}'
project-e2e-test-jobs:
name: 'E2E - ${{ matrix.name }}'
runs-on: 'ubuntu-20.04'
needs: 'project-jobs'
if: ${{ needs.project-jobs.outputs.e2e-test-jobs != '[]' }}
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON( needs.project-jobs.outputs.e2e-test-jobs ) }}
steps:
- uses: 'actions/checkout@v4'
name: 'Checkout'
- uses: './.github/actions/setup-woocommerce-monorepo'
name: 'Setup Monorepo'
id: 'setup-monorepo'
with:
install: '${{ matrix.projectName }}...'
build: '${{ matrix.projectName }}'
- name: 'Prepare Test Environment'
id: 'prepare-test-environment'
if: ${{ matrix.testEnv.shouldCreate }}
run: 'pnpm --filter="${{ matrix.projectName }}" ${{ matrix.testEnv.start }}'
- name: 'Run tests'
run: 'pnpm --filter="${{ matrix.projectName }}" ${{ matrix.command }}'
- name: 'Upload artifacts'
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: all-blob-e2e-reports-${{ strategy.job-index }}
path: ${{ matrix.projectPath }}/tests/e2e-pw/test-results
retention-days: 1
compression-level: 9
project-api-test-jobs:
name: 'API - ${{ matrix.name }}'
runs-on: 'ubuntu-20.04'
needs: 'project-jobs'
if: ${{ needs.project-jobs.outputs.api-test-jobs != '[]' }}
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON( needs.project-jobs.outputs.api-test-jobs ) }}
steps:
- uses: 'actions/checkout@v4'
name: 'Checkout'
- uses: './.github/actions/setup-woocommerce-monorepo'
name: 'Setup Monorepo'
id: 'setup-monorepo'
with:
install: '${{ matrix.projectName }}...'
build: '${{ matrix.projectName }}'
- name: 'Prepare Test Environment'
id: 'prepare-test-environment'
if: ${{ matrix.testEnv.shouldCreate }}
run: 'pnpm --filter="${{ matrix.projectName }}" ${{ matrix.testEnv.start }}'
- name: 'Run tests'
run: 'pnpm --filter="${{ matrix.projectName }}" ${{ matrix.command }}'
- name: 'Upload artifacts'
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: all-blob-api-reports-${{ strategy.job-index }}
path: ${{ matrix.projectPath }}/tests/api-core-tests/test-results/allure-results
retention-days: 1
compression-level: 9
project-performance-test-jobs:
name: 'Performance - ${{ matrix.name }}'
runs-on: 'ubuntu-20.04'
needs: 'project-jobs'
if: ${{ needs.project-jobs.outputs.performance-test-jobs != '[]' }}
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON( needs.project-jobs.outputs.performance-test-jobs ) }}
steps:
- uses: actions/github-script@v7
name: 'Grab PR info.'
id: 'pr-info'
env:
WP_ARTIFACTS_PATH: ${{ github.workspace }}/artifacts
PR: ${{ inputs.pr_simulate }}
with:
retries: 3
script: |
if ( ! process.env.PR ) {
return;
}
const PR = await github.rest.pulls.get( {
pull_number: process.env.PR,
repo: context.repo.repo,
owner: context.repo.owner,
} );
core.setOutput( 'head', PR.data.head.ref );
core.setOutput( 'base', PR.data.base.ref );
project-jobs:
# Since this is a monorepo, not every pull request or change is going to impact every project.
# Instead of running CI tasks on all projects indiscriminately, we use a command to detect
# which projects have changed and what kind of change occurred. This lets us build the
# matrices that we can use to run CI tasks only on the projects that need them.
name: 'Build Project Jobs'
runs-on: 'ubuntu-20.04'
needs: 'dispatch-handler'
# Because forks of this repository may want to skip running this CI automatically, but still
# be able to run it via workflow_dispatch, if the SKIP_CI variable is truthy, and we're not
# running from a workflow_dispatch, we'll skip generating the project matrix and any jobs.
# Because dispatch-handler may be skipped, we need the always() here.
if: ${{ always() && ( github.event_name == 'workflow_dispatch' || ! vars.SKIP_CI ) }}
outputs:
lint-jobs: ${{ steps.project-jobs.outputs.lint-jobs }}
test-jobs: ${{ steps.project-jobs.outputs.test-jobs }}
report-jobs: ${{ steps.project-jobs.outputs.report-jobs }}
steps:
- uses: 'actions/checkout@v4'
name: 'Checkout'
with:
fetch-depth: 0
# If the workflow wasn't triggered by dispatch, this will be empty and use defaults.
ref: ${{ needs.dispatch-handler.outputs.head }}
steps:
- uses: 'actions/checkout@v4'
name: 'Checkout'
- uses: './.github/actions/setup-woocommerce-monorepo'
name: 'Setup Monorepo'
with:
php-version: false # We don't want to waste time installing PHP since we aren't using it in this job.
- uses: './.github/actions/setup-woocommerce-monorepo'
name: 'Setup Monorepo'
id: 'setup-monorepo'
with:
install: '${{ matrix.projectName }}...'
build: '${{ matrix.projectName }}'
- uses: actions/github-script@v7
name: 'Build Matrix'
id: 'project-jobs'
env:
PR_SIM: ${{ needs.dispatch-handler.outputs.base }}
with:
script: |
const prSim = process.env.PR_SIM;
- name: 'Prepare Test Environment'
id: 'prepare-test-environment'
if: ${{ matrix.testEnv.shouldCreate }}
run: 'pnpm --filter="${{ matrix.projectName }}" ${{ matrix.testEnv.start }}'
let baseRef = prSim || ${{ toJson( github.base_ref ) }};
if ( baseRef ) {
baseRef = `--base-ref origin/${ baseRef }`;
}
- name: 'Run tests'
env:
CODEVITALS_PROJECT_TOKEN: ${{ secrets.CODEVITALS_PROJECT_TOKEN }}
run: 'pnpm --filter="${{ matrix.projectName }}" ${{ matrix.command }}'
let githubEvent = ${{ toJson( github.event_name ) }};
- name: 'Archive metrics results'
if: ${{ success() && matrix.name == 'Metrics' }}
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name: metrics-results
path: ${{ env.WP_ARTIFACTS_PATH }}/*.performance-results*.json
const refType = ${{ toJson( github.ref_type ) }};
const refName = ${{ toJson( github.ref_name ) }};
evaluate-project-jobs:
# In order to add a required status check we need a consistent job that we can grab onto.
# Since we are dynamically generating a matrix for the project jobs, however, we can't
# rely on any specific job being present. We can get around this limitation by
# using a job that runs after all the others and either passes or fails based
# on the results of the other jobs in the workflow.
name: 'Evaluate Project Job Statuses'
runs-on: 'ubuntu-20.04'
needs:
[
'project-jobs',
'project-lint-jobs',
'project-default-test-jobs',
'project-e2e-test-jobs',
'project-api-test-jobs',
]
if: ${{ always() }}
steps:
- name: 'Evaluation'
run: |
result="${{ needs.project-jobs.result }}"
if [[ $result != "success" && $result != "skipped" ]]; then
echo "An error occurred generating the CI jobs."
exit 1
fi
result="${{ needs.project-lint-jobs.result }}"
if [[ $result != "success" && $result != "skipped" ]]; then
echo "One or more lint jobs have failed."
exit 1
fi
result="${{ needs.project-default-test-jobs.result }}"
if [[ $result != "success" && $result != "skipped" ]]; then
echo "One or more test jobs have failed."
exit 1
fi
result="${{ needs.project-e2e-test-jobs.result }}"
if [[ $result != "success" && $result != "skipped" ]]; then
echo "One or more e2e test jobs have failed."
exit 1
fi
result="${{ needs.project-api-test-jobs.result }}"
if [[ $result != "success" && $result != "skipped" ]]; then
echo "One or more api test jobs have failed."
exit 1
fi
echo "All jobs have completed successfully."
if ( refType === 'tag' && refName !== 'nightly' ) {
githubEvent = 'release-checks';
}
e2e-test-reports:
name: 'Report e2e tests results'
needs: [project-e2e-test-jobs]
if: ${{ ! cancelled() && needs.project-e2e-test-jobs.result != 'skipped' }}
runs-on: ubuntu-latest
if ( refType === 'tag' && refName === 'nightly' ) {
githubEvent = 'nightly-checks';
}
steps:
- uses: actions/checkout@v4
let trigger = ${{ toJson( inputs.trigger ) }};
if ( trigger ) {
githubEvent = trigger;
}
- name: 'Install Allure CLI'
env:
DESTINATION_PATH: ../
run: ./.github/workflows/scripts/install-allure.sh
// Override the event 'workflow_dispatch' event type if we're simulating a PR.
if ( prSim ) {
githubEvent = 'pull_request';
}
- name: 'Download blob reports from artifacts'
uses: actions/download-artifact@v4
with:
path: ./out
pattern: all-blob-e2e-reports-*
run-id: project-e2e-test-jobs
merge-multiple: true
const child_process = require( 'node:child_process' );
child_process.execSync( `pnpm utils ci-jobs ${ baseRef } --event ${ githubEvent }` );
- name: 'Generate Allure report'
id: generate_allure_report
run: allure generate --clean ./out/allure-results --output ./out/allure-report
project-lint-jobs:
name: "Lint - ${{ matrix.projectName }} ${{ matrix.optional && ' (optional)' || ''}}"
runs-on: 'ubuntu-20.04'
needs: [
'project-jobs',
'dispatch-handler'
]
# Because dispatch-handler may be skipped, we need the always() here.
if: ${{ always() && needs.project-jobs.outputs.lint-jobs != '[]' && ( github.event_name == 'pull_request' || inputs.pr_simulate != '' ) }}
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON( needs.project-jobs.outputs.lint-jobs ) }}
- name: 'Archive reports'
uses: actions/upload-artifact@v4
with:
name: e2e-test-report
path: ./out
if-no-files-found: ignore
retention-days: 5
steps:
- uses: 'actions/checkout@v4'
name: 'Checkout'
with:
fetch-depth: 0
# If the workflow wasn't triggered by dispatch, this will be empty and use defaults.
ref: ${{ needs.dispatch-handler.outputs.head }}
- name: 'Send workflow dispatch'
env:
GH_TOKEN: ${{ secrets.REPORTS_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
RUN_ID: ${{ github.run_id }}
run: |
if [ "$GITHUB_EVENT_NAME" == pull_request ]; then
gh workflow run publish-test-reports-pr.yml \
-f run_id=$RUN_ID \
-f e2e_artifact=e2e-test-report \
-f pr_number=$PR_NUMBER \
-f commit_sha=$GITHUB_SHA \
-f s3_root=public \
--repo woocommerce/woocommerce-test-reports
else
gh workflow run publish-test-reports-trunk-merge.yml \
-f run_id=$RUN_ID \
-f artifact=e2e-test-report \
-f pr_number=$PR_NUMBER \
-f commit_sha=$GITHUB_SHA \
-f test_type="e2e" \
--repo woocommerce/woocommerce-test-reports
fi
- uses: './.github/actions/setup-woocommerce-monorepo'
name: 'Setup Monorepo'
id: 'setup-monorepo'
with:
install: '${{ matrix.projectName }}...'
pull-package-deps: '${{ matrix.projectName }}'
- name: 'Send Slack notification'
if: github.event_name != 'pull_request'
uses: automattic/action-test-results-to-slack@v0.3.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
slack_token: ${{ secrets.E2E_SLACK_TOKEN }}
slack_channel: ${{ secrets.E2E_TRUNK_SLACK_CHANNEL }}
playwright_report_path: ./out/test-results-*.json
playwright_output_dir: ./out/results-data
- name: 'Lint'
run: 'pnpm --filter="${{ matrix.projectName }}" ${{ matrix.command }}'
api-test-reports:
name: 'Report API tests results'
needs: [project-api-test-jobs]
if: ${{ ! cancelled() && needs.project-api-test-jobs.result != 'skipped'}}
runs-on: ubuntu-latest
project-test-jobs:
name: "${{ matrix.name }}"
runs-on: 'ubuntu-20.04'
needs: [
'project-jobs',
'dispatch-handler'
]
if: ${{ always() && needs.project-jobs.outputs.test-jobs != '[]' }}
env: ${{ matrix.testEnv.envVars }}
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON( needs.project-jobs.outputs.test-jobs ) }}
steps:
- uses: actions/checkout@v4
steps:
- uses: 'actions/checkout@v4'
name: 'Checkout'
with:
# If the workflow wasn't triggered by dispatch, this will be empty and use defaults.
ref: ${{ needs.dispatch-handler.outputs.head }}
- name: 'Install Allure CLI'
env:
DESTINATION_PATH: ../
run: ./.github/workflows/scripts/install-allure.sh
- uses: './.github/actions/setup-woocommerce-monorepo'
name: 'Install Monorepo'
id: 'install-monorepo'
with:
install: '${{ matrix.projectName }}...'
build: ${{ ( github.ref_type == 'tag' && 'false' ) || matrix.projectName }}
build-type: ${{ ( matrix.testType == 'unit:php' && 'backend' ) || 'full' }}
pull-playwright-cache: ${{ matrix.testEnv.shouldCreate && matrix.testType == 'e2e' }}
pull-package-deps: '${{ matrix.projectName }}'
- name: 'Download blob reports from artifacts'
uses: actions/download-artifact@v4
with:
path: ./out/allure-results
pattern: all-blob-api-reports-*
run-id: project-api-test-jobs
merge-multiple: true
- name: 'Update wp-env config'
if: ${{ github.ref_type == 'tag' }}
env:
RELEASE_TAG: ${{ github.ref_name }}
ARTIFACT_NAME: ${{ github.ref_name == 'nightly' && 'woocommerce-trunk-nightly.zip' || 'woocommerce.zip' }}
WP_ENV_CONFIG_PATH: ${{ matrix.projectPath }}
working-directory: ${{ matrix.projectPath }}
run: node ./github/workflows/scripts/override-wp-env-plugins.js
- name: 'Generate Allure report'
id: generate_allure_report
run: allure generate --clean ./out/allure-results --output ./out/allure-report
- name: 'Start Test Environment'
id: 'prepare-test-environment'
if: ${{ matrix.testEnv.shouldCreate }}
env: ${{ matrix.testEnv.envVars }}
run: 'pnpm --filter="${{ matrix.projectName }}" ${{ matrix.testEnv.start }}'
- name: 'Archive reports'
uses: actions/upload-artifact@v4
with:
name: api-test-report
path: ./out
if-no-files-found: ignore
retention-days: 5
- name: 'Get commit message'
id: 'get_commit_message'
env:
HEAD_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
if [[ "${{ github.event_name }}" == "push" ]]; then
COMMIT_MESSAGE=`echo "$HEAD_COMMIT_MESSAGE" | head -1`
elif [[ "${{ github.event_name }}" == "pull_request" ]]; then
COMMIT_MESSAGE="$PR_TITLE"
else
COMMIT_MESSAGE="${{ github.event_name }}"
fi
echo "COMMIT_MESSAGE=$COMMIT_MESSAGE" >> "$GITHUB_OUTPUT"
shell: bash
- name: 'Publish reports'
env:
GH_TOKEN: ${{ secrets.REPORTS_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
RUN_ID: ${{ github.run_id }}
run: |
if [ "$GITHUB_EVENT_NAME" == pull_request ]; then
gh workflow run publish-test-reports-pr.yml \
-f run_id=$RUN_ID \
-f api_artifact=api-test-report \
-f pr_number=$PR_NUMBER \
-f commit_sha=$GITHUB_SHA \
-f s3_root=public \
--repo woocommerce/woocommerce-test-reports
else
gh workflow run publish-test-reports-trunk-merge.yml \
-f run_id=$RUN_ID \
-f artifact=api-test-report \
-f pr_number=$PR_NUMBER \
-f commit_sha=$GITHUB_SHA \
-f test_type="api" \
--repo woocommerce/woocommerce-test-reports
fi
- name: 'Run tests (${{ matrix.testType }})'
env:
E2E_ENV_KEY: ${{ secrets.E2E_ENV_KEY }}
BUILDKITE_ANALYTICS_TOKEN: ${{ secrets.BUILDKITE_CORE_E2E_TOKEN }}
BUILDKITE_ANALYTICS_MESSAGE: ${{ steps.get_commit_message.outputs.COMMIT_MESSAGE }}
CODEVITALS_PROJECT_TOKEN: ${{ secrets.CODEVITALS_PROJECT_TOKEN }} # required by Metrics tests
run: 'pnpm --filter="${{ matrix.projectName }}" ${{ matrix.command }}'
- name: 'Send Slack notification'
if: github.event_name != 'pull_request'
uses: automattic/action-test-results-to-slack@v0.3.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
slack_token: ${{ secrets.E2E_SLACK_TOKEN }}
slack_channel: ${{ secrets.E2E_TRUNK_SLACK_CHANNEL }}
- name: 'Resolve artifacts path'
if: ${{ always() && matrix.report.resultsPath != '' }}
# Blocks e2e use a relative path which is not supported by actions/upload-artifact@v4
# https://github.com/actions/upload-artifact/issues/176
env:
ARTIFACTS_PATH: '${{ matrix.projectPath }}/${{ matrix.report.resultsPath }}'
run: echo "ARTIFACTS_PATH=$(realpath $ARTIFACTS_PATH)" >> $GITHUB_ENV
- name: 'Upload artifacts'
if: ${{ always() && matrix.report.resultsPath != '' }}
uses: actions/upload-artifact@v4
with:
name: '${{ matrix.report.resultsBlobName }}__${{ strategy.job-index }}'
path: ${{ env.ARTIFACTS_PATH }}
- name: 'Upload flaky test reports'
uses: actions/upload-artifact@v4
with:
name: flaky-tests-${{ strategy.job-index }}
path: ${{ env.ARTIFACTS_PATH }}/flaky-tests
if-no-files-found: ignore
- name: 'Archive metrics results'
if: ${{ success() && startsWith(matrix.name, 'Metrics') }} # this seems too fragile, we should update the reporting path and use the generic upload step above
uses: actions/upload-artifact@v4
env:
WP_ARTIFACTS_PATH: ${{ github.workspace }}/artifacts
with:
name: metrics-results
path: ${{ env.WP_ARTIFACTS_PATH }}/*.performance-results*.json
evaluate-project-jobs:
# In order to add a required status check we need a consistent job that we can grab onto.
# Since we are dynamically generating a matrix for the project jobs, however, we can't
# rely on any specific job being present. We can get around this limitation by
# using a job that runs after all the others and either passes or fails based
# on the results of the other jobs in the workflow.
name: 'Evaluate Project Job Statuses'
runs-on: 'ubuntu-20.04'
needs:
[
'project-jobs',
'project-lint-jobs',
'project-test-jobs',
]
if: ${{ always() && github.event_name == 'pull_request' }}
steps:
- uses: 'actions/checkout@v4'
name: 'Checkout'
- name: 'Evaluation'
env:
REPOSITORY: ${{ github.repository }}
RUN_ID: ${{ github.run_id }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Check if project-jobs was successful. Fail for any other status, including skipped.
result="${{ needs.project-jobs.result }}"
if [[ $result != "success" ]]; then
echo "Generating CI jobs was not successful."
exit 1
fi
node .github/workflows/scripts/evaluate-jobs-conclusions.js
alert-on-failure:
name: 'Report results on Slack'
runs-on: 'ubuntu-20.04'
needs:
[
'project-jobs',
'project-lint-jobs',
'project-test-jobs',
]
if: ${{ always() && github.event_name != 'pull_request' && ! github.event.pull_request.head.repo.fork }}
steps:
- uses: 'actions/checkout@v4'
name: 'Checkout'
- uses: './.github/actions/setup-woocommerce-monorepo'
name: 'Setup Monorepo'
with:
php-version: false
- name: 'Send messages for failed jobs'
env:
SLACK_TOKEN: ${{ secrets.E2E_SLACK_TOKEN }}
SLACK_CHANNEL: ${{ secrets.TEST_REPORTS_SLACK_CHANNEL }}
HEAD_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
INPUT_TRIGGER: ${{ inputs.trigger }}
RUN_TYPE: ${{ github.ref_type == 'tag' && (github.ref_name == 'nightly' && 'nightly-checks' || 'release-checks') || '' }}
run: |
COMMIT_MESSAGE=`echo "$HEAD_COMMIT_MESSAGE" | head -1`
if [[ -n "${INPUT_TRIGGER}" ]]; then
CHECKS_TYPE="${INPUT_TRIGGER}"
else
CHECKS_TYPE="${RUN_TYPE}"
fi
pnpm utils slack-test-report -c "${{ needs.project-jobs.result }}" -r "$CHECKS_TYPE Build jobs matrix" -m "$COMMIT_MESSAGE"
pnpm utils slack-test-report -c "${{ needs.project-lint-jobs.result }}" -r "$CHECKS_TYPE Linting" -m "$COMMIT_MESSAGE"
pnpm utils slack-test-report -c "${{ needs.project-test-jobs.result }}" -r "$CHECKS_TYPE Tests" -m "$COMMIT_MESSAGE"
test-reports:
name: 'Test reports - ${{ matrix.report }}'
needs:
[
'project-jobs',
'project-test-jobs',
]
if: ${{ always() && needs.project-jobs.outputs.report-jobs != '[]' && ! github.event.pull_request.head.repo.fork }}
strategy:
fail-fast: false
matrix:
report: ${{ fromJSON( needs.project-jobs.outputs.report-jobs ) }}
runs-on: ubuntu-latest
env:
ARTIFACT_NAME: ${{ matrix.report }}-attempt-${{ github.run_attempt }}
steps:
- uses: actions/checkout@v4
- name: 'Merge artifacts'
id: merge-artifacts
uses: actions/upload-artifact/merge@v4
continue-on-error: true
with:
name: ${{ env.ARTIFACT_NAME }}
pattern: ${{ matrix.report }}__*
delete-merged: true
- name: 'Publish report to dashboard'
if: ${{ !! steps.merge-artifacts.outputs.artifact-id }}
env:
GH_TOKEN: ${{ secrets.REPORTS_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
REPORT_NAME: ${{ matrix.report }}
HEAD_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
PR_TITLE: ${{ github.event.pull_request.title }}
EVENT_NAME: ${{ inputs.trigger == '' && github.event_name || inputs.trigger }}
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
REPORT_TITLE="$PR_TITLE"
REF_NAME="$GITHUB_HEAD_REF"
elif [[ "${{ github.event_name }}" == "push" ]]; then
REPORT_TITLE=`echo "$HEAD_COMMIT_MESSAGE" | head -1`
REF_NAME="$GITHUB_REF_NAME"
else
REPORT_TITLE="$EVENT_NAME"
REF_NAME="$GITHUB_REF_NAME"
fi
gh workflow run report.yml \
-f artifact="$ARTIFACT_NAME" \
-f run_id="$GITHUB_RUN_ID" \
-f run_attempt="$GITHUB_RUN_ATTEMPT" \
-f event="$EVENT_NAME" \
-f pr_number="$PR_NUMBER" \
-f ref_name="$REF_NAME" \
-f commit_sha="$GITHUB_SHA" \
-f repository="$GITHUB_REPOSITORY" \
-f suite="$REPORT_NAME" \
-f report_title="$REPORT_TITLE" \
--repo woocommerce/woocommerce-test-reports
report-flaky-tests:
name: 'Create issues for flaky tests'
if: ${{ !cancelled() && ! github.event.pull_request.head.repo.fork }}
needs: [ 'project-test-jobs' ]
runs-on: ubuntu-latest
permissions:
contents: read
issues: write
steps:
- uses: actions/checkout@v4
with:
repository: WordPress/gutenberg
ref: dbf201449e9736f672b61e422787d47659db327a
- uses: actions/download-artifact@v4
id: download-artifact
with:
pattern: flaky-tests*
path: flaky-tests
merge-multiple: true
- name: 'Check if there are flaky tests reports'
run: |
downloadPath='${{ steps.download-artifact.outputs.download-path }}'
# make dir so that next step doesn't fail if it doesn't exist
mkdir -p $downloadPath
# any output means there are reports
echo "FLAKY_REPORTS=$(ls -A $downloadPath | head -1)" >> $GITHUB_ENV
- name: 'Setup'
if: ${{ !!env.FLAKY_REPORTS }}
uses: ./.github/setup-node
- name: 'Build packages'
if: ${{ !!env.FLAKY_REPORTS }}
run: npm run build:packages
- name: 'Report flaky tests'
if: ${{ !!env.FLAKY_REPORTS }}
uses: ./packages/report-flaky-tests
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
label: 'metric: flaky e2e test'

View File

@ -7,7 +7,9 @@ on:
types: [opened]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
# For pull_request_target, cancel concurrent jobs with the same type and branch.
# Don't cancel for other events, by grouping on the unique run_id.
group: community-label-${{ github.event_name }}-${{ github.event.action }}-${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.ref || github.run_id }}
cancel-in-progress: true
permissions: {}
@ -27,10 +29,10 @@ jobs:
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c
- name: Install Octokit
run: npm --prefix .github/workflows/scripts install @octokit/action
run: npm --prefix .github/workflows/scripts install @octokit/action@~6.1.0
- name: Install Actions Core
run: npm --prefix .github/workflows/scripts install @actions/core
run: npm --prefix .github/workflows/scripts install @actions/core@~1.10.1
- name: Check if user is a community contributor
id: check

View File

@ -0,0 +1,146 @@
name: Blocks Playwright Tests
on:
pull_request:
paths:
- '.github/workflows/blocks-playwright.yml' # This file
- 'plugins/woocommerce-blocks/**'
- 'plugins/woocommerce/src/Blocks/**'
- 'plugins/woocommerce/templates/**'
- 'plugins/woocommerce/patterns/**'
# Allow manually triggering the workflow.
workflow_dispatch:
# Run workflow when a PR is merged to trunk branch
# to create github issues for flaky tests.
push:
branches:
- trunk
paths:
- '.github/workflows/blocks-playwright.yml' # This file
- 'plugins/woocommerce-blocks/**'
- 'plugins/woocommerce/src/Blocks/**'
- 'plugins/woocommerce/templates/**'
- 'plugins/woocommerce/patterns/**'
concurrency:
group: '${{ github.workflow }}-${{ github.ref }}'
cancel-in-progress: true
env:
FORCE_COLOR: 1
jobs:
blocks-playwright-tests:
name: Shard ${{ matrix.shardIndex }} of ${{ matrix.shardTotal }}
timeout-minutes: 60
runs-on: ubuntu-latest
defaults:
run:
working-directory: plugins/woocommerce-blocks
strategy:
fail-fast: false
matrix:
shardIndex: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
shardTotal: [10]
steps:
- uses: actions/checkout@v4
- name: Setup WooCommerce Monorepo
uses: ./.github/actions/setup-woocommerce-monorepo
with:
install: '@woocommerce/plugin-woocommerce...'
build: '@woocommerce/plugin-woocommerce'
pull-playwright-cache: true
pull-package-deps: '@woocommerce/plugin-woocommerce'
- name: Install Playwright dependencies
run: pnpm exec playwright install chromium --with-deps
- name: Setup testing environment and start the server
run: pnpm env:start
- name: Run Playwright tests
run: pnpm test:e2e --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
- name: Archive debug artifacts (screenshots, traces)
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: failures-artifacts-shard-${{ matrix.shardIndex }}
path: plugins/woocommerce-blocks/tests/e2e/artifacts/test-results
if-no-files-found: ignore
- name: Archive flaky test reports
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: flaky-tests-report-shard-${{ matrix.shardIndex }}
path: plugins/woocommerce-blocks/flaky-tests
if-no-files-found: ignore
merge-artifacts:
# Merges all artifacts from all shards into a single zip and
# deletes the parts. In case of a rerun, artifacts from the
# previous run will be retained by merging them with the new ones.
name: Merge Artifacts
if: ${{ !cancelled() }}
needs: [blocks-playwright-tests]
runs-on: ubuntu-latest
outputs:
has-flaky-test-report: ${{ !!steps.merge-flaky-tests-reports.outputs.artifact-id }}
steps:
- name: Merge failures artifacts
uses: actions/upload-artifact/merge@v4
# Don't fail the job if there aren't any artifacts to merge.
continue-on-error: true
with:
name: failures-artifacts
pattern: failures-artifacts*
delete-merged: true
- name: Merge flaky tests reports
id: merge-flaky-tests-reports
uses: actions/upload-artifact/merge@v4
continue-on-error: true
with:
name: flaky-tests-report
pattern: flaky-tests-report*
delete-merged: true
create-github-issues-for-flaky-tests:
name: Create GitHub issues for flaky tests
needs: [merge-artifacts]
if: ${{ !cancelled() && needs.merge-artifacts.outputs.has-flaky-test-report == 'true' }}
runs-on: ubuntu-latest
permissions:
contents: read
issues: write
steps:
# We are using @wordpress/report-flaky-tests package from Gutenberg repo
# to create GitHub issues for flaky tests.
- uses: actions/checkout@v4
with:
repository: WordPress/gutenberg
# We are using commit hash to checkout the exact version of the script.
# This is to avoid any breaking changes.
ref: dbf201449e9736f672b61e422787d47659db327a
- uses: actions/download-artifact@v4
with:
name: flaky-tests-report
path: flaky-tests
- name: Setup Node.js and install dependencies
uses: ./.github/setup-node
- name: Npm build
# TODO: We don't have to build the entire project, just the action itself.
run: npm run build:packages
- name: Report flaky tests
uses: ./packages/report-flaky-tests
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
label: 'metric: flaky e2e test'
artifact-path: flaky-tests

View File

@ -1,61 +0,0 @@
name: Metrics Tracking
on:
pull_request:
push:
branches: [trunk]
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
permissions: {}
jobs:
metrics:
name: Run metrics tests
runs-on: ubuntu-20.04
permissions:
contents: read
env:
WP_ARTIFACTS_PATH: ${{ github.workspace }}/artifacts
steps:
- uses: actions/checkout@v3
- name: Setup WooCommerce Monorepo
uses: ./.github/actions/setup-woocommerce-monorepo
with:
install: '@woocommerce/plugin-woocommerce...'
build: '@woocommerce/plugin-woocommerce'
- name: Compare performance with trunk
if: github.event_name == 'pull_request'
run: cd tools/compare-perf && pnpm run compare perf $GITHUB_SHA trunk --tests-branch $GITHUB_SHA
- name: Compare performance with base branch
if: github.event_name == 'push'
# The base hash used here need to be a commit that is compatible with the current WP version
# The current one is 19f3d0884617d7ecdcf37664f648a51e2987cada
# it needs to be updated every time it becomes unsupported by the current wp-env (WP version).
# It is used as a base comparison point to avoid fluctuation in the performance metrics.
run: |
WP_VERSION=$(awk -F ': ' '/^Tested up to/{print $2}' plugins/woocommerce/readme.txt)
IFS=. read -ra WP_VERSION_ARRAY <<< "$WP_VERSION"
WP_MAJOR="${WP_VERSION_ARRAY[0]}.${WP_VERSION_ARRAY[1]}"
cd tools/compare-perf && pnpm run compare perf $GITHUB_SHA 19f3d0884617d7ecdcf37664f648a51e2987cada --tests-branch $GITHUB_SHA --wp-version "$WP_MAJOR"
- name: Archive performance results
if: success()
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name: performance-results
path: ${{ env.WP_ARTIFACTS_PATH }}/*.performance-results*.json
- name: Publish performance results
if: github.event_name == 'push'
env:
CODEVITALS_PROJECT_TOKEN: ${{ secrets.CODEVITALS_PROJECT_TOKEN }}
run: |
COMMITTED_AT=$(git show -s $GITHUB_SHA --format="%cI")
cd tools/compare-perf && pnpm run log $CODEVITALS_PROJECT_TOKEN trunk $GITHUB_SHA 19f3d0884617d7ecdcf37664f648a51e2987cada $COMMITTED_AT

View File

@ -1,169 +0,0 @@
name: Run tests with HPOS disabled
on:
push:
branches:
- 'trunk'
- 'release/*'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions: {}
jobs:
non-hpos-e2e-tests-run:
name: Runs E2E tests with HPOS disabled.
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
shard:
[
{ number: 1, name: 1/5 },
{ number: 2, name: 2/5 },
{ number: 3, name: 3/5 },
{ number: 4, name: 4/5 },
{ number: 5, name: 5/5 },
]
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
steps:
- uses: actions/checkout@v4
- name: Setup WooCommerce Monorepo
uses: ./.github/actions/setup-woocommerce-monorepo
with:
install: '@woocommerce/plugin-woocommerce...'
build: '@woocommerce/plugin-woocommerce'
- name: Load docker images and start containers
working-directory: plugins/woocommerce
run: pnpm env:test
- name: Download and install Chromium browser.
working-directory: plugins/woocommerce
run: pnpm exec playwright install chromium
- name: Run Playwright E2E tests.
timeout-minutes: 60
id: run_playwright_e2e_tests
env:
USE_WP_ENV: 1
ENABLE_HPOS: 0
FORCE_COLOR: 1
working-directory: plugins/woocommerce
run: pnpm exec playwright test --config=tests/e2e-pw/playwright.config.js --shard ${{ matrix.shard.name }}
- name: Upload reports to GitHub Actions Artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: all-blob-reports-${{ matrix.shard.number }}
path: ${{ env.ALLURE_RESULTS_DIR }}
retention-days: 1
compression-level: 9
merge-reports:
name: Merge e2e test reports
# Merge reports after playwright-tests, even if some shards have failed
if: always()
needs: [non-hpos-e2e-tests-run]
runs-on: ubuntu-latest
env:
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
steps:
- uses: actions/checkout@v4
- name: Setup WooCommerce Monorepo
uses: ./.github/actions/setup-woocommerce-monorepo
with:
install: '@woocommerce/plugin-woocommerce...'
build: '@woocommerce/plugin-woocommerce'
- name: Download blob reports from GitHub Actions Artifacts
uses: actions/download-artifact@v4
with:
path: ${{ env.ALLURE_RESULTS_DIR }}
pattern: all-blob-reports-*
run-id: e2e-tests-run
merge-multiple: true
- name: Generate Playwright E2E Test report.
id: generate_e2e_report
working-directory: plugins/woocommerce
run: pnpm exec allure generate --clean ${{ env.ALLURE_RESULTS_DIR }} --output ${{ env.ALLURE_REPORT_DIR }}
- name: Archive Playwright E2E test report
if: |
always() &&
steps.generate_e2e_report.conclusion == 'success'
uses: actions/upload-artifact@v4
with:
name: e2e-test-report---pr-${{ github.event.number }}
path: |
${{ env.ALLURE_RESULTS_DIR }}
${{ env.ALLURE_REPORT_DIR }}
if-no-files-found: ignore
retention-days: 5
non-hpos-api-tests-run:
name: Runs API tests with HPOS disabled.
runs-on: ubuntu-latest
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
steps:
- uses: actions/checkout@v4
- name: Setup WooCommerce Monorepo
uses: ./.github/actions/setup-woocommerce-monorepo
with:
install: '@woocommerce/plugin-woocommerce...'
build: '@woocommerce/plugin-woocommerce'
- name: Load docker images and start containers
working-directory: plugins/woocommerce
run: pnpm --filter='@woocommerce/plugin-woocommerce' env:test
- name: Run Playwright API tests.
id: run_playwright_api_tests
working-directory: plugins/woocommerce
env:
BASE_URL: http://localhost:8086
USER_KEY: admin
USER_SECRET: password
ENABLE_HPOS: 0
run: pnpm exec playwright test --config=tests/api-core-tests/playwright.config.js
- name: Generate Playwright API Test report.
id: generate_api_report
if: |
always() &&
(
steps.run_playwright_api_tests.conclusion != 'cancelled' ||
steps.run_playwright_api_tests.conclusion != 'skipped'
)
working-directory: plugins/woocommerce
run: pnpm exec allure generate --clean ${{ env.ALLURE_RESULTS_DIR }} --output ${{ env.ALLURE_REPORT_DIR }}
- name: Archive Playwright API test report
if: |
always() &&
steps.generate_api_report.conclusion == 'success'
uses: actions/upload-artifact@v3
with:
name: api-test-report---pr-${{ github.event.number }}
path: |
${{ env.ALLURE_RESULTS_DIR }}
${{ env.ALLURE_REPORT_DIR }}
if-no-files-found: ignore
retention-days: 5

View File

@ -1,179 +0,0 @@
name: Run daily tests in an environment with HPOS disabled
on:
schedule:
- cron: '30 2 * * *'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions: {}
jobs:
non-hpos-e2e-tests-run:
name: Runs E2E tests with HPOS disabled.
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
steps:
- uses: actions/checkout@v4
- name: Setup WooCommerce Monorepo
uses: ./.github/actions/setup-woocommerce-monorepo
with:
install: '@woocommerce/plugin-woocommerce...'
build: '@woocommerce/plugin-woocommerce'
- name: Load docker images and start containers with HPOS disabled.
working-directory: plugins/woocommerce
env:
ENABLE_HPOS: 0
run: pnpm --filter=@woocommerce/plugin-woocommerce env:test:no-hpos
- name: Download and install Chromium browser.
working-directory: plugins/woocommerce
run: pnpm exec playwright install chromium
- name: Run Playwright E2E tests.
timeout-minutes: 60
id: run_playwright_e2e_tests
env:
USE_WP_ENV: 1
working-directory: plugins/woocommerce
run: pnpm exec playwright test --config=tests/e2e-pw/playwright.config.js
- name: Generate Playwright E2E Test report.
id: generate_e2e_report
if: |
always() &&
(
steps.run_playwright_e2e_tests.conclusion != 'cancelled' ||
steps.run_playwright_e2e_tests.conclusion != 'skipped'
)
working-directory: plugins/woocommerce
run: pnpm exec allure generate --clean ${{ env.ALLURE_RESULTS_DIR }} --output ${{ env.ALLURE_REPORT_DIR }}
- name: Archive Playwright E2E test report
if: |
always() &&
steps.generate_e2e_report.conclusion == 'success'
uses: actions/upload-artifact@v3
with:
name: e2e-test-report---pr-${{ github.run_number }}
path: |
${{ env.ALLURE_RESULTS_DIR }}
${{ env.ALLURE_REPORT_DIR }}
if-no-files-found: ignore
retention-days: 5
non-hpos-api-tests-run:
name: Runs API tests with HPOS disabled.
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
steps:
- uses: actions/checkout@v4
- name: Setup WooCommerce Monorepo
uses: ./.github/actions/setup-woocommerce-monorepo
with:
install: '@woocommerce/plugin-woocommerce...'
build: '@woocommerce/plugin-woocommerce'
- name: Load docker images and start containers with HPOS disabled.
working-directory: plugins/woocommerce
env:
ENABLE_HPOS: 0
run: pnpm --filter=@woocommerce/plugin-woocommerce env:test:no-hpos
- name: Run Playwright API tests.
id: run_playwright_api_tests
working-directory: plugins/woocommerce
env:
BASE_URL: http://localhost:8086
USER_KEY: admin
USER_SECRET: password
run: pnpm exec playwright test --config=tests/api-core-tests/playwright.config.js
- name: Generate Playwright API Test report.
id: generate_api_report
if: |
always() &&
(
steps.run_playwright_api_tests.conclusion != 'cancelled' ||
steps.run_playwright_api_tests.conclusion != 'skipped'
)
working-directory: plugins/woocommerce
run: pnpm exec allure generate --clean ${{ env.ALLURE_RESULTS_DIR }} --output ${{ env.ALLURE_REPORT_DIR }}
- name: Archive Playwright API test report
if: |
always() &&
steps.generate_api_report.conclusion == 'success'
uses: actions/upload-artifact@v3
with:
name: api-test-report---pr-${{ github.run_number }}
path: |
${{ env.ALLURE_RESULTS_DIR }}
${{ env.ALLURE_REPORT_DIR }}
if-no-files-found: ignore
retention-days: 5
test-summary:
name: Post test results
if: |
always() &&
! github.event.pull_request.head.repo.fork &&
(
contains( needs.*.result, 'success' ) ||
contains( needs.*.result, 'failure' )
)
runs-on: ubuntu-20.04
permissions:
contents: read
needs:
- non-hpos-api-tests-run
- non-hpos-e2e-tests-run
steps:
- name: Create dirs
run: |
mkdir -p repo
mkdir -p artifacts/api
mkdir -p artifacts/e2e
mkdir -p output
- name: Checkout code
uses: actions/checkout@v4
with:
path: repo
- name: Download API test report artifact
uses: actions/download-artifact@v3
with:
name: api-test-report---pr-${{ github.run_number }}
path: artifacts/api
- name: Download Playwright E2E test report artifact
uses: actions/download-artifact@v3
with:
name: e2e-test-report---pr-${{ github.run_number }}
path: artifacts/e2e
- name: Prepare test summary
id: prepare-test-summary
uses: actions/github-script@v6
env:
API_SUMMARY_PATH: ${{ github.workspace }}/artifacts/api/allure-report/widgets/summary.json
E2E_PW_SUMMARY_PATH: ${{ github.workspace }}/artifacts/e2e/allure-report/widgets/summary.json
with:
result-encoding: string
script: |
const script = require( './repo/.github/workflows/scripts/prepare-test-summary-daily.js' )
return await script( { core } )

View File

@ -1,330 +0,0 @@
name: Run tests against PR
on:
workflow_dispatch:
pull_request:
paths-ignore:
- '**/changelog/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions: {}
jobs:
e2e-tests-run:
name: Runs E2E tests in matrix.
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
shard:
[
{ number: 1, name: 1/5 },
{ number: 2, name: 2/5 },
{ number: 3, name: 3/5 },
{ number: 4, name: 4/5 },
{ number: 5, name: 5/5 },
]
permissions:
contents: read
env:
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:
- uses: actions/checkout@v4
- name: Setup WooCommerce Monorepo
uses: ./.github/actions/setup-woocommerce-monorepo
with:
install: '@woocommerce/plugin-woocommerce...'
build: '@woocommerce/plugin-woocommerce'
- name: Load docker images and start containers.
working-directory: plugins/woocommerce
env:
WP_ENV_PHP_VERSION: 7.4
run: pnpm env:test
- name: Download and install Chromium browser.
working-directory: plugins/woocommerce
run: pnpm exec playwright install chromium
- name: Get total number of Playwright E2E tests to be run.
id: count_e2e_total
working-directory: plugins/woocommerce
run: |
TOTAL_STR=$(pnpm exec playwright test --config=tests/e2e-pw/playwright.config.js --list | grep "Total:")
NO_PREFIX=${TOTAL_STR#*"Total: "}
COUNT=${NO_PREFIX%" tests in"*}
echo "E2E_GRAND_TOTAL=$COUNT" >> $GITHUB_OUTPUT
- name: Run Playwright tests
working-directory: plugins/woocommerce
env:
USE_WP_ENV: 1
E2E_MAX_FAILURES: 15
FORCE_COLOR: 1
id: run_playwright_e2e_tests
run: pnpm exec playwright test --config=tests/e2e-pw/playwright.config.js --shard ${{ matrix.shard.name }}
- name: Upload reports to GitHub Actions Artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: all-blob-reports-${{ matrix.shard.number }}
path: ${{ env.ALLURE_RESULTS_DIR }}
retention-days: 1
compression-level: 9
e2e-tests-success:
name: Evaluate e2e tests results
runs-on: ubuntu-latest
needs: e2e-tests-run
if: ${{ always() }}
steps:
- run: |
result="${{ needs.e2e-tests-run.result }}"
if [[ $result != "success" && $result != "skipped" ]]; then
echo "One or more e2e tests have failed!"
exit 1
fi
echo "e2e tests have completed successfully."
merge-reports:
name: Merge e2e test reports
# Merge reports after playwright-tests, even if some shards have failed
if: always()
needs: [e2e-tests-success]
runs-on: ubuntu-latest
env:
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
steps:
- uses: actions/checkout@v4
- name: Setup WooCommerce Monorepo
uses: ./.github/actions/setup-woocommerce-monorepo
with:
install: '@woocommerce/plugin-woocommerce...'
build: '@woocommerce/plugin-woocommerce'
- name: Download blob reports from GitHub Actions Artifacts
uses: actions/download-artifact@v4
with:
path: ${{ env.ALLURE_RESULTS_DIR }}
pattern: all-blob-reports-*
run-id: e2e-tests-run
merge-multiple: true
- name: Generate Playwright E2E Test report.
id: generate_e2e_report
working-directory: plugins/woocommerce
run: pnpm exec allure generate --clean ${{ env.ALLURE_RESULTS_DIR }} --output ${{ env.ALLURE_REPORT_DIR }}
- name: Archive Playwright E2E test report
if: |
always() &&
steps.generate_e2e_report.conclusion == 'success'
uses: actions/upload-artifact@v4
with:
name: e2e-test-report---pr-${{ github.event.number }}
path: |
${{ env.ALLURE_RESULTS_DIR }}
${{ env.ALLURE_REPORT_DIR }}
if-no-files-found: ignore
retention-days: 5
api-tests-run:
name: Runs API tests.
runs-on: ubuntu-latest
permissions:
contents: read
env:
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@v4
- name: Setup WooCommerce Monorepo
uses: ./.github/actions/setup-woocommerce-monorepo
with:
install: '@woocommerce/plugin-woocommerce...'
build: '@woocommerce/plugin-woocommerce'
- name: Load docker images and start containers.
working-directory: plugins/woocommerce
env:
ENABLE_HPOS: 0
run: pnpm --filter=@woocommerce/plugin-woocommerce env:test
- name: Run Playwright API tests.
id: run_playwright_api_tests
working-directory: plugins/woocommerce
env:
BASE_URL: http://localhost:8086
USER_KEY: admin
USER_SECRET: password
run: pnpm exec playwright test --config=tests/api-core-tests/playwright.config.js
- name: Generate Playwright API Test report.
id: generate_api_report
if: |
always() &&
(
steps.run_playwright_api_tests.conclusion != 'cancelled' ||
steps.run_playwright_api_tests.conclusion != 'skipped'
)
working-directory: plugins/woocommerce
run: pnpm exec allure generate --clean ${{ env.ALLURE_RESULTS_DIR }} --output ${{ env.ALLURE_REPORT_DIR }}
- name: Archive Playwright API test report
if: |
always() &&
steps.generate_api_report.conclusion == 'success'
uses: actions/upload-artifact@v4
with:
name: api-test-report---pr-${{ github.event.number }}
path: |
${{ env.ALLURE_RESULTS_DIR }}
${{ env.ALLURE_REPORT_DIR }}
if-no-files-found: ignore
retention-days: 5
k6-tests-run:
name: Runs k6 Performance tests
if: github.event.pull_request.user.login != 'github-actions[bot]'
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Setup WooCommerce Monorepo
uses: ./.github/actions/setup-woocommerce-monorepo
with:
install: '@woocommerce/plugin-woocommerce...'
build: '@woocommerce/plugin-woocommerce'
- name: Load docker images and start containers.
working-directory: plugins/woocommerce
env:
ENABLE_HPOS: 0
run: |
pnpm --filter=@woocommerce/plugin-woocommerce env:dev
pnpm --filter=@woocommerce/plugin-woocommerce env:performance-init
- name: Install k6
run: |
curl https://github.com/grafana/k6/releases/download/v0.33.0/k6-v0.33.0-linux-amd64.tar.gz -L | tar xvz --strip-components 1
- name: Run k6 tests
run: |
./k6 run plugins/woocommerce/tests/performance/tests/gh-action-pr-requests.js
test-summary:
name: Post test results
if: |
always() &&
! github.event.pull_request.head.repo.fork &&
github.event.pull_request.user.login != 'github-actions[bot]' &&
(
contains( needs.*.result, 'success' ) ||
contains( needs.*.result, 'failure' )
)
runs-on: ubuntu-latest
needs: [api-tests-run, merge-reports]
permissions:
contents: read
issues: write
pull-requests: write
env:
E2E_GRAND_TOTAL: ${{needs.e2e-tests-run.outputs.E2E_GRAND_TOTAL}}
steps:
- name: Create dirs
run: |
mkdir -p repo
mkdir -p artifacts/api
mkdir -p artifacts/e2e
mkdir -p output
- name: Checkout code
uses: actions/checkout@v4
with:
path: repo
- name: Download API test report artifact
uses: actions/download-artifact@v4
with:
name: api-test-report---pr-${{ github.event.number }}
path: artifacts/api
- name: Download Playwright E2E test report artifact
uses: actions/download-artifact@v4
with:
name: e2e-test-report---pr-${{ github.event.number }}
path: artifacts/e2e
- name: Prepare test summary
id: prepare-test-summary
uses: actions/github-script@v7
env:
API_SUMMARY_PATH: ${{ github.workspace }}/artifacts/api/allure-report/widgets/summary.json
E2E_PW_SUMMARY_PATH: ${{ github.workspace }}/artifacts/e2e/allure-report/widgets/summary.json
PR_NUMBER: ${{ github.event.number }}
SHA: ${{ github.event.pull_request.head.sha }}
with:
result-encoding: string
script: |
const script = require( './repo/.github/workflows/scripts/prepare-test-summary.js' )
return await script( { core } )
- name: Find PR comment by github-actions[bot]
uses: peter-evans/find-comment@d5fe37641ad8451bdd80312415672ba26c86575e
id: find-comment
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: Test Results Summary
- name: Create or update PR comment
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043
with:
comment-id: ${{ steps.find-comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: ${{ steps.prepare-test-summary.outputs.result }}
edit-mode: replace
publish-test-reports:
name: Publish test reports
if: |
always() &&
! github.event.pull_request.head.repo.fork &&
github.event.pull_request.user.login != 'github-actions[bot]' &&
(
contains( needs.*.result, 'success' ) ||
contains( needs.*.result, 'failure' )
)
runs-on: ubuntu-latest
needs: [api-tests-run, merge-reports, k6-tests-run]
env:
GITHUB_TOKEN: ${{ secrets.REPORTS_TOKEN }}
PR_NUMBER: ${{ github.event.number }}
RUN_ID: ${{ github.run_id }}
COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
steps:
- name: Publish test reports
env:
API_ARTIFACT: api-test-report---pr-${{ github.event.number }}
E2E_ARTIFACT: e2e-test-report---pr-${{ github.event.number }}
run: |
gh workflow run publish-test-reports-pr.yml \
-f run_id=$RUN_ID \
-f api_artifact=$API_ARTIFACT \
-f e2e_artifact=$E2E_ARTIFACT \
-f pr_number=$PR_NUMBER \
-f commit_sha=$COMMIT_SHA \
-f s3_root=public \
--repo woocommerce/woocommerce-test-reports

View File

@ -1,26 +0,0 @@
name: Check daily smoke test site status.
on:
schedule:
- cron: '25 7 * * *'
permissions: {}
jobs:
ping_site:
runs-on: ubuntu-20.04
name: Check site and notify if not found
steps:
- name: Check site status
id: sitecheck
uses: srt32/uptime@958231f4d95c117f08eb0fc70907e80d0dfedf2b
with:
url-to-hit: "${{ secrets.SMOKE_TEST_URL }}ready/"
expected-statuses: "200,301"
- name: Send message to Slack API
if: failure()
uses: archive/github-actions-slack@deecc2edc496dc642d643de1d7cf3a47f51fb27a
id: notify
with:
slack-bot-user-oauth-access-token: ${{ secrets.SMOKE_TEST_SLACK_TOKEN }}
slack-channel: ${{ secrets.SMOKE_TEST_SLACK_CHANNEL }}
slack-text: ':warning: <!subteam^${{ secrets.SMOKE_TEST_SLACK_GROUP }}> FYI the URL ${{ secrets.SMOKE_TEST_URL }}ready/ appears to be returning `404 not found` :x:'

View File

@ -1,179 +0,0 @@
name: Run tests against trunk after PR merge
on:
workflow_dispatch:
pull_request:
types:
- closed
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
permissions: {}
jobs:
api:
name: Run API tests
runs-on: ubuntu-latest
if: (github.event.pull_request.merged == true) && (github.event.pull_request.base.ref == 'trunk')
permissions:
contents: read
env:
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
ARTIFACT_NAME: api-pr-merge-${{ github.event.pull_request.number }}-run-${{ github.run_number }}
steps:
- name: Checkout merge commit on trunk
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.merge_commit_sha }}
- name: Setup WooCommerce Monorepo
uses: ./.github/actions/setup-woocommerce-monorepo
with:
install: '@woocommerce/plugin-woocommerce...'
build: '@woocommerce/plugin-woocommerce'
- name: Setup local test environment
uses: ./.github/actions/tests/setup-local-test-environment
with:
test-type: api
- name: Run API tests
id: run-api-composite-action
uses: ./.github/actions/tests/run-api-tests
with:
report-name: ${{ env.ARTIFACT_NAME }}
- name: Upload Allure files to bucket
if: success() || ( failure() && steps.run-api-composite-action.conclusion == 'failure' )
uses: ./.github/actions/tests/upload-allure-files-to-bucket
with:
aws-access-key-id: ${{ secrets.REPORTS_AWS_ACCESS_KEY_ID }}
aws-region: ${{ secrets.REPORTS_AWS_REGION }}
aws-secret-access-key: ${{ secrets.REPORTS_AWS_SECRET_ACCESS_KEY }}
artifact-name: ${{ env.ARTIFACT_NAME }}
s3-bucket: ${{ secrets.REPORTS_BUCKET }}
- name: Publish Allure report
if: success() || ( failure() && steps.run-api-composite-action.conclusion == 'failure' )
env:
GITHUB_TOKEN: ${{ secrets.REPORTS_TOKEN }}
run: |
gh workflow run publish-test-reports-trunk-merge.yml \
-f run_id=${{ github.run_id }} \
-f artifact=${{ env.ARTIFACT_NAME }} \
-f pr_number=${{ github.event.pull_request.number }} \
-f test_type="api" \
--repo woocommerce/woocommerce-test-reports
- name: Send Slack alert on test failure
if: failure() && steps.run-api-composite-action.conclusion == 'failure'
uses: ./.github/actions/tests/slack-alert-on-pr-merge
with:
slack-bot-token: ${{ secrets.E2E_SLACK_TOKEN }}
channel-id: ${{ secrets.E2E_TRUNK_SLACK_CHANNEL }}
test-type: API
e2e:
name: Run E2E tests
needs: [api]
runs-on: ubuntu-latest
permissions:
contents: read
env:
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
ARTIFACT_NAME: e2e-pr-merge-${{ github.event.pull_request.number }}-run-${{ github.run_number }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.merge_commit_sha }}
- name: Setup WooCommerce Monorepo
uses: ./.github/actions/setup-woocommerce-monorepo
with:
install: '@woocommerce/plugin-woocommerce...'
build: '@woocommerce/plugin-woocommerce'
- name: Setup local test environment
uses: ./.github/actions/tests/setup-local-test-environment
with:
test-type: e2e
- name: Run E2E tests
id: run-e2e-composite-action
timeout-minutes: 60
uses: ./.github/actions/tests/run-e2e-tests
env:
E2E_MAX_FAILURES: 15
with:
report-name: ${{ env.ARTIFACT_NAME }}
- name: Upload Allure files to bucket
if: success() || ( failure() && steps.run-e2e-composite-action.conclusion == 'failure' )
uses: ./.github/actions/tests/upload-allure-files-to-bucket
with:
aws-access-key-id: ${{ secrets.REPORTS_AWS_ACCESS_KEY_ID }}
aws-region: ${{ secrets.REPORTS_AWS_REGION }}
aws-secret-access-key: ${{ secrets.REPORTS_AWS_SECRET_ACCESS_KEY }}
artifact-name: ${{ env.ARTIFACT_NAME }}
s3-bucket: ${{ secrets.REPORTS_BUCKET }}
include-allure-results: false
- name: Publish Allure report
if: success() || ( failure() && steps.run-e2e-composite-action.conclusion == 'failure' )
env:
GITHUB_TOKEN: ${{ secrets.REPORTS_TOKEN }}
run: |
gh workflow run publish-test-reports-trunk-merge.yml \
-f run_id=${{ github.run_id }} \
-f artifact=${{ env.ARTIFACT_NAME }} \
-f pr_number=${{ github.event.pull_request.number }} \
-f test_type="e2e" \
--repo woocommerce/woocommerce-test-reports
- name: Send Slack alert on test failure
if: failure() && steps.run-e2e-composite-action.conclusion == 'failure'
uses: ./.github/actions/tests/slack-alert-on-pr-merge
with:
slack-bot-token: ${{ secrets.E2E_SLACK_TOKEN }}
channel-id: ${{ secrets.E2E_TRUNK_SLACK_CHANNEL }}
test-type: E2E
k6:
name: Runs k6 Performance tests
if: (github.event.pull_request.user.login != 'github-actions[bot]') && (github.event.pull_request.merged == true) && (github.event.pull_request.base.ref == 'trunk')
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Setup WooCommerce Monorepo
uses: ./.github/actions/setup-woocommerce-monorepo
with:
install: '@woocommerce/plugin-woocommerce...'
build: '@woocommerce/plugin-woocommerce'
- name: Load docker images and start containers.
working-directory: plugins/woocommerce
env:
ENABLE_HPOS: 0
run: |
pnpm --filter=@woocommerce/plugin-woocommerce env:dev
pnpm --filter=@woocommerce/plugin-woocommerce env:performance-init
- name: Install k6
run: |
curl https://github.com/grafana/k6/releases/download/v0.33.0/k6-v0.33.0-linux-amd64.tar.gz -L | tar xvz --strip-components 1
- name: Run k6 tests
run: |
./k6 run plugins/woocommerce/tests/performance/tests/gh-action-pr-requests.js
- name: Send Slack alert on test failure
if: failure() && steps.run-k6-composite-action.conclusion == 'failure'
uses: ./.github/actions/tests/slack-alert-on-pr-merge
with:
slack-bot-token: ${{ secrets.E2E_SLACK_TOKEN }}
channel-id: ${{ secrets.E2E_TRUNK_SLACK_CHANNEL }}
test-type: k6

View File

@ -18,6 +18,8 @@ jobs:
- name: Setup WooCommerce Monorepo
uses: ./.github/actions/setup-woocommerce-monorepo
with:
pull-package-deps: '@woocommerce/plugin-woocommerce'
- name: Build zip
working-directory: plugins/woocommerce

View File

@ -24,6 +24,8 @@ jobs:
- name: Setup WooCommerce Monorepo
uses: ./.github/actions/setup-woocommerce-monorepo
with:
pull-package-deps: '@woocommerce/plugin-woocommerce'
- name: Build zip
working-directory: plugins/woocommerce

View File

@ -1,30 +0,0 @@
name: WP Nightly Tests
on:
schedule:
- cron: '17 4 * * *' # Run at 4:17 AM UTC.
workflow_dispatch:
permissions: {}
jobs:
nightly:
name: Run Tests Against Nightly
runs-on: ubuntu-20.04
steps:
- uses: 'actions/checkout@v3'
name: 'Checkout'
with:
fetch-depth: 0
- uses: './.github/actions/setup-woocommerce-monorepo'
name: 'Setup Monorepo'
id: 'setup-monorepo'
with:
install: '@woocommerce/plugin-woocommerce...'
build: '@woocommerce/plugin-woocommerce'
- name: 'Prepare Test Environment'
id: 'prepare-test-environment'
env:
WP_ENV_CORE: 'https://wordpress.org/nightly-builds/wordpress-latest.zip'
run: 'pnpm --filter="@woocommerce/plugin-woocommerce" env:test'
- name: 'Test'
run: 'pnpm --filter="@woocommerce/plugin-woocommerce" test:php:env'

View File

@ -27,6 +27,7 @@ jobs:
with:
install: true
build: './tools/package-release'
pull-package-deps: 'tools/package-release'
- name: Clean working directory
run: git checkout pnpm-lock.yaml # in case for whatever reason the lockfile is out of sync, there won't be interference with npm publish.

View File

@ -0,0 +1,53 @@
name: Compressed Size
on:
pull_request:
paths:
- '**.jsx?'
- '**.tsx?'
- '**.css'
- '**.scss'
- '**package*.json'
- '**.eslint*'
- '**.prettier*'
- '**.tsconfig*'
- '**/webpack.config.js'
- '!.github/**'
- '!packages/js/*e2e*/**'
- '!packages/js/*plugin*/**'
- '!packages/js/*internal*/**'
- '!packages/js/*create*/**'
- '!**/*.spec.*'
- '!**/tests/**'
- '!tools/**'
- '!changelog/**'
- '!docs/**'
- '!bin/**'
- '.github/workflows/pr-assess-bundle-size.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
jobs:
build:
name: Check Asset Sizes
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Setup WooCommerce Monorepo
uses: ./.github/actions/setup-woocommerce-monorepo
with:
# Both install and build are handled by compressed-size-action.
install: false
build: false
- uses: preactjs/compressed-size-action@f780fd104362cfce9e118f9198df2ee37d12946c
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
pattern: './{packages/js/!(*e2e*|*internal*|*test*|*plugin*|*create*),plugins/woocommerce-blocks}/{build,build-style}/**/*.{js,css}'
clean-script: '--if-present distclean'
minimum-change-threshold: 100
omit-unchanged: true

View File

@ -1,8 +1,7 @@
name: Build PR Live Branch
name: Build Live Branch
on:
pull_request:
paths-ignore:
- '.github/**'
- 'docs/**'
- 'packages/php/**'
- 'tools/**'
@ -22,9 +21,12 @@ jobs:
if: github.repository_owner == 'woocommerce' && github.event.pull_request.user.login != 'github-actions[bot]'
runs-on: ubuntu-20.04
permissions:
contents: read
contents: write
pull-requests: write
repository-projects: write
id-token: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Get current version
id: version
@ -37,16 +39,16 @@ jobs:
- name: Setup WooCommerce Monorepo
uses: ./.github/actions/setup-woocommerce-monorepo
with:
pull-package-deps: '@woocommerce/plugin-woocommerce'
- name: Prepare plugin zips
id: prepare
env:
CURRENT_VERSION: ${{ steps.version.outputs.version }}
# Build with experimental blocks.
WOOCOMMERCE_BLOCKS_PHASE: 3
run: |
# Current version must compare greather than any previously used current version for this PR.
# Current version must compare greater than any previously used current version for this PR.
# Assume GH run IDs are monotonic.
VERSUFFIX="${GITHUB_RUN_ID}-g$(git rev-parse --short HEAD)"
@ -59,21 +61,22 @@ jobs:
bash bin/build-zip.sh
mkdir "$GITHUB_WORKSPACE/zips"
cp "$GITHUB_WORKSPACE/plugins/woocommerce/woocommerce.zip" "$GITHUB_WORKSPACE/zips/woocommerce.zip"
mkdir -p "$GITHUB_WORKSPACE/unzips/woocommerce"
mv "$GITHUB_WORKSPACE/plugins/woocommerce/woocommerce.zip" "$GITHUB_WORKSPACE/zips/woocommerce.zip"
cd "$GITHUB_WORKSPACE/zips"
unzip woocommerce.zip
unzip -qq woocommerce.zip
cp -r woocommerce "$GITHUB_WORKSPACE/unzips/woocommerce/woocommerce"
rm woocommerce.zip
mv woocommerce woocommerce-dev
zip -q -r "woocommerce-dev.zip" "woocommerce-dev/"
zip -q -r -9 "woocommerce-dev.zip" "woocommerce-dev/"
rm -fR "$GITHUB_WORKSPACE/zips/woocommerce-dev"
# Plugin data is passed as a JSON object.
PLUGIN_DATA="{}"
PLUGIN_DATA=$( jq -c --arg slug "woocommerce" --arg ver "$CURRENT_VERSION" '.[ $slug ] = { version: $ver }' <<<"$PLUGIN_DATA" )
echo "plugin-data=$PLUGIN_DATA" >> $GITHUB_OUTPUT
- name: Create plugins artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: steps.prepare.outputs.plugin-data != '{}'
with:
name: plugins
@ -81,8 +84,16 @@ jobs:
# Only need to retain for a day since the beta builder slurps it up to distribute.
retention-days: 1
- name: Inform Beta Download webhook
- name: Create playground artifact
uses: actions/upload-artifact@v4
if: steps.prepare.outputs.plugin-data != '{}'
with:
name: plugins-${{ github.run_id }}
path: unzips/woocommerce
retention-days: 30
- name: Inform Beta Download webhook if this is an internal PR
if: steps.prepare.outputs.plugin-data != '{}' && ! github.event.pull_request.head.repo.fork
env:
SECRET: ${{ secrets.WOOBETA_SECRET }}
PLUGIN_DATA: ${{ steps.prepare.outputs.plugin-data }}
@ -94,3 +105,11 @@ jobs:
--form-string "branch=${GITHUB_REF#refs/heads/}" \
--form-string "plugins=$PLUGIN_DATA" \
--form-string "secret=$SECRET"
- name: Comment on PR with WordPress Playground details
uses: actions/github-script@v7
if: steps.prepare.outputs.plugin-data != '{}'
with:
script: |
const { run } = require('./.github/workflows/scripts/generate-playground-blueprint');
run({ github, context, core });

View File

@ -17,9 +17,13 @@ jobs:
with:
install: 'code-analyzer...'
build: 'code-analyzer'
pull-package-deps: 'code-analyzer'
- name: 'Analyze'
id: 'analyze'
working-directory: 'tools/code-analyzer'
env:
GIT_CLONE_PROTECTION_ACTIVE: false
run: |
HEAD_REF=$(git rev-parse HEAD)
exclude="plugins/woocommerce/tests plugins/woocommerce-admin/tests plugins/woocommerce-blocks/tests"

View File

@ -15,29 +15,30 @@ jobs:
- name: Get repo changed files
id: repo-changed-files
uses: tj-actions/changed-files@v37
uses: tj-actions/changed-files@v41
with:
files: |
**/*.md
files_ignore: |
docs/**/*.md
.github/**/*.md
- name: Get docs changed files
id: docs-changed-files
uses: tj-actions/changed-files@v37
uses: tj-actions/changed-files@v41
with:
files: |
docs/**/*.md
- name: Get docs manifest
id: docs-manifest
uses: tj-actions/changed-files@v37
uses: tj-actions/changed-files@v41
with:
files: |
docs/docs-manifest.json
- name: Setup PNPM
uses: pnpm/action-setup@c3b53f6a16e57305370b4ae5a540c2077a1d50dd
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2
with:
version: '8.6.7'

View File

@ -1,105 +0,0 @@
name: Run smoke tests against pull request.
on:
pull_request:
paths-ignore:
- '**/changelog/**'
branches:
- trunk
types:
- labeled
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
- name: Setup WooCommerce Monorepo
uses: ./.github/actions/setup-woocommerce-monorepo
with:
install: '@woocommerce/plugin-woocommerce...'
build: '@woocommerce/plugin-woocommerce'
- name: Install Jest
run: pnpm install -g jest
- name: Run smoke test.
working-directory: plugins/woocommerce
if: always()
env:
SMOKE_TEST_URL: ${{ secrets.SMOKE_TEST_URL }}
SMOKE_TEST_ADMIN_USER: ${{ secrets.SMOKE_TEST_ADMIN_USER }}
SMOKE_TEST_ADMIN_PASSWORD: ${{ secrets.SMOKE_TEST_ADMIN_PASSWORD }}
SMOKE_TEST_ADMIN_USER_EMAIL: ${{ secrets.SMOKE_TEST_ADMIN_USER_EMAIL }}
SMOKE_TEST_CUSTOMER_USER: ${{ secrets.SMOKE_TEST_CUSTOMER_USER }}
SMOKE_TEST_CUSTOMER_PASSWORD: ${{ secrets.SMOKE_TEST_CUSTOMER_PASSWORD }}
WC_E2E_SCREENSHOTS: 1
E2E_RETEST: 1
E2E_SLACK_TOKEN: ${{ secrets.SMOKE_TEST_SLACK_TOKEN }}
E2E_SLACK_CHANNEL: ${{ secrets.SMOKE_TEST_SLACK_CHANNEL }}
UPDATE_WC: 1
DEFAULT_TIMEOUT_OVERRIDE: 120000
run: |
pnpm exec wc-e2e test:e2e tests/e2e/specs/smoke-tests/update-woocommerce.js
- name: Post Smoke tests results comment on PR
if: always()
uses: actions/github-script@v5
env:
TITLE: 'Smoke Test Results'
SMOKE_TEST_URL: ${{ secrets.SMOKE_TEST_URL }}
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const script = require( './packages/js/e2e-environment/bin/post-results-to-github-pr.js' )
await script({github, context})
- name: Run E2E tests.
working-directory: plugins/woocommerce
if: always()
env:
SMOKE_TEST_URL: ${{ secrets.SMOKE_TEST_URL }}
SMOKE_TEST_ADMIN_USER: ${{ secrets.SMOKE_TEST_ADMIN_USER }}
SMOKE_TEST_ADMIN_PASSWORD: ${{ secrets.SMOKE_TEST_ADMIN_PASSWORD }}
SMOKE_TEST_ADMIN_USER_EMAIL: ${{ secrets.SMOKE_TEST_ADMIN_USER_EMAIL }}
SMOKE_TEST_CUSTOMER_USER: ${{ secrets.SMOKE_TEST_CUSTOMER_USER }}
SMOKE_TEST_CUSTOMER_PASSWORD: ${{ secrets.SMOKE_TEST_CUSTOMER_PASSWORD }}
WC_E2E_SCREENSHOTS: 1
E2E_RETEST: 1
E2E_SLACK_TOKEN: ${{ secrets.SMOKE_TEST_SLACK_TOKEN }}
E2E_SLACK_CHANNEL: ${{ secrets.SMOKE_TEST_SLACK_CHANNEL }}
UPDATE_WC: 1
DEFAULT_TIMEOUT_OVERRIDE: 120000
run: |
pnpm exec wc-e2e test:e2e
- name: Post E2E tests results comment on PR
if: always()
uses: actions/github-script@v5
env:
TITLE: 'E2E Test Results'
SMOKE_TEST_URL: ${{ secrets.SMOKE_TEST_URL }}
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const script = require( './packages/js/e2e-environment/bin/post-results-to-github-pr.js' )
await script({github, context})
- name: Remove label from pull request.
if: |
always()
&& contains( github.event.pull_request.labels.*.name, format('run{0} smoke tests', ':'))
uses: actions-ecosystem/action-remove-labels@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
labels: 'run: smoke tests'

View File

@ -26,6 +26,7 @@ jobs:
with:
install: true
build: './tools/package-release'
pull-package-deps: 'tools/package-release'
- name: Execute script
run: ./tools/package-release/bin/dev prepare ${{ github.event.inputs.packages }}

View File

@ -56,7 +56,7 @@ jobs:
echo "PNPM Version: $version"
- name: Setup PNPM
uses: pnpm/action-setup@c3b53f6a16e57305370b4ae5a540c2077a1d50dd
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2
with:
version: ${{ steps.read-pnpm-version.outputs.version }}
@ -149,7 +149,7 @@ jobs:
fetch-depth: 0
- name: Setup PNPM
uses: pnpm/action-setup@c3b53f6a16e57305370b4ae5a540c2077a1d50dd
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2
with:
version: ${{ needs.code-freeze-prep.outputs.pnpmVersion }}
@ -191,6 +191,8 @@ jobs:
- name: Setup WooCommerce Monorepo
uses: ./.github/actions/setup-woocommerce-monorepo
with:
pull-package-deps: '@woocommerce/plugin-woocommerce'
- name: Build zip
working-directory: plugins/woocommerce
@ -219,6 +221,8 @@ jobs:
- name: Setup WooCommerce Monorepo
uses: ./.github/actions/setup-woocommerce-monorepo
with:
pull-package-deps: '@woocommerce/plugin-woocommerce'
- name: Build zip
working-directory: plugins/woocommerce
@ -271,7 +275,7 @@ jobs:
fetch-depth: 0
- name: Setup PNPM
uses: pnpm/action-setup@c3b53f6a16e57305370b4ae5a540c2077a1d50dd
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2
with:
version: ${{ needs.code-freeze-prep.outputs.pnpmVersion }}
@ -342,7 +346,7 @@ jobs:
fetch-depth: 0
- name: Setup PNPM
uses: pnpm/action-setup@c3b53f6a16e57305370b4ae5a540c2077a1d50dd
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2
with:
version: ${{ needs.code-freeze-prep.outputs.pnpmVersion }}

View File

@ -20,7 +20,9 @@ jobs:
- name: Setup WooCommerce Monorepo
uses: ./.github/actions/setup-woocommerce-monorepo
with:
install: '@woocommerce/plugin-woocommerce-beta-tester'
install: '@woocommerce/plugin-woocommerce'
build: '@woocommerce/plugin-woocommerce'
pull-package-deps: '@woocommerce/plugin-woocommerce-beta-tester'
- name: Lint
working-directory: plugins/woocommerce-beta-tester

View File

@ -17,10 +17,10 @@ jobs:
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c
- name: Install Octokit
run: npm --prefix .github/workflows/scripts install @octokit/action
run: npm --prefix .github/workflows/scripts install @octokit/action@~6.1.0
- name: Install Actions Core
run: npm --prefix .github/workflows/scripts install @actions/core
run: npm --prefix .github/workflows/scripts install @actions/core@~1.10.1
- name: Check if user is a community contributor
id: is-community-contributor

View File

@ -0,0 +1,83 @@
#!/bin/bash
# Assuming all necessary environment variables like GITHUB_EVENT_PATH are correctly set
# Function to calculate the second Tuesday of the given month and year
# as the release day is always the 2nd Tuesday
calculate_second_tuesday() {
year=$1
month=$2
first_of_month="$year-$month-01"
day_of_week=$(date -d "$first_of_month" "+%u")
offset_to_first_tuesday=$(( (9 - day_of_week) % 7 ))
first_tuesday=$(date -d "$first_of_month +$offset_to_first_tuesday days" "+%Y-%m-%d")
# Calculate the second Tuesday by adding 7 days
second_tuesday=$(date -d "$first_tuesday +7 days" "+%Y-%m-%d")
echo $second_tuesday
}
# Set the initial values for version calculation
initial_version_major=8 # Major version start
initial_version_minor=8 # Minor version start
initial_year=2024
initial_month=4 # April, for the 8.8.0 release
# Assuming the script is run in or after 2024
current_year=$(date +%Y) # Get the current year
# Calculate the number of versions to generate based on the current year
additional_versions=$(( (current_year - 2024 + 1) * 12 ))
# Versions to calculate
versions_to_calculate=$additional_versions
# Declare the associative array outside the loop
declare -A MILESTONE_DATES
for (( i=0; i<versions_to_calculate; i++ )); do
# Calculate year and month offset
offset_year=$(( (initial_month + i - 1) / 12 ))
current_year=$(( initial_year + offset_year ))
current_month=$(( (initial_month + i - 1) % 12 + 1 ))
# Format current month correctly
current_month_formatted=$(printf "%02d" $current_month)
# Calculate the release date
release_date=$(calculate_second_tuesday $current_year $current_month_formatted)
# Calculate the total versions from start, adjusting for starting at 8.8.0
total_versions_from_start=$(( i + initial_version_minor ))
# Adjust version major and minor calculations
version_major=$(( initial_version_major + total_versions_from_start / 10 ))
version_minor=$(( total_versions_from_start % 10 ))
# Construct version string
version="$version_major.$version_minor.0"
# Populate the associative array with version as key and release_date as value
MILESTONE_DATES["$version"]=$release_date
echo "Version $version will be released on $release_date"
done
MILESTONE_TITLE="${GITHUB_EVENT_PATH_PULL_REQUEST_MILESTONE_TITLE}"
MILESTONE_DATE="Undefined"
# Check if the milestone title exists in our predefined list and get the date
if [[ -v "MILESTONE_DATES[${MILESTONE_TITLE}]" ]]; then
MILESTONE_DATE=${MILESTONE_DATES[${MILESTONE_TITLE}]}
fi
# Export for later steps
echo "MILESTONE_DATE=${MILESTONE_DATE}" >> $GITHUB_ENV
# Print the array in the desired format for display purposes
echo "MILESTONE_DATES=("
for version in "${!MILESTONE_DATES[@]}"; do
echo " [\"$version\"]=\"${MILESTONE_DATES[$version]}\""
done
echo ")"

View File

@ -1,19 +0,0 @@
module.exports = async ( { github, context, core } ) => {
const { ASSET_ID: asset_id } = process.env;
const { owner, repo } = context.repo;
const fs = require( 'fs' );
const path = require( 'path' );
const response = await github.rest.repos.getReleaseAsset( {
owner,
repo,
asset_id,
headers: { accept: 'application/octet-stream' },
} );
const zipPath = path.resolve( 'tmp', 'woocommerce.zip' );
fs.mkdirSync( 'tmp' );
fs.writeFileSync( zipPath, Buffer.from( response.data ) );
core.setOutput( 'zip-path', zipPath );
};

View File

@ -0,0 +1,102 @@
[
{
"status": "completed",
"conclusion": "success",
"name": "Successful required job"
},
{
"status": "completed",
"conclusion": "success",
"name": "Successful job (optional)"
},
{
"status": "completed",
"conclusion": "failure",
"name": "Failed required job"
},
{
"status": "completed",
"conclusion": "failure",
"name": "Failed job (optional)"
},
{
"status": "completed",
"conclusion": "cancelled",
"name": "Cancelled required job"
},
{
"status": "completed",
"conclusion": "cancelled",
"name": "Cancelled job (optional)"
},
{
"status": "completed",
"conclusion": "skipped",
"name": "Skipped required job"
},
{
"status": "completed",
"conclusion": "skipped",
"name": "Skipped job (optional)"
},
{
"status": "queued",
"conclusion": "",
"name": "Queued required job"
},
{
"status": "queued",
"conclusion": "",
"name": "Queued job (optional)"
},
{
"status": "in_progress",
"conclusion": "",
"name": "In progress required job"
},
{
"status": "in_progress",
"conclusion": "",
"name": "In progress job (optional)"
},
{
"status": "unknown_status",
"conclusion": "",
"name": "Required job with unknown status"
},
{
"status": "unknown_status",
"conclusion": "",
"name": "Job with unknown status (optional)"
},
{
"status": "completed",
"conclusion": "unknown_conclusion",
"name": "Required job with unknown conclusion"
},
{
"status": "completed",
"conclusion": "unknown_conclusion",
"name": "Job with unknown conclusion (optional)"
},
{
"status": "in_progress",
"conclusion": "",
"name": "Publish reports in_progress"
},
{
"status": "completed",
"conclusion": "",
"name": "Publish reports - failed"
},
{
"status": "completed",
"conclusion": "",
"name": "Another Publish reports that failed"
},
{
"status": "queued",
"conclusion": "",
"name": "Publish reports job queued"
}
]

View File

@ -0,0 +1,109 @@
/* eslint-disable no-console */
const { REPOSITORY, RUN_ID, GITHUB_TOKEN, TEST_MODE } = process.env;
const IGNORED_JOBS = [
/Evaluate Project Job Statuses/,
/Report results on Slack/,
/Test reports/,
/Create issues for flaky tests/,
];
const isJobRequired = ( job ) => {
return (
! job.name.endsWith( '(optional)' ) &&
! IGNORED_JOBS.some( ( ignoredJobRegex ) =>
ignoredJobRegex.test( job.name )
)
);
};
const fetchJobs = async () => {
let url = `https://api.github.com/repos/${ REPOSITORY }/actions/runs/${ RUN_ID }/jobs`;
const nextPattern = /(?<=<)([\S]*)(?=>; rel="Next")/i;
let pagesRemaining = true;
const jobs = [];
while ( pagesRemaining ) {
console.log( 'Fetching:', url );
try {
const response = await fetch( url, {
headers: {
'User-Agent': 'node.js',
Authorization: `Bearer ${ GITHUB_TOKEN }`,
},
} );
const data = await response.json();
jobs.push( ...data.jobs );
const linkHeader = response.headers.get( 'link' );
pagesRemaining =
linkHeader && linkHeader.includes( `rel=\"next\"` );
if ( pagesRemaining ) {
url = linkHeader.match( nextPattern )[ 0 ];
}
} catch ( error ) {
console.error( 'Error:', error );
// We want to fail if there is an error getting the jobs conclusions
process.exit( 1 );
}
}
return jobs;
};
const evaluateJobs = async () => {
let jobs;
if ( TEST_MODE ) {
jobs = require( './evaluate-jobs-conclusions-test-data.json' );
} else {
jobs = await fetchJobs();
}
const nonSuccessfulCompletedJobs = jobs.filter(
( job ) =>
job.status === 'completed' &&
job.conclusion !== 'success' &&
job.conclusion !== 'skipped'
);
console.log( 'Workflow jobs:', jobs.length );
console.log(
'Non successful completed jobs:',
nonSuccessfulCompletedJobs.length
);
const failed = [];
nonSuccessfulCompletedJobs.forEach( ( job ) => {
const jobPrintName = `'${ job.name }': ${ job.status }, ${ job.conclusion }`;
if ( isJobRequired( job ) ) {
console.error( `${ jobPrintName }, required` );
failed.push( job.name );
} else {
console.warn( `${ jobPrintName }, optional` );
}
} );
if ( failed.length > 0 ) {
console.error( 'Failed required jobs:', failed );
process.exit( 1 );
}
};
const validateEnvironmentVariables = ( variables ) => {
if ( TEST_MODE ) {
return;
}
variables.forEach( ( variable ) => {
if ( ! process.env[ variable ] ) {
console.error( `Missing ${ variable } environment variable` );
process.exit( 1 );
}
} );
};
validateEnvironmentVariables( [ 'REPOSITORY', 'RUN_ID', 'GITHUB_TOKEN' ] );
evaluateJobs().then( () => {
console.log( 'All required jobs passed' );
} );

View File

@ -1,54 +0,0 @@
/**
* A script that fetches the asset id of a given release and sets it as the output for the step that calls it
*/
const https = require('https');
const options = {
hostname: 'api.github.com',
port: 443,
path: `/repos/${process.env.REPO}/releases/${process.env.RELEASE_ID}/assets`,
method: 'GET',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${ process.env.GITHUB_TOKEN }`,
'User-Agent': 'WooCommerce Smoke Build'
},
};
/**
*
* @returns {Promise}
*/
const fetchAssetId = () => {
return new Promise( ( resolve, reject ) => {
const request = https.get( options, ( response ) => {
response.setEncoding('utf8');
let responseBody = '';
response.on( 'data', ( chunk ) => {
responseBody += chunk;
} );
response.on( 'end', () => {
const assets = JSON.parse( responseBody );
// use the most recently uploaded asset
resolve( assets[ assets.length - 1 ].id );
} );
} );
request.on('error', ( error ) => {
reject( error );
} );
request.end();
} );
}
module.exports = async ( { github, context, core } ) => {
const id = await fetchAssetId();
// set asset_id as the output
core.setOutput( 'asset_id', id );
}

View File

@ -0,0 +1,102 @@
const https = require( 'https' );
const generateWordpressPlaygroundBlueprint = ( runId, prNumber ) => {
const defaultSchema = {
landingPage: '/wp-admin/admin.php?page=wc-admin',
preferredVersions: {
php: '8.0',
wp: 'latest',
},
phpExtensionBundles: [ 'kitchen-sink' ],
features: { networking: true },
steps: [
{
step: 'installPlugin',
pluginZipFile: {
resource: 'url',
url: `https://playground.wordpress.net/plugin-proxy.php?org=woocommerce&repo=woocommerce&workflow=Build%20Live%20Branch&artifact=plugins-${ runId }&pr=${ prNumber }`,
},
options: {
activate: true,
},
},
{
step: 'installPlugin',
pluginZipFile: {
resource: 'url',
url: `https://github-proxy.com/https://github.com/woocommerce/woocommerce/releases/download/wc-beta-tester-2.3.1/woocommerce-beta-tester.zip`,
},
options: {
activate: true,
},
},
{
step: 'login',
username: 'admin',
password: 'password',
},
],
plugins: [],
};
return defaultSchema;
};
async function run( { github, context, core } ) {
const commentInfo = {
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
};
const comments = ( await github.rest.issues.listComments( commentInfo ) )
.data;
let existingCommentId = null;
for ( const currentComment of comments ) {
if (
currentComment.user.type === 'Bot' &&
currentComment.body.includes( 'Test using WordPress Playground' )
) {
existingCommentId = currentComment.id;
break;
}
}
const defaultSchema = generateWordpressPlaygroundBlueprint(
context.runId,
context.issue.number
);
const url = `https://playground.wordpress.net/#${ JSON.stringify(
defaultSchema
) }`;
const body = `
## Test using WordPress Playground
The changes in this pull request can be previewed and tested using a [WordPress Playground](https://developer.wordpress.org/playground/) instance.
[WordPress Playground](https://developer.wordpress.org/playground/) is an experimental project that creates a full WordPress instance entirely within the browser.
[Test this pull request with WordPress Playground](${ url }).
Note that this URL is valid for 30 days from when this comment was last updated. You can update it by closing/reopening the PR or pushing a new commit.
`;
if ( existingCommentId ) {
await github.rest.issues.updateComment( {
owner: commentInfo.owner,
repo: commentInfo.repo,
comment_id: existingCommentId,
body: body,
} );
} else {
commentInfo.body = body;
await github.rest.issues.createComment( commentInfo );
}
}
module.exports = { run };

View File

@ -0,0 +1,43 @@
/* eslint-disable no-console */
const fs = require( 'fs' );
const { RELEASE_TAG, ARTIFACT_NAME, WP_ENV_CONFIG_PATH } = process.env;
if ( ! RELEASE_TAG ) {
console.error( 'Please set the RELEASE_TAG environment variable!' );
process.exit( 1 );
}
if ( ! ARTIFACT_NAME ) {
console.error( 'Please set the ARTIFACT_NAME environment variable!' );
process.exit( 1 );
}
if ( ! WP_ENV_CONFIG_PATH ) {
console.error( 'Please set the WP_ENV_CONFIG_PATH environment variable!' );
process.exit( 1 );
}
const artifactUrl = `https://github.com/woocommerce/woocommerce/releases/download/${ RELEASE_TAG }/${ ARTIFACT_NAME }`;
const testEnvPlugins = {
env: {
tests: {
plugins: [],
},
},
};
const data = fs.readFileSync( `${ WP_ENV_CONFIG_PATH }/.wp-env.json`, 'utf8' );
const wpEnvConfig = JSON.parse( data );
testEnvPlugins.env.tests.plugins = wpEnvConfig.env.tests.plugins;
const currentDirEntry = testEnvPlugins.env.tests.plugins.indexOf( '.' );
if ( currentDirEntry !== -1 ) {
testEnvPlugins.env.tests.plugins[ currentDirEntry ] = artifactUrl;
}
fs.writeFileSync(
`${ WP_ENV_CONFIG_PATH }/.wp-env.override.json`,
JSON.stringify( testEnvPlugins, null, 2 )
);

View File

@ -1,154 +0,0 @@
/**
* Script to generate the test results summary.
*/
const { API_SUMMARY_PATH, E2E_PW_SUMMARY_PATH } = process.env;
/**
* Convert the given `duration` from milliseconds to a more user-friendly string.
* For example, if `duration = 323000`, this function would return `5m 23s`.
*
* @param {Number} duration Duration in millisecods, as read from either the `summary.json` file in the Allure report, or from the `test-results.json` file from the Jest-Puppeteer report.
* @returns String in "5m 23s" format.
*/
const getFormattedDuration = ( duration ) => {
const durationMinutes = Math.floor( duration / 1000 / 60 );
const durationSeconds = Math.floor( ( duration / 1000 ) % 60 );
return `${ durationMinutes }m ${ durationSeconds }s`;
};
/**
* Extract the test report statistics (the number of tests that passed, failed, skipped, etc.) from Allure report's `summary.json` file.
*
* @param {string} summaryJSONPath Path to the Allure report's `summary.json` file.
* @returns An object containing relevant statistics from the Allure report.
*/
const getAllureSummaryStats = ( summaryJSONPath ) => {
const summary = require( summaryJSONPath );
const { statistic, time } = summary;
const { passed, failed, skipped, broken, unknown, total } = statistic;
const { duration } = time;
return {
passed,
failed,
skipped,
broken,
unknown,
total,
duration,
};
};
/**
* Construct the array to be used for the API table row.
*
* @returns Array of API test result stats.
*/
const createAPITableRow = () => {
const { passed, failed, skipped, broken, unknown, total, duration } =
getAllureSummaryStats( API_SUMMARY_PATH );
const durationFormatted = getFormattedDuration( duration );
return [
'API Tests',
passed.toString(),
failed.toString(),
broken.toString(),
skipped.toString(),
unknown.toString(),
total.toString(),
durationFormatted,
];
};
/**
* Construct the array to be used for the E2E table row.
*
* @returns Array of E2E test result stats.
*/
const createE2ETableRow = () => {
const { passed, failed, skipped, broken, unknown, total, duration } =
getAllureSummaryStats( E2E_PW_SUMMARY_PATH );
const durationFormatted = getFormattedDuration( duration );
return [
'E2E Tests',
passed.toString(),
failed.toString(),
broken.toString(),
skipped.toString(),
unknown.toString(),
total.toString(),
durationFormatted,
];
};
/**
* Create the heading and test results table.
*
* @param core The GitHub Actions toolkit core object
*/
const addSummaryHeadingAndTable = ( core ) => {
const apiTableRow = createAPITableRow();
const e2eTableRow = createE2ETableRow();
core.summary.addHeading( 'Smoke tests on nightly build' ).addTable( [
[
{ data: 'Test :test_tube:', header: true },
{ data: 'Passed :white_check_mark:', header: true },
{ data: 'Failed :rotating_light:', header: true },
{ data: 'Broken :construction:', header: true },
{ data: 'Skipped :next_track_button:', header: true },
{ data: 'Unknown :grey_question:', header: true },
{ data: 'Total :bar_chart:', header: true },
{ data: 'Duration :stopwatch:', header: true },
],
apiTableRow,
e2eTableRow,
] );
};
/**
* Add the summary footer.
*
* @param core The GitHub Actions toolkit core object
*/
const addSummaryFooter = ( core ) => {
core.summary
.addSeparator()
.addRaw( 'To view the full API test report, click ' )
.addLink(
'here.',
'https://woocommerce.github.io/woocommerce-test-reports/daily/api'
)
.addBreak()
.addRaw( 'To view the full E2E test report, click ' )
.addLink(
'here.',
'https://woocommerce.github.io/woocommerce-test-reports/daily/e2e'
)
.addBreak()
.addRaw( 'To view all test reports, visit the ' )
.addLink(
'WooCommerce Test Reports Dashboard.',
'https://woocommerce.github.io/woocommerce-test-reports/'
);
};
/**
* Generate the contents of the test results summary and post it on the workflow run.
*
* @param {*} params Objects passed from the calling GitHub Action workflow.
* @returns Stringified content of the test results summary.
*/
module.exports = async ( { core } ) => {
addSummaryHeadingAndTable( core );
addSummaryFooter( core );
const summary = core.summary.stringify();
await core.summary.write();
return summary;
};

View File

@ -1,219 +0,0 @@
/**
* Script to generate the test results summary to be posted as a GitHub Job Summary and as a PR comment.
*/
const {
API_SUMMARY_PATH,
E2E_PW_SUMMARY_PATH,
SHA,
PR_NUMBER,
E2E_GRAND_TOTAL,
} = process.env;
/**
* Convert the given `duration` from milliseconds to a more user-friendly string.
* For example, if `duration = 323000`, this function would return `5m 23s`.
*
* @param {Number} duration Duration in millisecods, as read from either the `summary.json` file in the Allure report, or from the `test-results.json` file from the Jest-Puppeteer report.
* @returns String in "5m 23s" format.
*/
const getFormattedDuration = ( duration ) => {
const durationMinutes = Math.floor( duration / 1000 / 60 );
const durationSeconds = Math.floor( ( duration / 1000 ) % 60 );
return `${ durationMinutes }m ${ durationSeconds }s`;
};
/**
* Extract the test report statistics (the number of tests that passed, failed, skipped, etc.) from Allure report's `summary.json` file.
*
* @param {string} summaryJSONPath Path to the Allure report's `summary.json` file.
* @returns An object containing relevant statistics from the Allure report.
*/
const getAllureSummaryStats = ( summaryJSONPath ) => {
const summary = require( summaryJSONPath );
const { statistic, time } = summary;
const { passed, failed, skipped, broken, unknown, total } = statistic;
const { duration } = time;
return {
passed,
failed,
skipped,
broken,
unknown,
total,
duration,
};
};
/**
* Construct the array to be used for the API table row.
*
* @returns Array of API test result stats.
*/
const createAPITableRow = () => {
const { passed, failed, skipped, broken, unknown, total, duration } =
getAllureSummaryStats( API_SUMMARY_PATH );
const durationFormatted = getFormattedDuration( duration );
return [
'API Tests',
passed.toString(),
failed.toString(),
broken.toString(),
skipped.toString(),
unknown.toString(),
total.toString(),
durationFormatted,
];
};
/**
* Construct the array to be used for the E2E table row.
*
* @returns Array of E2E test result stats.
*/
const createE2ETableRow = () => {
const { passed, failed, skipped, broken, unknown, total, duration } =
getAllureSummaryStats( E2E_PW_SUMMARY_PATH );
const durationFormatted = getFormattedDuration( duration );
return [
'E2E Tests',
passed.toString(),
failed.toString(),
broken.toString(),
skipped.toString(),
unknown.toString(),
total.toString(),
durationFormatted,
];
};
/**
* Add a warning when the number of executed Playwright E2E tests were fewer than the total.
*/
const addWarningE2EIncomplete = ( warnings ) => {
const { statistic } = require( E2E_PW_SUMMARY_PATH );
const { total } = statistic;
const expectedTotal = Number( E2E_GRAND_TOTAL );
if ( total < expectedTotal ) {
warnings.push(
`INCOMPLETE E2E TEST RUN. We have a total of ${ expectedTotal } E2E tests, but only ${ total } were executed. Note that in CI, E2E tests automatically end when they encounter too many failures.`
);
}
};
/**
*
* Add a warning when there are failures and broken tests.
*/
const addWarningFailuresBrokenTests = ( warnings ) => {
const { failed: apiFailed, broken: apiBroken } =
getAllureSummaryStats( API_SUMMARY_PATH );
const { failed: e2eFailed, broken: e2eBroken } =
getAllureSummaryStats( E2E_PW_SUMMARY_PATH );
if ( apiFailed || apiBroken || e2eFailed || e2eBroken ) {
warnings.push(
'FAILED/BROKEN TESTS. There were failed and/or broken API and E2E tests.'
);
}
};
/**
* Add warnings to the test summary.
*
* @param core The GitHub Actions toolkit core object
*/
const addSummaryWarnings = ( core ) => {
const warnings = [];
addWarningFailuresBrokenTests( warnings );
addWarningE2EIncomplete( warnings );
if ( warnings.length > 0 ) {
core.summary
.addHeading( ':warning: Warning', 3 )
.addRaw(
'Please address the following issues prior to merging this pull request:'
)
.addList( warnings );
}
};
/**
* Create the heading, commit SHA, and test results table.
*
* @param core The GitHub Actions toolkit core object
*/
const addSummaryHeadingAndTable = ( core ) => {
const apiTableRow = createAPITableRow();
const e2eTableRow = createE2ETableRow();
core.summary
.addHeading( 'Test Results Summary' )
.addRaw( `Commit SHA: ${ SHA }` )
.addBreak()
.addBreak()
.addTable( [
[
{ data: 'Test :test_tube:', header: true },
{ data: 'Passed :white_check_mark:', header: true },
{ data: 'Failed :rotating_light:', header: true },
{ data: 'Broken :construction:', header: true },
{ data: 'Skipped :next_track_button:', header: true },
{ data: 'Unknown :grey_question:', header: true },
{ data: 'Total :bar_chart:', header: true },
{ data: 'Duration :stopwatch:', header: true },
],
apiTableRow,
e2eTableRow,
] );
};
/**
* Add the summary footer.
*
* @param core The GitHub Actions toolkit core object
*/
const addSummaryFooter = ( core ) => {
core.summary
.addSeparator()
.addRaw( 'To view the full API test report, click ' )
.addLink(
'here.',
`https://woocommerce.github.io/woocommerce-test-reports/pr/${ PR_NUMBER }/api/`
)
.addBreak()
.addRaw( 'To view the full E2E test report, click ' )
.addLink(
'here.',
`https://woocommerce.github.io/woocommerce-test-reports/pr/${ PR_NUMBER }/e2e/`
)
.addBreak()
.addRaw( 'To view all test reports, visit the ' )
.addLink(
'WooCommerce Test Reports Dashboard.',
'https://woocommerce.github.io/woocommerce-test-reports/'
);
};
/**
* Generate the contents of the test results summary and post it on the workflow run.
*
* @param {*} params Objects passed from the calling GitHub Action workflow.
* @returns Stringified content of the test results summary.
*/
module.exports = async ( { core } ) => {
addSummaryHeadingAndTable( core );
addSummaryWarnings( core );
addSummaryFooter( core );
const summary = core.summary.stringify();
await core.summary.write();
return summary;
};

View File

@ -1,51 +0,0 @@
module.exports = async ( { github, context, core } ) => {
const { RELEASE_VERSION, GITHUB_EVENT_NAME } = process.env;
async function findRelease() {
const { owner, repo } = context.repo;
const list = await github.rest.repos.listReleases( {
owner,
repo,
per_page: 100,
} );
const match = list.data.find( ( { tag_name, name } ) =>
[ tag_name, name ].includes( RELEASE_VERSION )
);
return match;
}
async function handleWorkflowDispatch() {
const match = await findRelease();
if ( match ) {
return match;
}
throw new Error(
`"${ RELEASE_VERSION }" is not a valid release version!`
);
}
function findWooCommerceZipAsset() {
const match = release.assets.find(
( { name } ) => name === 'woocommerce.zip'
);
if ( ! match ) {
throw new Error(
`Release ${ RELEASE_VERSION } does not contain a woocommerce.zip asset!`
);
}
return match;
}
const release =
GITHUB_EVENT_NAME === 'release'
? await findRelease()
: await handleWorkflowDispatch();
const asset = findWooCommerceZipAsset();
core.setOutput( 'version', RELEASE_VERSION );
core.setOutput( 'created', release.created_at );
core.setOutput( 'asset-id', asset.id );
};

View File

@ -1,473 +0,0 @@
name: Smoke test daily
on:
schedule:
- cron: '25 3 * * *'
workflow_dispatch:
env:
API_ARTIFACT: api-daily--run-${{ github.run_number }}
E2E_ARTIFACT: e2e-daily--run-${{ github.run_number }}
FORCE_COLOR: 1
PLUGIN_SLACK_BLOCKS_ARTIFACT: plugin-blocks
concurrency:
group: '${{ github.workflow }}-${{ github.ref }}'
cancel-in-progress: true
permissions: {}
jobs:
api-tests:
name: API tests on nightly build
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
test-result: ${{ steps.run-api-composite-action.outputs.result }}
env:
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
- name: Setup WooCommerce Monorepo
uses: ./.github/actions/setup-woocommerce-monorepo
with:
install: '@woocommerce/plugin-woocommerce...'
build: '@woocommerce/plugin-woocommerce'
- name: Load docker images and start containers.
working-directory: plugins/woocommerce
env:
ENABLE_HPOS: 1
run: pnpm --filter=@woocommerce/plugin-woocommerce env:test
- name: Run API tests
id: run-api-composite-action
uses: ./.github/actions/tests/run-api-tests
with:
report-name: ${{ env.API_ARTIFACT }}
env:
BASE_URL: http://localhost:8086
USER_KEY: admin
USER_SECRET: password
GITHUB_TOKEN: ${{ secrets.E2E_GH_TOKEN }}
- name: Generate Playwright API Test report.
id: generate_api_report
if: |
always() &&
(
steps.run-api-composite-action.conclusion != 'cancelled' ||
steps.run-api-composite-action.conclusion != 'skipped'
)
working-directory: plugins/woocommerce
run: pnpm exec allure generate --clean ${{ env.ALLURE_RESULTS_DIR }} --output ${{ env.ALLURE_REPORT_DIR }}
- name: Archive Playwright API test report
if: |
always() &&
steps.generate_api_report.conclusion == 'success'
uses: actions/upload-artifact@v3
with:
name: ${{ env.API_ARTIFACT }}
path: |
${{ env.ALLURE_RESULTS_DIR }}
${{ env.ALLURE_REPORT_DIR }}
if-no-files-found: ignore
retention-days: 20
e2e-tests:
name: E2E tests on nightly build
runs-on: ubuntu-latest
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
shard:
[
{ number: 1, name: 1/5 },
{ number: 2, name: 2/5 },
{ number: 3, name: 3/5 },
{ number: 4, name: 4/5 },
{ number: 5, name: 5/5 },
]
permissions:
contents: read
outputs:
test-result: ${{ steps.run_playwright_e2e_tests.outputs.result }}
env:
ALLURE_REPORT_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/test-results/allure-report
ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/test-results/allure-results
steps:
- uses: actions/checkout@v3
- name: Setup WooCommerce Monorepo
uses: ./.github/actions/setup-woocommerce-monorepo
with:
install: '@woocommerce/plugin-woocommerce...'
build: '@woocommerce/plugin-woocommerce'
- name: Load docker images and start containers.
working-directory: plugins/woocommerce
env:
WP_ENV_PHP_VERSION: 7.4
ENABLE_HPOS: 1
run: pnpm env:test
- name: Download and install Chromium browser.
working-directory: plugins/woocommerce
run: pnpm exec playwright install chromium
- name: Run E2E tests
timeout-minutes: 90
id: run_playwright_e2e_tests
env:
USE_WP_ENV: 1
E2E_MAX_FAILURES: 90
FORCE_COLOR: 1
ALLURE_REPORT_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/test-results/allure-report
ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/test-results/allure-results
working-directory: plugins/woocommerce
run: pnpm exec playwright test --config=tests/e2e-pw/playwright.config.js --shard ${{ matrix.shard.name }}
- name: Upload reports to GitHub Actions Artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: all-blob-reports-${{ matrix.shard.number }}
path: ${{ env.ALLURE_RESULTS_DIR }}
retention-days: 1
compression-level: 9
merge-reports:
name: Merge e2e test reports
if: always()
needs: e2e-tests
runs-on: ubuntu-latest
env:
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
steps:
- uses: actions/checkout@v3
- name: Setup WooCommerce Monorepo
uses: ./.github/actions/setup-woocommerce-monorepo
with:
install: '@woocommerce/plugin-woocommerce...'
build: '@woocommerce/plugin-woocommerce'
- name: Download blob reports from GitHub Actions Artifacts
uses: actions/download-artifact@v4
with:
path: ${{ env.ALLURE_RESULTS_DIR }}
pattern: all-blob-reports-*
run-id: e2e-tests-run
merge-multiple: true
- name: Generate Test report.
id: generate_e2e_report
working-directory: plugins/woocommerce
run: pnpm exec allure generate --clean ${{ env.ALLURE_RESULTS_DIR }} --output ${{ env.ALLURE_REPORT_DIR }}
- name: Archive Playwright E2E test report
if: |
always() &&
steps.generate_e2e_report.conclusion == 'success'
uses: actions/upload-artifact@v4
with:
name: ${{ env.E2E_ARTIFACT }}
path: |
${{ env.ALLURE_RESULTS_DIR }}
${{ env.ALLURE_REPORT_DIR }}
if-no-files-found: ignore
retention-days: 5
k6-tests:
name: k6 tests on nightly build
runs-on: ubuntu-20.04
permissions:
contents: read
needs: [api-tests]
if: success() || failure()
outputs:
test-result: ${{ steps.run-k6-tests.conclusion }}
steps:
- uses: actions/checkout@v3
- name: Setup WooCommerce Monorepo
uses: ./.github/actions/setup-woocommerce-monorepo
with:
install: '@woocommerce/plugin-woocommerce...'
- name: Update performance test site with E2E test
id: update-perf-site
continue-on-error: true
uses: ./.github/actions/tests/run-e2e-tests
with:
report-name: k6-daily-update-site--run-${{ github.run_number }}
tests: update-woocommerce.spec.js
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
BASE_URL: ${{ secrets.SMOKE_TEST_PERF_URL }}/
ADMIN_USER: ${{ secrets.SMOKE_TEST_PERF_ADMIN_USER }}
ADMIN_PASSWORD: ${{ secrets.SMOKE_TEST_PERF_ADMIN_PASSWORD }}
CUSTOMER_USER: ${{ secrets.SMOKE_TEST_PERF_ADMIN_USER }}
CUSTOMER_PASSWORD: ${{ secrets.SMOKE_TEST_PERF_ADMIN_PASSWORD }}
DEFAULT_TIMEOUT_OVERRIDE: 120000
GITHUB_TOKEN: ${{ secrets.E2E_GH_TOKEN }}
UPDATE_WC: nightly
- name: Install k6
run: |
curl https://github.com/grafana/k6/releases/download/v0.33.0/k6-v0.33.0-linux-amd64.tar.gz -L | tar xvz --strip-components 1
- name: Run k6 smoke tests
id: run-k6-tests
env:
URL: ${{ secrets.SMOKE_TEST_PERF_URL }}
HOST: ${{ secrets.SMOKE_TEST_PERF_HOST }}
A_USER: ${{ secrets.SMOKE_TEST_PERF_ADMIN_USER }}
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: 22733
run: |
./k6 run plugins/woocommerce/tests/performance/tests/gh-action-daily-ext-requests.js
test-plugins:
name: E2E tests with ${{ matrix.plugin }} plugin installed
runs-on: ubuntu-latest
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
PLUGIN_REPOSITORY: ${{ matrix.private && secrets[matrix.repo] || matrix.repo }}
PLUGIN_NAME: ${{ matrix.plugin }}
PLUGIN_SLUG: ${{ matrix.slug }}
GITHUB_TOKEN: ${{ secrets.E2E_GH_TOKEN }}
strategy:
fail-fast: false
matrix:
include:
- plugin: 'WooPayments'
repo: 'automattic/woocommerce-payments'
slug: woocommerce-payments
- plugin: 'WooCommerce PayPal Payments'
repo: 'woocommerce/woocommerce-paypal-payments'
slug: woocommerce-paypal-payments
- plugin: 'WooCommerce Shipping & Tax'
repo: 'automattic/woocommerce-services'
slug: woocommerce-services
- plugin: 'Gutenberg'
repo: 'WordPress/gutenberg'
slug: gutenberg
- plugin: 'Gutenberg - Nightly'
repo: 'bph/gutenberg'
slug: gutenberg
steps:
- uses: actions/checkout@v3
- name: Setup WooCommerce Monorepo
uses: ./.github/actions/setup-woocommerce-monorepo
with:
install: '@woocommerce/plugin-woocommerce...'
build: '@woocommerce/plugin-woocommerce'
- name: Setup local test environment
uses: ./.github/actions/tests/setup-local-test-environment
with:
test-type: e2e
- name: Setup plugin for the main e2e suite
working-directory: ./plugins/woocommerce
run: ./tests/e2e-pw/bin/install-plugin.sh
- name: Run 'Upload plugin' test
id: run-upload-plugin-test
if: ${{ failure() }} # only if the plugin setup failed to check if the plugin really cannot be installed
uses: ./.github/actions/tests/run-e2e-tests
with:
report-name: Smoke tests on trunk with ${{ matrix.plugin }} plugin installed (run ${{ github.run_number }})
tests: upload-plugin.spec.js
- name: Run the rest of E2E tests
id: run-e2e-composite-action
timeout-minutes: 90
uses: ./.github/actions/tests/run-e2e-tests
with:
playwright-config: ignore-plugin-tests.playwright.config.js
report-name: Smoke tests on trunk with ${{ matrix.plugin }} plugin installed (run ${{ github.run_number }})
env:
E2E_MAX_FAILURES: 90
- name: Create context block and save as JSON file
if: success() || failure()
id: create-block-json
uses: actions/github-script@v6
with:
script: |
const script = require( './.github/actions/tests/slack-summary-daily/scripts/create-blocks-plugin-tests.js' )
script( { core } );
env:
UPLOAD_RESULT: ${{ steps.run-upload-plugin-test.outputs.result }}
E2E_RESULT: ${{ steps.run-e2e-composite-action.outputs.result }}
PLUGIN_NAME: ${{ matrix.plugin }}
PLUGIN_SLUG: ${{ matrix.slug }}
- name: Upload JSON file as artifact
if: success() || failure()
uses: actions/upload-artifact@v3
with:
name: ${{ env.PLUGIN_SLACK_BLOCKS_ARTIFACT }}
path: ${{ steps.create-block-json.outputs.path }}
trunk-results:
name: Publish report on smoke tests on nightly build
if: |
( success() || failure() ) &&
! github.event.pull_request.head.repo.fork
runs-on: ubuntu-20.04
permissions:
contents: read
needs: [e2e-tests, test-plugins, k6-tests]
steps:
- name: Create dirs
run: |
mkdir -p repo
mkdir -p artifacts/api
mkdir -p artifacts/e2e
mkdir -p output
- name: Checkout code
uses: actions/checkout@v3
with:
path: repo
- name: Download API test report artifact
uses: actions/download-artifact@v3
with:
name: ${{ env.API_ARTIFACT }}
path: artifacts/api
- name: Download E2E test report artifact
uses: actions/download-artifact@v4
with:
name: ${{ env.E2E_ARTIFACT }}
path: artifacts/e2e
- name: Post test summary
uses: actions/github-script@v6
env:
API_SUMMARY_PATH: ${{ github.workspace }}/artifacts/api/allure-report/widgets/summary.json
E2E_PW_SUMMARY_PATH: ${{ github.workspace }}/artifacts/e2e/allure-report/widgets/summary.json
with:
result-encoding: string
script: |
const script = require( './repo/.github/workflows/scripts/prepare-test-summary-daily.js' )
return await script( { core } )
- name: Publish report
env:
GITHUB_TOKEN: ${{ secrets.REPORTS_TOKEN }}
RUN_ID: ${{ github.run_id }}
run: |
gh workflow run publish-test-reports-daily.yml \
-f run_id=$RUN_ID \
-f api_artifact="$API_ARTIFACT" \
-f e2e_artifact="$E2E_ARTIFACT" \
-f s3_root=public \
--repo woocommerce/woocommerce-test-reports
plugins-results:
name: Publish report on Smoke tests on trunk with plugins
if: |
( success() || failure() ) &&
( needs.test-plugins.result != 'skipped' ) &&
! github.event.pull_request.head.repo.fork
runs-on: ubuntu-20.04
needs: [e2e-tests, test-plugins, k6-tests]
env:
GITHUB_TOKEN: ${{ secrets.REPORTS_TOKEN }}
RUN_ID: ${{ github.run_id }}
ARTIFACT: Smoke tests on trunk with ${{ matrix.plugin }} plugin installed (run ${{ github.run_number }})
strategy:
fail-fast: false
matrix:
include:
- plugin: 'WooPayments'
slug: woocommerce-payments
- plugin: 'WooCommerce PayPal Payments'
slug: woocommerce-paypal-payments
- plugin: 'WooCommerce Shipping & Tax'
slug: woocommerce-services
- plugin: 'Gutenberg'
slug: gutenberg
- plugin: 'Gutenberg - Nightly'
slug: gutenberg-nightly
steps:
- name: Download test report artifact
uses: actions/download-artifact@v3
with:
name: ${{ env.ARTIFACT }}
- name: Publish reports
run: |
gh workflow run publish-test-reports-daily-plugins.yml \
-f run_id=$RUN_ID \
-f artifact="${{ env.ARTIFACT }}" \
-f plugin="${{ matrix.plugin }}" \
-f slug="${{ matrix.slug }}" \
-f s3_root=public \
--repo woocommerce/woocommerce-test-reports
post-slack-summary:
name: Post Slack summary
runs-on: ubuntu-20.04
permissions:
contents: read
if: |
github.ref_name == 'trunk' &&
success() || (
failure() && contains( needs.*.result, 'failure' )
)
needs:
- api-tests
- e2e-tests
- k6-tests
- test-plugins
steps:
- uses: actions/checkout@v3
- name: Download Slack blocks from plugin tests
if: needs.test-plugins.result != 'skipped'
id: download-plugin-blocks
uses: actions/download-artifact@v3
with:
name: ${{ env.PLUGIN_SLACK_BLOCKS_ARTIFACT }}
path: /tmp/plugin-blocks
- name: Construct Slack payload
id: construct-slack-payload
uses: actions/github-script@v6
with:
script: |
const script = require('./.github/actions/tests/slack-summary-daily/scripts/construct-slack-payload.js');
await script( { context, core, github } );
env:
API_RESULT: ${{ needs.api-tests.outputs.test-result }}
E2E_RESULT: ${{ needs.e2e-tests.outputs.test-result || needs.e2e-tests.result }}
k6_RESULT: ${{ needs.k6-tests.outputs.test-result || needs.k6-tests.result }}
PLUGINS_BLOCKS_PATH: ${{ steps.download-plugin-blocks.outputs.download-path }}
PLUGIN_TESTS_RESULT: ${{ needs.test-plugins.result }}
- name: Send Slack message
id: send-slack-message
uses: slackapi/slack-github-action@v1.23.0
with:
channel-id: ${{ secrets.DAILY_TEST_SLACK_CHANNEL }}
payload: ${{ steps.construct-slack-payload.outputs.payload }}
env:
SLACK_BOT_TOKEN: ${{ secrets.E2E_SLACK_TOKEN }}

View File

@ -1,751 +0,0 @@
name: Smoke test release
on:
release:
types: [released, prereleased, published]
workflow_dispatch:
inputs:
tag:
description: 'WooCommerce release version'
required: true
concurrency:
group: ${{ github.workflow }}-${{ github.event.release.tag_name || inputs.tag }}
cancel-in-progress: true
permissions: {}
env:
E2E_WP_LATEST_ARTIFACT: E2E test on release smoke test site with WP Latest (run ${{ github.run_number }})
E2E_UPDATE_WC_ARTIFACT: WooCommerce version update test on release smoke test site (run ${{ github.run_number }})
SLACK_BLOCKS_ARTIFACT: slack-blocks
jobs:
validate-version:
name: Validate release version
permissions:
contents: read
runs-on: ubuntu-20.04
outputs:
version: ${{ steps.validate-version.outputs.version }}
created: ${{ steps.validate-version.outputs.created }}
asset-id: ${{ steps.validate-version.outputs.asset-id }}
steps:
- uses: actions/checkout@v3
- name: Validate release version
id: validate-version
uses: actions/github-script@v6
env:
RELEASE_VERSION: ${{ inputs.tag }}
with:
github-token: ${{ secrets.E2E_GH_TOKEN }}
script: |
const script = require('./.github/workflows/scripts/validate-release-version.js');
await script({ github, context, core });
e2e-update-wc:
name: Test WooCommerce update
runs-on: ubuntu-20.04
needs: [validate-version]
permissions:
contents: read
env:
ALLURE_REPORT_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/test-results/allure-report
ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/test-results/allure-results
steps:
- uses: actions/checkout@v3
- name: Setup WooCommerce Monorepo
uses: ./.github/actions/setup-woocommerce-monorepo
with:
install: '@woocommerce/plugin-woocommerce...'
- name: Run E2E tests
id: run-e2e-composite-action
timeout-minutes: 90
uses: ./.github/actions/tests/run-e2e-tests
with:
report-name: ${{ env.E2E_UPDATE_WC_ARTIFACT }}
tests: update-woocommerce.spec.js
env:
ADMIN_PASSWORD: ${{ secrets.RELEASE_TEST_ADMIN_PASSWORD }}
ADMIN_USER: ${{ secrets.RELEASE_TEST_ADMIN_USER }}
BASE_URL: ${{ secrets.RELEASE_TEST_URL }}
CUSTOMER_PASSWORD: ${{ secrets.RELEASE_TEST_CUSTOMER_PASSWORD }}
CUSTOMER_USER: ${{ secrets.RELEASE_TEST_CUSTOMER_USER }}
DEFAULT_TIMEOUT_OVERRIDE: 120000
GITHUB_TOKEN: ${{ secrets.E2E_GH_TOKEN }}
UPDATE_WC: ${{ needs.validate-version.outputs.version }}
- name: Upload Allure artifacts to bucket
if: success() || ( failure() && steps.run-e2e-composite-action.conclusion == 'failure' )
uses: ./.github/actions/tests/upload-allure-files-to-bucket
with:
aws-access-key-id: ${{ secrets.REPORTS_AWS_ACCESS_KEY_ID }}
aws-region: ${{ secrets.REPORTS_AWS_REGION }}
aws-secret-access-key: ${{ secrets.REPORTS_AWS_SECRET_ACCESS_KEY }}
artifact-name: ${{ env.E2E_WP_LATEST_ARTIFACT }}
s3-bucket: ${{ secrets.REPORTS_BUCKET }}
- name: Publish E2E Allure report
if: success() || ( failure() && steps.run-e2e-composite-action.conclusion == 'failure' )
env:
GITHUB_TOKEN: ${{ secrets.REPORTS_TOKEN }}
ENV_DESCRIPTION: wp-latest
run: |
gh workflow run publish-test-reports-release.yml \
-f created_at="${{ needs.validate-version.outputs.created }}" \
-f run_id=${{ github.run_id }} \
-f run_number=${{ github.run_number }} \
-f release_tag=${{ needs.validate-version.outputs.version }} \
-f artifact="${{ env.E2E_WP_LATEST_ARTIFACT }}" \
-f env_description="${{ env.ENV_DESCRIPTION }}" \
-f test_type="e2e" \
--repo woocommerce/woocommerce-test-reports
- name: Create Slack block
if: |
success() || (
failure() && steps.run-e2e-composite-action.outputs.result == 'failure'
)
uses: ./.github/actions/tests/slack-summary-on-release/slack-blocks
with:
test-name: WC Update test
e2e-result: ${{ steps.run-e2e-composite-action.outputs.result }}
env-slug: wp-latest
release-version: ${{ needs.validate-version.outputs.version }}
api-wp-latest:
name: API on WP Latest
runs-on: ubuntu-20.04
needs: [validate-version, e2e-update-wc]
permissions:
contents: read
outputs:
result: ${{ steps.run-api-composite-action.outputs.result }}
env:
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/api-test-report/allure-results
API_WP_LATEST_ARTIFACT: API test on release smoke test site with WP Latest (run ${{ github.run_number }})
steps:
- uses: actions/checkout@v3
- name: Setup WooCommerce Monorepo
uses: ./.github/actions/setup-woocommerce-monorepo
with:
install: '@woocommerce/plugin-woocommerce...'
- name: Download and install Chromium browser.
working-directory: plugins/woocommerce
run: pnpm exec playwright install chromium
- name: Run API tests
id: run-api-composite-action
uses: ./.github/actions/tests/run-api-tests
with:
report-name: ${{ env.API_WP_LATEST_ARTIFACT }}
tests: hello
playwright-config: ci-release.playwright.config.js
env:
API_BASE_URL: ${{ secrets.RELEASE_TEST_URL }}
USER_KEY: ${{ secrets.RELEASE_TEST_ADMIN_USER }}
USER_SECRET: ${{ secrets.RELEASE_TEST_ADMIN_PASSWORD }}
UPDATE_WC: ${{ needs.validate-version.outputs.version }}
GITHUB_TOKEN: ${{ secrets.E2E_GH_TOKEN }}
- name: Upload Allure artifacts to bucket
if: success() || ( failure() && steps.run-api-composite-action.conclusion == 'failure' )
uses: ./.github/actions/tests/upload-allure-files-to-bucket
with:
aws-access-key-id: ${{ secrets.REPORTS_AWS_ACCESS_KEY_ID }}
aws-region: ${{ secrets.REPORTS_AWS_REGION }}
aws-secret-access-key: ${{ secrets.REPORTS_AWS_SECRET_ACCESS_KEY }}
artifact-name: ${{ env.API_WP_LATEST_ARTIFACT }}
s3-bucket: ${{ secrets.REPORTS_BUCKET }}
- name: Publish API Allure report
if: success() || ( failure() && steps.run-api-composite-action.conclusion == 'failure' )
env:
GITHUB_TOKEN: ${{ secrets.REPORTS_TOKEN }}
ENV_DESCRIPTION: wp-latest
run: |
gh workflow run publish-test-reports-release.yml \
-f created_at="${{ needs.validate-version.outputs.created }}" \
-f run_id=${{ github.run_id }} \
-f run_number=${{ github.run_number }} \
-f release_tag=${{ needs.validate-version.outputs.version }} \
-f artifact="${{ env.API_WP_LATEST_ARTIFACT }}" \
-f env_description="${{ env.ENV_DESCRIPTION }}" \
-f test_type="api" \
--repo woocommerce/woocommerce-test-reports
- name: Create Slack block
if: |
success() || (
failure() && steps.run-api-composite-action.outputs.result == 'failure'
)
uses: ./.github/actions/tests/slack-summary-on-release/slack-blocks
with:
test-name: WP Latest
api-result: ${{ steps.run-api-composite-action.outputs.result }}
env-slug: wp-latest
release-version: ${{ needs.validate-version.outputs.version }}
e2e-wp-latest:
name: E2E on WP Latest
runs-on: ubuntu-20.04
needs: [validate-version, api-wp-latest]
permissions:
contents: read
env:
ALLURE_REPORT_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/test-results/allure-report
ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/test-results/allure-results
steps:
- uses: actions/checkout@v3
- name: Setup WooCommerce Monorepo
uses: ./.github/actions/setup-woocommerce-monorepo
with:
install: '@woocommerce/plugin-woocommerce...'
- name: Run E2E tests
id: run-e2e-composite-action
timeout-minutes: 90
uses: ./.github/actions/tests/run-e2e-tests
with:
report-name: e2e-wp-latest--partial--run-${{ github.run_number }}
playwright-config: ignore-plugin-tests.playwright.config.js
env:
ADMIN_PASSWORD: ${{ secrets.RELEASE_TEST_ADMIN_PASSWORD }}
ADMIN_USER: ${{ secrets.RELEASE_TEST_ADMIN_USER }}
ADMIN_USER_EMAIL: ${{ secrets.RELEASE_TEST_ADMIN_USER_EMAIL }}
BASE_URL: ${{ secrets.RELEASE_TEST_URL }}
CUSTOMER_PASSWORD: ${{ secrets.RELEASE_TEST_CUSTOMER_PASSWORD }}
CUSTOMER_USER: ${{ secrets.RELEASE_TEST_CUSTOMER_USER }}
DEFAULT_TIMEOUT_OVERRIDE: 120000
E2E_MAX_FAILURES: 90
RESET_SITE: true
- name: Download 'e2e-update-wc' artifact
if: success() || failure()
uses: actions/download-artifact@v3
with:
name: ${{ env.E2E_UPDATE_WC_ARTIFACT }}
path: plugins/woocommerce/tmp
- name: Add allure-results from 'e2e-update-wc'
if: success() || failure()
working-directory: plugins/woocommerce
run: cp -r tmp/allure-results tests/e2e-pw/test-results
- name: Generate E2E Test report.
if: success() || failure()
working-directory: plugins/woocommerce
run: pnpm exec allure generate --clean ${{ env.ALLURE_RESULTS_DIR }} --output ${{ env.ALLURE_REPORT_DIR }}
- name: Archive E2E test report
if: success() || failure()
uses: actions/upload-artifact@v3
with:
name: ${{ env.E2E_WP_LATEST_ARTIFACT }}
path: |
${{ env.ALLURE_RESULTS_DIR }}
${{ env.ALLURE_REPORT_DIR }}
if-no-files-found: ignore
retention-days: 5
- name: Upload Allure artifacts to bucket
if: success() || ( failure() && steps.run-e2e-composite-action.conclusion == 'failure' )
uses: ./.github/actions/tests/upload-allure-files-to-bucket
with:
aws-access-key-id: ${{ secrets.REPORTS_AWS_ACCESS_KEY_ID }}
aws-region: ${{ secrets.REPORTS_AWS_REGION }}
aws-secret-access-key: ${{ secrets.REPORTS_AWS_SECRET_ACCESS_KEY }}
artifact-name: ${{ env.E2E_WP_LATEST_ARTIFACT }}
s3-bucket: ${{ secrets.REPORTS_BUCKET }}
- name: Publish E2E Allure report
if: success() || failure()
env:
GITHUB_TOKEN: ${{ secrets.REPORTS_TOKEN }}
ENV_DESCRIPTION: wp-latest
run: |
gh workflow run publish-test-reports-release.yml \
-f created_at="${{ needs.validate-version.outputs.created }}" \
-f run_id=${{ github.run_id }} \
-f run_number=${{ github.run_number }} \
-f release_tag=${{ needs.validate-version.outputs.version }} \
-f artifact="${{ env.E2E_WP_LATEST_ARTIFACT }}" \
-f env_description="${{ env.ENV_DESCRIPTION }}" \
-f test_type="e2e" \
--repo woocommerce/woocommerce-test-reports
- name: Create Slack block
if: |
success() || (
failure() && steps.run-e2e-composite-action.outputs.result == 'failure'
)
uses: ./.github/actions/tests/slack-summary-on-release/slack-blocks
with:
test-name: WP Latest
api-result: ${{ needs.api-wp-latest.outputs.result }}
e2e-result: ${{ steps.run-e2e-composite-action.outputs.result }}
env-slug: wp-latest
release-version: ${{ needs.validate-version.outputs.version }}
test-wp-latest-1:
name: Test against WP Latest-1
runs-on: ubuntu-20.04
needs: [validate-version]
env:
API_ALLURE_REPORT_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/test-results/api/allure-report
API_ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/test-results/api/allure-results
API_WP_LATEST_X_ARTIFACT: API test on wp-env with WordPress L-1 (run ${{ github.run_number }})
E2E_ALLURE_REPORT_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/test-results/e2e/allure-report
E2E_ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/test-results/e2e/allure-results
E2E_WP_LATEST_X_ARTIFACT: E2E test on wp-env with WordPress L-1 (run ${{ github.run_number }})
permissions:
contents: read
steps:
- name: Checkout WooCommerce repo
uses: actions/checkout@v3
- name: Get WP Latest-1 version number
id: get-wp-latest-1
uses: actions/github-script@v6
with:
script: |
const { getVersionWPLatestMinusOne } = require( './plugins/woocommerce/tests/e2e-pw/utils/wordpress' );
await getVersionWPLatestMinusOne( { core, github } );
- name: Setup WooCommerce Monorepo
uses: ./.github/actions/setup-woocommerce-monorepo
with:
install: '@woocommerce/plugin-woocommerce...'
build: '@woocommerce/plugin-woocommerce'
- name: Launch WP Env
working-directory: plugins/woocommerce
run: pnpm env:test
env:
WP_ENV_CORE: WordPress/WordPress#${{ steps.get-wp-latest-1.outputs.version }}
- name: Download release zip
id: download-zip
uses: actions/github-script@v6
env:
ASSET_ID: ${{ needs.validate-version.outputs.asset-id }}
with:
github-token: ${{ secrets.E2E_GH_TOKEN }}
script: |
const script = require('./.github/workflows/scripts/download-release-zip.js');
await script({ github, context, core });
- name: Replace `plugins/woocommerce` with unzipped woocommerce release build
run: unzip -d plugins -o ${{ env.ZIP_PATH }}
env:
ZIP_PATH: ${{ steps.download-zip.outputs.zip-path }}
- name: Run API tests
id: run-api-composite-action
uses: ./.github/actions/tests/run-api-tests
with:
report-name: ${{ env.API_WP_LATEST_X_ARTIFACT }}
tests: hello.test.js
env:
ALLURE_RESULTS_DIR: ${{ env.API_ALLURE_RESULTS_DIR }}
ALLURE_REPORT_DIR: ${{ env.API_ALLURE_REPORT_DIR }}
- name: Upload Allure artifacts to bucket
if: success() || ( failure() && steps.run-api-composite-action.conclusion == 'failure' )
uses: ./.github/actions/tests/upload-allure-files-to-bucket
env:
ALLURE_RESULTS_DIR: ${{ env.API_ALLURE_RESULTS_DIR }}
ALLURE_REPORT_DIR: ${{ env.API_ALLURE_REPORT_DIR }}
with:
aws-access-key-id: ${{ secrets.REPORTS_AWS_ACCESS_KEY_ID }}
aws-region: ${{ secrets.REPORTS_AWS_REGION }}
aws-secret-access-key: ${{ secrets.REPORTS_AWS_SECRET_ACCESS_KEY }}
artifact-name: ${{ env.API_WP_LATEST_X_ARTIFACT }}
s3-bucket: ${{ secrets.REPORTS_BUCKET }}
- name: Publish API Allure report
if: success() || ( failure() && steps.run-api-composite-action.conclusion == 'failure' )
env:
GITHUB_TOKEN: ${{ secrets.REPORTS_TOKEN }}
ENV_DESCRIPTION: wp-latest-1
run: |
gh workflow run publish-test-reports-release.yml \
-f created_at="${{ needs.validate-version.outputs.created }}" \
-f run_id=${{ github.run_id }} \
-f run_number=${{ github.run_number }} \
-f release_tag=${{ needs.validate-version.outputs.version }} \
-f artifact="${{ env.API_WP_LATEST_X_ARTIFACT }}" \
-f env_description="${{ env.ENV_DESCRIPTION }}" \
-f test_type="api" \
--repo woocommerce/woocommerce-test-reports
- name: Run E2E tests
id: run-e2e-composite-action
timeout-minutes: 90
uses: ./.github/actions/tests/run-e2e-tests
env:
E2E_MAX_FAILURES: 90
ALLURE_RESULTS_DIR: ${{ env.E2E_ALLURE_RESULTS_DIR }}
ALLURE_REPORT_DIR: ${{ env.E2E_ALLURE_REPORT_DIR }}
DEFAULT_TIMEOUT_OVERRIDE: 120000
with:
report-name: ${{ env.E2E_WP_LATEST_X_ARTIFACT }}
- name: Upload Allure artifacts to bucket
if: success() || ( failure() && steps.run-e2e-composite-action.conclusion == 'failure' )
uses: ./.github/actions/tests/upload-allure-files-to-bucket
env:
ALLURE_RESULTS_DIR: ${{ env.E2E_ALLURE_RESULTS_DIR }}
ALLURE_REPORT_DIR: ${{ env.E2E_ALLURE_REPORT_DIR }}
with:
aws-access-key-id: ${{ secrets.REPORTS_AWS_ACCESS_KEY_ID }}
aws-region: ${{ secrets.REPORTS_AWS_REGION }}
aws-secret-access-key: ${{ secrets.REPORTS_AWS_SECRET_ACCESS_KEY }}
artifact-name: ${{ env.E2E_WP_LATEST_X_ARTIFACT }}
s3-bucket: ${{ secrets.REPORTS_BUCKET }}
- name: Publish E2E Allure report
if: success() || ( failure() && steps.run-e2e-composite-action.conclusion == 'failure' )
env:
GITHUB_TOKEN: ${{ secrets.REPORTS_TOKEN }}
ENV_DESCRIPTION: wp-latest-1
run: |
gh workflow run publish-test-reports-release.yml \
-f created_at="${{ needs.validate-version.outputs.created }}" \
-f run_id=${{ github.run_id }} \
-f run_number=${{ github.run_number }} \
-f release_tag=${{ needs.validate-version.outputs.version }} \
-f artifact="${{ env.E2E_WP_LATEST_X_ARTIFACT }}" \
-f env_description="${{ env.ENV_DESCRIPTION }}" \
-f test_type="e2e" \
--repo woocommerce/woocommerce-test-reports
- name: Create Slack block
if: |
success() || (
failure() && (
steps.run-api-composite-action.outputs.result == 'failure' ||
steps.run-e2e-composite-action.outputs.result == 'failure'
)
)
uses: ./.github/actions/tests/slack-summary-on-release/slack-blocks
with:
test-name: WP Latest-1 (${{ steps.get-wp-latest-1.outputs.version }})
api-result: ${{ steps.run-api-composite-action.outputs.result }}
e2e-result: ${{ steps.run-e2e-composite-action.outputs.result }}
env-slug: wp-latest-1
release-version: ${{ needs.validate-version.outputs.version }}
test-php-versions:
name: Test against PHP ${{ matrix.php_version }}
runs-on: ubuntu-20.04
needs: [validate-version]
strategy:
fail-fast: false
matrix:
php_version: ['7.4', '8.1']
env:
API_ALLURE_REPORT_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/api-core-tests/test-results/allure-report
API_ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/api-core-tests/test-results/allure-results
API_ARTIFACT: API test on wp-env with PHP ${{ matrix.php_version }} (run ${{ github.run_number }})
E2E_ALLURE_REPORT_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/test-results/allure-report
E2E_ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/test-results/allure-results
E2E_ARTIFACT: E2E test on wp-env with PHP ${{ matrix.php_version }} (run ${{ github.run_number }})
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup WooCommerce Monorepo
uses: ./.github/actions/setup-woocommerce-monorepo
with:
install: '@woocommerce/plugin-woocommerce...'
build: '@woocommerce/plugin-woocommerce'
- name: Launch WP Env
working-directory: plugins/woocommerce
env:
WP_ENV_PHP_VERSION: ${{ matrix.php_version }}
run: pnpm env:test
- name: Verify PHP version
working-directory: .github/workflows/scripts
env:
EXPECTED_PHP_VERSION: ${{ matrix.php_version }}
run: bash verify-php-version.sh
- name: Download release zip
id: download-zip
uses: actions/github-script@v6
env:
ASSET_ID: ${{ needs.validate-version.outputs.asset-id }}
with:
github-token: ${{ secrets.E2E_GH_TOKEN }}
script: |
const script = require('./.github/workflows/scripts/download-release-zip.js');
await script({ github, context, core });
- name: Replace `plugins/woocommerce` with unzipped woocommerce release build
run: unzip -d plugins -o ${{ env.ZIP_PATH }}
env:
ZIP_PATH: ${{ steps.download-zip.outputs.zip-path }}
- name: Run API tests
id: run-api-composite-action
uses: ./.github/actions/tests/run-api-tests
with:
report-name: ${{ env.API_ARTIFACT }}
tests: hello.test.js
env:
ALLURE_RESULTS_DIR: ${{ env.API_ALLURE_RESULTS_DIR }}
ALLURE_REPORT_DIR: ${{ env.API_ALLURE_REPORT_DIR }}
- name: Upload Allure artifacts to bucket
if: success() || ( failure() && steps.run-api-composite-action.conclusion == 'failure' )
uses: ./.github/actions/tests/upload-allure-files-to-bucket
env:
ALLURE_RESULTS_DIR: ${{ env.API_ALLURE_RESULTS_DIR }}
ALLURE_REPORT_DIR: ${{ env.API_ALLURE_REPORT_DIR }}
with:
aws-access-key-id: ${{ secrets.REPORTS_AWS_ACCESS_KEY_ID }}
aws-region: ${{ secrets.REPORTS_AWS_REGION }}
aws-secret-access-key: ${{ secrets.REPORTS_AWS_SECRET_ACCESS_KEY }}
artifact-name: ${{ env.API_ARTIFACT }}
s3-bucket: ${{ secrets.REPORTS_BUCKET }}
- name: Publish API Allure report
if: success() || ( failure() && steps.run-api-composite-action.conclusion == 'failure' )
env:
GITHUB_TOKEN: ${{ secrets.REPORTS_TOKEN }}
ENV_DESCRIPTION: php-${{ matrix.php_version }}
run: |
gh workflow run publish-test-reports-release.yml \
-f created_at="${{ needs.validate-version.outputs.created }}" \
-f run_id=${{ github.run_id }} \
-f run_number=${{ github.run_number }} \
-f release_tag=${{ needs.validate-version.outputs.version }} \
-f artifact="${{ env.API_ARTIFACT }}" \
-f env_description="${{ env.ENV_DESCRIPTION }}" \
-f test_type="api" \
--repo woocommerce/woocommerce-test-reports
- name: Run E2E tests
id: run-e2e-composite-action
timeout-minutes: 90
uses: ./.github/actions/tests/run-e2e-tests
env:
ALLURE_RESULTS_DIR: ${{ env.E2E_ALLURE_RESULTS_DIR }}
ALLURE_REPORT_DIR: ${{ env.E2E_ALLURE_REPORT_DIR }}
DEFAULT_TIMEOUT_OVERRIDE: 120000
E2E_MAX_FAILURES: 90
with:
report-name: ${{ env.E2E_ARTIFACT }}
- name: Upload Allure artifacts to bucket
if: success() || ( failure() && steps.run-e2e-composite-action.conclusion == 'failure' )
uses: ./.github/actions/tests/upload-allure-files-to-bucket
env:
ALLURE_RESULTS_DIR: ${{ env.E2E_ALLURE_RESULTS_DIR }}
ALLURE_REPORT_DIR: ${{ env.E2E_ALLURE_REPORT_DIR }}
with:
aws-access-key-id: ${{ secrets.REPORTS_AWS_ACCESS_KEY_ID }}
aws-region: ${{ secrets.REPORTS_AWS_REGION }}
aws-secret-access-key: ${{ secrets.REPORTS_AWS_SECRET_ACCESS_KEY }}
artifact-name: ${{ env.E2E_ARTIFACT }}
s3-bucket: ${{ secrets.REPORTS_BUCKET }}
- name: Publish E2E Allure report
if: success() || ( failure() && steps.run-e2e-composite-action.conclusion == 'failure' )
env:
GITHUB_TOKEN: ${{ secrets.REPORTS_TOKEN }}
ENV_DESCRIPTION: php-${{ matrix.php_version }}
run: |
gh workflow run publish-test-reports-release.yml \
-f created_at="${{ needs.validate-version.outputs.created }}" \
-f run_id=${{ github.run_id }} \
-f run_number=${{ github.run_number }} \
-f release_tag=${{ needs.validate-version.outputs.version }} \
-f artifact="${{ env.E2E_ARTIFACT }}" \
-f env_description="${{ env.ENV_DESCRIPTION }}" \
-f test_type="e2e" \
--repo woocommerce/woocommerce-test-reports
- name: Create Slack block
if: |
success() || (
failure() && (
steps.run-api-composite-action.outputs.result == 'failure' ||
steps.run-e2e-composite-action.outputs.result == 'failure'
)
)
uses: ./.github/actions/tests/slack-summary-on-release/slack-blocks
with:
test-name: PHP ${{ matrix.php_version }}
api-result: ${{ steps.run-api-composite-action.outputs.result }}
e2e-result: ${{ steps.run-e2e-composite-action.outputs.result }}
env-slug: php-${{ matrix.php_version }}
release-version: ${{ needs.validate-version.outputs.version }}
test-plugins:
name: With ${{ matrix.plugin }}
runs-on: ubuntu-20.04
needs: [validate-version]
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
ARTIFACT_NAME: E2E test on wp-env with ${{ matrix.plugin }} installed (run ${{ github.run_number }})
strategy:
fail-fast: false
matrix:
include:
- plugin: 'WooCommerce Payments'
repo: 'automattic/woocommerce-payments'
env_description: 'woocommerce-payments'
- plugin: 'WooCommerce PayPal Payments'
repo: 'woocommerce/woocommerce-paypal-payments'
env_description: 'woocommerce-paypal-payments'
- plugin: 'WooCommerce Shipping & Tax'
repo: 'automattic/woocommerce-services'
env_description: 'woocommerce-shipping-&-tax'
- plugin: 'Woo Subscriptions'
repo: WC_SUBSCRIPTIONS_REPO
private: true
env_description: 'woocommerce-subscriptions'
- plugin: 'Gutenberg'
repo: 'WordPress/gutenberg'
env_description: 'gutenberg'
- plugin: 'Gutenberg - Nightly'
repo: 'bph/gutenberg'
env_description: 'gutenberg-nightly'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup WooCommerce Monorepo
uses: ./.github/actions/setup-woocommerce-monorepo
with:
install: '@woocommerce/plugin-woocommerce...'
build: '@woocommerce/plugin-woocommerce'
- name: Launch WP Env
working-directory: plugins/woocommerce
run: pnpm env:test
- name: Download release zip
id: download-zip
uses: actions/github-script@v6
env:
ASSET_ID: ${{ needs.validate-version.outputs.asset-id }}
with:
github-token: ${{ secrets.E2E_GH_TOKEN }}
script: |
const script = require('./.github/workflows/scripts/download-release-zip.js');
await script({ github, context, core });
- name: Replace `plugins/woocommerce` with unzipped woocommerce release build
run: unzip -d plugins -o ${{ env.ZIP_PATH }}
env:
ZIP_PATH: ${{ steps.download-zip.outputs.zip-path }}
- name: Run 'Upload plugin' test
id: run-upload-test
timeout-minutes: 90
uses: ./.github/actions/tests/run-e2e-tests
with:
report-name: ${{ env.ARTIFACT_NAME }}
tests: upload-plugin.spec.js
env:
GITHUB_TOKEN: ${{ secrets.E2E_GH_TOKEN }}
PLUGIN_NAME: ${{ matrix.plugin }}
PLUGIN_REPOSITORY: ${{ matrix.private && secrets[matrix.repo] || matrix.repo }}
- name: Run the rest of E2E tests
id: run-e2e-composite-action
timeout-minutes: 90
uses: ./.github/actions/tests/run-e2e-tests
with:
playwright-config: ignore-plugin-tests.playwright.config.js
report-name: ${{ env.ARTIFACT_NAME }}
env:
E2E_MAX_FAILURES: 90
- name: Upload Allure artifacts to bucket
if: |
success() ||
( failure() &&
( steps.run-upload-test.conclusion == 'failure' || steps.run-e2e-composite-action.conclusion == 'failure' ) )
uses: ./.github/actions/tests/upload-allure-files-to-bucket
with:
aws-access-key-id: ${{ secrets.REPORTS_AWS_ACCESS_KEY_ID }}
aws-region: ${{ secrets.REPORTS_AWS_REGION }}
aws-secret-access-key: ${{ secrets.REPORTS_AWS_SECRET_ACCESS_KEY }}
artifact-name: ${{ env.ARTIFACT_NAME }}
s3-bucket: ${{ secrets.REPORTS_BUCKET }}
- name: Publish E2E Allure report
if: success() || ( failure() && steps.run-e2e-composite-action.conclusion == 'failure' )
env:
GITHUB_TOKEN: ${{ secrets.REPORTS_TOKEN }}
run: |
gh workflow run publish-test-reports-release.yml \
-f created_at="${{ needs.validate-version.outputs.created }}" \
-f run_id=${{ github.run_id }} \
-f run_number=${{ github.run_number }} \
-f release_tag=${{ needs.validate-version.outputs.version }} \
-f artifact="${{ env.ARTIFACT_NAME }}" \
-f env_description="${{ matrix.env_description }}" \
-f test_type="e2e" \
--repo woocommerce/woocommerce-test-reports
- name: Create Slack block
if: |
success() || (
failure() && steps.run-e2e-composite-action.outputs.result == 'failure' )
uses: ./.github/actions/tests/slack-summary-on-release/slack-blocks
with:
test-name: With ${{ matrix.plugin }}
e2e-result: ${{ steps.run-e2e-composite-action.outputs.result }}
env-slug: ${{ matrix.env_description }}
release-version: ${{ needs.validate-version.outputs.version }}
post-slack-summary:
name: Post Slack summary
runs-on: ubuntu-20.04
permissions:
contents: read
if: |
github.ref_name == 'trunk' &&
success() || (
failure() && contains( needs.*.result, 'failure' )
)
needs:
- e2e-wp-latest
- validate-version
- test-php-versions
- test-plugins
- test-wp-latest-1
steps:
- uses: actions/checkout@v3
- name: Download all slack blocks
id: download-slack-blocks
uses: actions/download-artifact@v3
with:
name: ${{ env.SLACK_BLOCKS_ARTIFACT }}
path: /tmp/slack-payload
- name: Construct payload from all blocks
id: run-payload-action
uses: ./.github/actions/tests/slack-summary-on-release/slack-payload
with:
release-version: ${{ needs.validate-version.outputs.version }}
blocks-dir: ${{ steps.download-slack-blocks.outputs.download-path }}
- name: Send Slack message
uses: slackapi/slack-github-action@v1.23.0
with:
channel-id: ${{ secrets.RELEASE_TEST_SLACK_CHANNEL }}
payload: ${{ steps.run-payload-action.outputs.payload }}
env:
SLACK_BOT_TOKEN: ${{ secrets.E2E_SLACK_TOKEN }}

View File

@ -35,9 +35,9 @@ jobs:
with:
only-labels: 'metric: flaky e2e test, team: Vortex'
days-before-stale: 5
days-before-close: 7
days-before-close: 2
stale-issue-label: 'metric: stale flaky e2e test report'
stale-issue-message: 'This test may have just been a one-time failure. It will be auto-closed if no further activity occurs within the next 2 days.'
stale-issue-message: 'This test may have been a one-time failure. It will be auto-closed if no further activity occurs within the next 2 days.'
close-issue-message: 'Auto-closed due to inactivity. Please re-open if you believe this issue is still valid.'
close-issue-reason: 'not_planned'
remove-stale-when-updated: true

View File

@ -15,6 +15,9 @@ jobs:
run: sleep 2m
shell: bash
- name: Checkout repository
uses: actions/checkout@v2
- name: Calculate test date
id: calculate_date
run: |
@ -40,55 +43,10 @@ jobs:
- name: Determine Milestone Date
id: get_milestone_date
run: |
#!/bin/bash
MILESTONE_TITLE="${{ github.event.pull_request.milestone.title }}"
MILESTONE_DATE="Undefined"
# Mapping of milestone titles to release dates
declare -A MILESTONE_DATES
MILESTONE_DATES=(
["8.0.0"]="2023-08-08"
["8.1.0"]="2023-09-12"
["8.2.0"]="2023-10-10"
["8.3.0"]="2023-11-14"
["8.4.0"]="2023-12-12"
["8.5.0"]="2024-01-09"
["8.6.0"]="2024-02-13"
["8.7.0"]="2024-03-12"
["8.8.0"]="2024-04-09"
["8.9.0"]="2024-05-14"
["9.0.0"]="2024-06-11"
["9.1.0"]="2024-07-09"
["9.2.0"]="2024-08-13"
["9.3.0"]="2024-09-10"
["9.4.0"]="2024-10-08"
["9.5.0"]="2024-11-12"
["9.6.0"]="2024-12-10"
["9.7.0"]="2025-01-14"
["9.8.0"]="2025-02-11"
["9.9.0"]="2025-03-11"
["10.0.0"]="2025-04-08"
["10.1.0"]="2025-05-13"
["10.2.0"]="2025-06-10"
["10.3.0"]="2025-07-08"
["10.4.0"]="2025-08-12"
["10.5.0"]="2025-09-09"
["10.6.0"]="2025-10-14"
["10.7.0"]="2025-11-11"
["10.8.0"]="2025-12-09"
["10.9.0"]="2026-01-13"
["11.0.0"]="2026-02-10"
)
# Check if the milestone title exists in our predefined list and get the date
if [[ -v "MILESTONE_DATES[${MILESTONE_TITLE}]" ]]; then
MILESTONE_DATE=${MILESTONE_DATES[${MILESTONE_TITLE}]}
fi
# Export for later steps
echo "MILESTONE_DATE=${MILESTONE_DATE}" >> $GITHUB_ENV
working-directory: .github/workflows/scripts
run: bash determine_milestone_date.sh
env:
GITHUB_EVENT_PATH_PULL_REQUEST_MILESTONE_TITLE: ${{ github.event.pull_request.milestone.title }}
# Notify Slack Step
- name: Notify Slack

View File

@ -15,6 +15,9 @@ jobs:
run: sleep 2m
shell: bash
- name: Checkout repository
uses: actions/checkout@v2
- name: Calculate test date
id: calculate_date
run: |
@ -40,55 +43,10 @@ jobs:
- name: Determine Milestone Date
id: get_milestone_date
run: |
#!/bin/bash
MILESTONE_TITLE="${{ github.event.pull_request.milestone.title }}"
MILESTONE_DATE="Undefined"
# Mapping of milestone titles to release dates
declare -A MILESTONE_DATES
MILESTONE_DATES=(
["8.0.0"]="2023-08-08"
["8.1.0"]="2023-09-12"
["8.2.0"]="2023-10-10"
["8.3.0"]="2023-11-14"
["8.4.0"]="2023-12-12"
["8.5.0"]="2024-01-09"
["8.6.0"]="2024-02-13"
["8.7.0"]="2024-03-12"
["8.8.0"]="2024-04-09"
["8.9.0"]="2024-05-14"
["9.0.0"]="2024-06-11"
["9.1.0"]="2024-07-09"
["9.2.0"]="2024-08-13"
["9.3.0"]="2024-09-10"
["9.4.0"]="2024-10-08"
["9.5.0"]="2024-11-12"
["9.6.0"]="2024-12-10"
["9.7.0"]="2025-01-14"
["9.8.0"]="2025-02-11"
["9.9.0"]="2025-03-11"
["10.0.0"]="2025-04-08"
["10.1.0"]="2025-05-13"
["10.2.0"]="2025-06-10"
["10.3.0"]="2025-07-08"
["10.4.0"]="2025-08-12"
["10.5.0"]="2025-09-09"
["10.6.0"]="2025-10-14"
["10.7.0"]="2025-11-11"
["10.8.0"]="2025-12-09"
["10.9.0"]="2026-01-13"
["11.0.0"]="2026-02-10"
)
# Check if the milestone title exists in our predefined list and get the date
if [[ -v "MILESTONE_DATES[${MILESTONE_TITLE}]" ]]; then
MILESTONE_DATE=${MILESTONE_DATES[${MILESTONE_TITLE}]}
fi
# Export for later steps
echo "MILESTONE_DATE=${MILESTONE_DATE}" >> $GITHUB_ENV
working-directory: .github/workflows/scripts
run: bash determine_milestone_date.sh
env:
GITHUB_EVENT_PATH_PULL_REQUEST_MILESTONE_TITLE: ${{ github.event.pull_request.milestone.title }}
# Notify Slack Step
- name: Notify Slack

13
.github/workflows/tests-daily-run.yml vendored Normal file
View File

@ -0,0 +1,13 @@
name: 'Daily tests run'
on:
schedule:
- cron: '25 3 * * *'
workflow_dispatch:
jobs:
run-tests:
name: 'Run tests'
uses: ./.github/workflows/ci.yml
with:
trigger: 'daily-checks'
secrets: inherit

View File

@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
pnpm install
pnpm install --frozen-lockfile

View File

@ -12,7 +12,7 @@
"dependencies": [
"pnpm"
],
"pinVersion": "^8.12.1",
"pinVersion": "^9.1.0",
"packages": [
"**"
]
@ -136,7 +136,7 @@
"packages": [
"**"
],
"pinVersion": "^1.40.1"
"pinVersion": "^1.45.1"
},
{
"dependencies": [

View File

@ -1,5 +1,518 @@
== Changelog ==
= 9.0.2 2024-06-24 =
**WooCommerce**
* Fix - Revert 46857 to preserve backcompat with earlier WC versions. [#48753](https://github.com/woocommerce/woocommerce/pull/48753)
= 9.0.1 2024-06-20 =
**WooCommerce**
* Fix - Check WC_Legacy_API instead of WC_API as that seems to be cached by lightspeed servers. [#48593](https://github.com/woocommerce/woocommerce/pull/48593)
= 9.0.0 2024-06-18 =
**WooCommerce**
* Security - Prevent HTML & JS injection attacks on registration and checkout forms when the Order Attribution is enabled. [#48348](https://github.com/woocommerce/woocommerce/pull/48348)
* Update - Toggle LYS feature flag off for 9.0 [#48231](https://github.com/woocommerce/woocommerce/pull/48231)
* Fix - Fix settings-api textarea validation to prevent insertion of iframes in description areas by default [#48432](https://github.com/woocommerce/woocommerce/pull/48432)
* Fix - #47626 changed the classes on the legacy admin settings save button and broke saving standard tax rates [#48201](https://github.com/woocommerce/woocommerce/pull/48201)
* Fix - Revert "Remove customer-effort-score-tracks" feature flag #48235 [#48235](https://github.com/woocommerce/woocommerce/pull/48235)
* Fix - Fix db update notice redirection bug where it redirects without checking for db update action. [#48163](https://github.com/woocommerce/woocommerce/pull/48163)
* Fix - Add missing URL to discover more link in LYS tour [#48109](https://github.com/woocommerce/woocommerce/pull/48109)
* Fix - Fix: "On Sale" collection isn't displaying on Editor side [#47994](https://github.com/woocommerce/woocommerce/pull/47994)
* Fix - Make the plugin autoinstall process more robust [#47798](https://github.com/woocommerce/woocommerce/pull/47798)
* Fix - Prevent tracking files from being enqueued on the front end. [#47938](https://github.com/woocommerce/woocommerce/pull/47938)
* Fix - Fix: Product Collection block does not display properly when editing template/post [#47871](https://github.com/woocommerce/woocommerce/pull/47871)
* Fix - Added useRef to ensure confetti animation is only run once [#47838](https://github.com/woocommerce/woocommerce/pull/47838)
* Fix - Fixed a fatal error when programmatically using the WC_Discounts::class in a context where no cart exists. [#47589](https://github.com/woocommerce/woocommerce/pull/47589)
* Fix - Fixed shipping flat price change to free shipping when shipping cost represented using decimal separators and thousands separators. [#46857](https://github.com/woocommerce/woocommerce/pull/46857)
* Fix - Product Collection: fix the incompatibility of Query Pagination block with Product Collection [#47749](https://github.com/woocommerce/woocommerce/pull/47749)
* Fix - Add missing line item data to the REST API refunds schema in versions 2 and 3 [#47254](https://github.com/woocommerce/woocommerce/pull/47254)
* Fix - Allow category and tag taxonomy filters on the Product Collection block to see more than the first 10. [#47155](https://github.com/woocommerce/woocommerce/pull/47155)
* Fix - A number of e2e fixes for flaky tests [#47562](https://github.com/woocommerce/woocommerce/pull/47562)
* Fix - Avoid a warning in PHP 8.3 with some edge case uses of array_sum [#47595](https://github.com/woocommerce/woocommerce/pull/47595)
* Fix - Blocks: Fix JS unit tests [#47516](https://github.com/woocommerce/woocommerce/pull/47516)
* Fix - Catch NotFoundException before woocommerce_get_batch_processor [#46975](https://github.com/woocommerce/woocommerce/pull/46975)
* Fix - Check each pacakge's chosen shipping rate against each valid rate for that package [#47716](https://github.com/woocommerce/woocommerce/pull/47716)
* Fix - Correctly clear out state and postcode when switching countries. [#47369](https://github.com/woocommerce/woocommerce/pull/47369)
* Fix - Correctly load up Cart/Checkout translations on Windows machines. [#47625](https://github.com/woocommerce/woocommerce/pull/47625)
* Fix - CYS: fix color picker E2E test [#47274](https://github.com/woocommerce/woocommerce/pull/47274)
* Fix - Filter by Attribute: fix potential reading from undefined error [#47699](https://github.com/woocommerce/woocommerce/pull/47699)
* Fix - Fix: handle undefined templateSlug in Product Collection tracking utils [#47504](https://github.com/woocommerce/woocommerce/pull/47504)
* Fix - Fix: Product Collection Block Respects 'Out of stock visibility' Setting [#47537](https://github.com/woocommerce/woocommerce/pull/47537)
* Fix - Fix an accessibility error in the add to cart button template. [#46897](https://github.com/woocommerce/woocommerce/pull/46897)
* Fix - Fix an issue in which a warning is emitted when placing an order using Checkout block. [#47633](https://github.com/woocommerce/woocommerce/pull/47633)
* Fix - Fix broken checkout address forms layout [#47131](https://github.com/woocommerce/woocommerce/pull/47131)
* Fix - Fix broken db update button on homescreen [#47608](https://github.com/woocommerce/woocommerce/pull/47608)
* Fix - Fix core profiler email field is not positioned correctly in mobile screens [#47077](https://github.com/woocommerce/woocommerce/pull/47077)
* Fix - Fix coupon rest api returning 500 error on delete. [#47474](https://github.com/woocommerce/woocommerce/pull/47474)
* Fix - Fix dates dropdown in admin list order page where it wasn't filtered by order type. [#47440](https://github.com/woocommerce/woocommerce/pull/47440)
* Fix - FIxed a bug where shop page isn't recognized as a WooCommerce page when WordPress is installed in a subdirectory with permalink set to plain. [#46664](https://github.com/woocommerce/woocommerce/pull/46664)
* Fix - Fixes regarding authentication and non-existing products in the receipts rendering engine [#47300](https://github.com/woocommerce/woocommerce/pull/47300)
* Fix - Fix failed to load coming-soon resources [#47073](https://github.com/woocommerce/woocommerce/pull/47073)
* Fix - Fix flaky Attributes and Variations E2E tests #47471 [#47471](https://github.com/woocommerce/woocommerce/pull/47471)
* Fix - Fix GLA site verification with coming soon mode [#47140](https://github.com/woocommerce/woocommerce/pull/47140)
* Fix - Fix LYS site icon size [#47689](https://github.com/woocommerce/woocommerce/pull/47689)
* Fix - Fix missing shipping-recommendation task [#47117](https://github.com/woocommerce/woocommerce/pull/47117)
* Fix - Fix orders search filter position in admin list table. [#47640](https://github.com/woocommerce/woocommerce/pull/47640)
* Fix - fix PHP 8 warning in Blocks\Installer\create_pages() callback when other filters have removed pages [#47094](https://github.com/woocommerce/woocommerce/pull/47094)
* Fix - Fix registration of plugin on woocommerce.com if plugin is already active on site. [#46780](https://github.com/woocommerce/woocommerce/pull/46780)
* Fix - Fix RIN Display Logic for Banner Alert Notifications [#47167](https://github.com/woocommerce/woocommerce/pull/47167)
* Fix - Fix tasklist_payments_options to record only shown payment gateways [#47713](https://github.com/woocommerce/woocommerce/pull/47713)
* Fix - Fix Tax reports not showing correct totals in analytics [#46248](https://github.com/woocommerce/woocommerce/pull/46248)
* Fix - Fix undefined variable $exlude_paths [#47490](https://github.com/woocommerce/woocommerce/pull/47490)
* Fix - Fix warnings from using fse theme json filter [#47631](https://github.com/woocommerce/woocommerce/pull/47631)
* Fix - Fix width of the button to set the variation prices #47682 [#47682](https://github.com/woocommerce/woocommerce/pull/47682)
* Fix - Fix `admin_url` usage in Task List button links for Customize Store and Launch Your Store tasks. [#47010](https://github.com/woocommerce/woocommerce/pull/47010)
* Fix - Make REST order queries involving 'customer' field compatible with HPOS in v2 API. [#46878](https://github.com/woocommerce/woocommerce/pull/46878)
* Fix - Prevent empty checkboxes added by Additional Checkout Fields API showing in the order confirmation when the order was placed using the shortcode checkout experience. [#47333](https://github.com/woocommerce/woocommerce/pull/47333)
* Fix - Prevent product from being saved prematurely when updated via REST API [#46674](https://github.com/woocommerce/woocommerce/pull/46674)
* Fix - Product Collection - Fix edge cases in Price Range filter around value parsing [#47354](https://github.com/woocommerce/woocommerce/pull/47354)
* Fix - Reenable global styles in coming soon entire site template [#47388](https://github.com/woocommerce/woocommerce/pull/47388)
* Fix - Replace forward slashes in additional fields IDs with hyphens. [#47650](https://github.com/woocommerce/woocommerce/pull/47650)
* Fix - Select the first shipping rate when local pickup is enabled and customer switches to shipping. [#47120](https://github.com/woocommerce/woocommerce/pull/47120)
* Fix - Show Germany state field in Checkout block. [#47319](https://github.com/woocommerce/woocommerce/pull/47319)
* Fix - Switch marketplace promotions from Action Scheduler to transient. [#47262](https://github.com/woocommerce/woocommerce/pull/47262)
* Fix - Update color contrast for Checkout fields. Update color contrast for notice buttons. Return focus when closing mini cart drawer. Return focus when closing shipping calculator. [#47470](https://github.com/woocommerce/woocommerce/pull/47470)
* Fix - Update coupon_usage for failed & trashed orders. [#47125](https://github.com/woocommerce/woocommerce/pull/47125)
* Fix - Update delete item meta query to format supported by wpdb::get_table_from_query() [#46692](https://github.com/woocommerce/woocommerce/pull/46692)
* Fix - Updated the PHP DocBlock for WC_CLI_Runner::register_route_commands to correctly specify the first parameter's type as being a WC_CLI_REST_Command object rather than a string. [#47599](https://github.com/woocommerce/woocommerce/pull/47599)
* Fix - Update the version number of some methods in AbstractTemplateCompatibility [#47118](https://github.com/woocommerce/woocommerce/pull/47118)
* Fix - Use the default ordering of states in the Checkout block [#46656](https://github.com/woocommerce/woocommerce/pull/46656)
* Fix - [CYS]: Fix event name when starting the no-AI flow. [#47181](https://github.com/woocommerce/woocommerce/pull/47181)
* Fix - [CYS] Fix bug making the AI flow fail on the same prompt. [#46872](https://github.com/woocommerce/woocommerce/pull/46872)
* Add - Show notice for expiring subscriptions [#47004](https://github.com/woocommerce/woocommerce/pull/47004)
* Add - Add custom fonts via wp_theme_json_data_theme filter for coming soon pages [#47417](https://github.com/woocommerce/woocommerce/pull/47417)
* Add - Added phone number field to Shipping Address form under My Account [#47062](https://github.com/woocommerce/woocommerce/pull/47062)
* Add - Added the `wc_product_pre_has_unique_sku` filter hook to allow SKU uniqueness to be determined externally [#46763](https://github.com/woocommerce/woocommerce/pull/46763)
* Add - Add filter to convert WooCommerce slug for plugin dependencies [#46707](https://github.com/woocommerce/woocommerce/pull/46707)
* Add - Add hooks to customize the order receipt generation [#46224](https://github.com/woocommerce/woocommerce/pull/46224)
* Add - Adds 3 additional UTM parameters recognized in GA4 documentation. [#47639](https://github.com/woocommerce/woocommerce/pull/47639)
* Add - Adds a wc/v3/refunds REST API endpoint so refunds can be queried collectively, unconnected to their orders [#46895](https://github.com/woocommerce/woocommerce/pull/46895)
* Add - Add tracks events for the LYS badge [#46509](https://github.com/woocommerce/woocommerce/pull/46509)
* Add - Allow HPOS CLI cleanup tool to remove metadata for deleted orders. [#46970](https://github.com/woocommerce/woocommerce/pull/46970)
* Add - Append coming soon tracks prop globally [#47644](https://github.com/woocommerce/woocommerce/pull/47644)
* Add - Comment: Added feature to redirect back to LYS from CYS if the referrer is LYS. [#47654](https://github.com/woocommerce/woocommerce/pull/47654)
* Add - Filter to apply Base64 encoding to order attribution cookies [#47597](https://github.com/woocommerce/woocommerce/pull/47597)
* Add - For shared subscriptions, My Subscriptions now shows "Shared with you" and the email address of the person who shared it with you. [#46229](https://github.com/woocommerce/woocommerce/pull/46229)
* Add - New product editor: Add 'placeholder' attribute to category field in Simple Product Template [#46938](https://github.com/woocommerce/woocommerce/pull/46938)
* Add - Product Collection: Add preview mode on Editor side [#46369](https://github.com/woocommerce/woocommerce/pull/46369)
* Add - Product Collection: collections that don't inherit query from template are non-filterable [#45820](https://github.com/woocommerce/woocommerce/pull/45820)
* Add - REST API: Add product variation type to response when getting variations. [#47377](https://github.com/woocommerce/woocommerce/pull/47377)
* Add - Return HPOS edit links for calls to `get_edit_post_link()` on placeholder posts. [#47149](https://github.com/woocommerce/woocommerce/pull/47149)
* Add - Show an message in the plugin table list for WooCommerce extensions that are either expired or expiring. [#47076](https://github.com/woocommerce/woocommerce/pull/47076)
* Add - Show the label for freemium products in the in-app marketpalce [#45982](https://github.com/woocommerce/woocommerce/pull/45982)
* Update - Add a new update function for WC 9.0 to add woocommerce_show_lys_tour option. [#47634](https://github.com/woocommerce/woocommerce/pull/47634)
* Update - Add aria-label to customer account block link when in icon-only display mode. [#46899](https://github.com/woocommerce/woocommerce/pull/46899)
* Update - Add busy animation for save button in settings screen [#47626](https://github.com/woocommerce/woocommerce/pull/47626)
* Update - Added `padding-left: 15px` to the copy link to provide equal spacing around the button [#47313](https://github.com/woocommerce/woocommerce/pull/47313)
* Update - Add UTM tags to all product links in core profiler Free features step [#47397](https://github.com/woocommerce/woocommerce/pull/47397)
* Update - Always show pickup location address and details and truncate pickup details. [#47173](https://github.com/woocommerce/woocommerce/pull/47173)
* Update - Applies `wp_plugin_dependencies_slug` filter to get the correct plugin name in PluginVersionRuleProcessor. [#47235](https://github.com/woocommerce/woocommerce/pull/47235)
* Update - Avoid writing an empty line to a log file if the log entry is empty. [#47091](https://github.com/woocommerce/woocommerce/pull/47091)
* Update - Changed the Form Step blocks in the Checkout block so that the step nunbers cannot be turned off individually. This is now a global setting on the Checkout Fields block that will affect all child blocks. The FormStep component in the checkout pacakge remains unchanged. [#47479](https://github.com/woocommerce/woocommerce/pull/47479)
* Update - Classic Templates: Renamed blocks representing classic templates from "WooCommerce XYZ Block" to "XYZ (Classic)" [#44931](https://github.com/woocommerce/woocommerce/pull/44931)
* Update - Disable auto zoom when focusing on input for core profile [#47400](https://github.com/woocommerce/woocommerce/pull/47400)
* Update - Display the total price in the place order button. [#47083](https://github.com/woocommerce/woocommerce/pull/47083)
* Update - Display `Import Product` task item text and header copies when merchant indicates they are already selling [#47164](https://github.com/woocommerce/woocommerce/pull/47164)
* Update - Do not display smart app banner on the core profiler, LYS, and CYS pages [#47429](https://github.com/woocommerce/woocommerce/pull/47429)
* Update - Ensure the woocommerce_format_log_entry filter hook still has access to the log source value [#46851](https://github.com/woocommerce/woocommerce/pull/46851)
* Update - Hide progress bar when entering Design With AI from Entrepreneur signup flow. [#47574](https://github.com/woocommerce/woocommerce/pull/47574)
* Update - Improvements to HPOS settings screen. [#47370](https://github.com/woocommerce/woocommerce/pull/47370)
* Update - In blocks migrate `@wordpress/components` Button to Ariakit, replace `__experimentalRadio/RadioGroup` with Ariakit Button. [#45974](https://github.com/woocommerce/woocommerce/pull/45974)
* Update - Inject order attribution checkout fields (only once) on a wider set of checkout form actions. [#46834](https://github.com/woocommerce/woocommerce/pull/46834)
* Update - LYS - Use flow layout for the coming soon template [#47335](https://github.com/woocommerce/woocommerce/pull/47335)
* Update - LYS: disables the "Save changes" button until changes are made. [#47316](https://github.com/woocommerce/woocommerce/pull/47316)
* Update - Make order attribution data globally accessible client side. [#46965](https://github.com/woocommerce/woocommerce/pull/46965)
* Update - Move country to be the first field in Checkout block. [#47375](https://github.com/woocommerce/woocommerce/pull/47375)
* Update - Product Collection: remove Beta label [#47572](https://github.com/woocommerce/woocommerce/pull/47572)
* Update - Redirect old market-place to new market-place pages [#47276](https://github.com/woocommerce/woocommerce/pull/47276)
* Update - Refactor coming soon entire page to wrap under cover block [#46914](https://github.com/woocommerce/woocommerce/pull/46914)
* Update - Remove admin toolbar button hover background [#47314](https://github.com/woocommerce/woocommerce/pull/47314)
* Update - Remove noindex robot call from lys coming soon pages [#47178](https://github.com/woocommerce/woocommerce/pull/47178)
* Update - Remove title from checkout page [#47529](https://github.com/woocommerce/woocommerce/pull/47529)
* Update - Rename and sort filter options in "Add a filter" in Analytics. [#46955](https://github.com/woocommerce/woocommerce/pull/46955)
* Update - Replace div element with main in block templates [#47119](https://github.com/woocommerce/woocommerce/pull/47119)
* Update - Replace Options API usage with LaunchYourStore endpoint for LYS [#47252](https://github.com/woocommerce/woocommerce/pull/47252)
* Update - Replace the Legacy REST API with a stub that always returns an error [#40627](https://github.com/woocommerce/woocommerce/pull/40627)
* Update - Replace the `Testimonials single` default image. [#47535](https://github.com/woocommerce/woocommerce/pull/47535)
* Update - Return users to LYS after completing essential task [#47606](https://github.com/woocommerce/woocommerce/pull/47606)
* Update - Toggle LYS feature flag on for post-8.9 [#46853](https://github.com/woocommerce/woocommerce/pull/46853)
* Update - Update @automattic/tour-kit to 1.1.3 and @automattic/components to 2.1.1 [#47129](https://github.com/woocommerce/woocommerce/pull/47129)
* Update - Update delivery titles & pickup options; refine shipping selector layout & address field visibility in the Checkout block. [#46083](https://github.com/woocommerce/woocommerce/pull/46083)
* Update - Updated the toolbar's store link based on the site's visibility settings. [#47315](https://github.com/woocommerce/woocommerce/pull/47315)
* Update - Update experiment name for the new product editing screen. [#47647](https://github.com/woocommerce/woocommerce/pull/47647)
* Update - Update Octokit from 2.1.0 to 3.1.2 and updated variable names [#42891](https://github.com/woocommerce/woocommerce/pull/42891)
* Update - Update the display logic of company name, address line 2 and phone number fields and allow making the address line 2 field required. [#47160](https://github.com/woocommerce/woocommerce/pull/47160)
* Update - Update the WooCommerce Status page to use the full plugin version to show dev, Beta and RC versions as opposed to only the milestone number [#46906](https://github.com/woocommerce/woocommerce/pull/46906)
* Update - Use the term attribute sort order for displaying the "Filter by attribute" terms. [#47616](https://github.com/woocommerce/woocommerce/pull/47616)
* Update - Use Woo branded colors for LYS confetti [#47334](https://github.com/woocommerce/woocommerce/pull/47334)
* Update - When the total shipping cost is 0 the order summary in the Cart and Checkout blocks shows "FREE" instead of 0.00 [#47553](https://github.com/woocommerce/woocommerce/pull/47553)
* Update - Woocommerce: update code to data TS changes [#46907](https://github.com/woocommerce/woocommerce/pull/46907)
* Update - Wrap LYS private link exclusion logic in an overall check [#47690](https://github.com/woocommerce/woocommerce/pull/47690)
* Dev - Add a feature flag for full composability and the Pattern Toolkit [#47392](https://github.com/woocommerce/woocommerce/pull/47392)
* Dev - Add an API test for the new refunds endpoint [#47340](https://github.com/woocommerce/woocommerce/pull/47340)
* Dev - Add Buildkite test reporting (sanitized) back using production account [#47558](https://github.com/woocommerce/woocommerce/pull/47558)
* Dev - Add help text under "Include downloads" toggle #46752 [#46752](https://github.com/woocommerce/woocommerce/pull/46752)
* Dev - Add new disableHpos test env variable in ci-job utility [#47619](https://github.com/woocommerce/woocommerce/pull/47619)
* Dev - Add Playwright performance tests to Product editor #47590 [#47590](https://github.com/woocommerce/woocommerce/pull/47590)
* Dev - Add the optional property for ci jobs [#47261](https://github.com/woocommerce/woocommerce/pull/47261)
* Dev - Block E2E: Eliminate side effects through improved test isolation [#46125](https://github.com/woocommerce/woocommerce/pull/46125)
* Dev - Blocks E2E: Align ESlint and TS configs with Gutenberg & fix flaky tests. [#47228](https://github.com/woocommerce/woocommerce/pull/47228)
* Dev - Blocks E2E: Fix flaky block insertion tests [#47213](https://github.com/woocommerce/woocommerce/pull/47213)
* Dev - Blocks E2E: Fix flaky Product Collection tests [#47211](https://github.com/woocommerce/woocommerce/pull/47211)
* Dev - Blocks E2E: Refactor Playwright configs and CI workflow [#46409](https://github.com/woocommerce/woocommerce/pull/46409)
* Dev - Blocks E2E: Remove discouraged waitForTimeout from tests [#47214](https://github.com/woocommerce/woocommerce/pull/47214)
* Dev - Blocks E2E: Remove obsolete waitForSiteEditorFinishLoading utility. [#47547](https://github.com/woocommerce/woocommerce/pull/47547)
* Dev - Blocks E2E: Remove the DB snapshot on env reset [#47416](https://github.com/woocommerce/woocommerce/pull/47416)
* Dev - Blocks E2E: Wait for Site Editor canvas loader in the `enterEditMore()` utility. [#47541](https://github.com/woocommerce/woocommerce/pull/47541)
* Dev - Disable pre-publish panel #47430 [#47430](https://github.com/woocommerce/woocommerce/pull/47430)
* Dev - E2E tests: disable broken tests [#47268](https://github.com/woocommerce/woocommerce/pull/47268)
* Dev - E2E tests: disable woocommerce_coming_soon during test environment setup [#47024](https://github.com/woocommerce/woocommerce/pull/47024)
* Dev - E2E tests: don't exit if the consumer token was not cleared in teardown [#47020](https://github.com/woocommerce/woocommerce/pull/47020)
* Dev - E2E tests: fix cleanup of created test pages and migrate to using fixtures [#46944](https://github.com/woocommerce/woocommerce/pull/46944)
* Dev - E2E tests: fixing flaky admin marketing test [#47665](https://github.com/woocommerce/woocommerce/pull/47665)
* Dev - E2E tests: more fixes for tests with Gutenberg active [#46861](https://github.com/woocommerce/woocommerce/pull/46861)
* Dev - Fix for a couple of flaky e2e tests [#47253](https://github.com/woocommerce/woocommerce/pull/47253)
* Dev - Load e2e test helper (child) themes via .wp-json instead of via WP-CLI. [#47080](https://github.com/woocommerce/woocommerce/pull/47080)
* Dev - Monorepo utils: add support for github events in ci-jobs tool [#46922](https://github.com/woocommerce/woocommerce/pull/46922)
* Dev - Move pricing features to General tab #47435 [#47435](https://github.com/woocommerce/woocommerce/pull/47435)
* Dev - Move the PHP tests with WP nightly back into CI [#47568](https://github.com/woocommerce/woocommerce/pull/47568)
* Dev - pnpm-lock.yaml update [#47575](https://github.com/woocommerce/woocommerce/pull/47575)
* Dev - Product Collection: add tracking to Editor filters usage [#46545](https://github.com/woocommerce/woocommerce/pull/46545)
* Dev - Remove BuildKite reporter from e2e tests [#47449](https://github.com/woocommerce/woocommerce/pull/47449)
* Dev - Remove not used feature flags #47150 [#47150](https://github.com/woocommerce/woocommerce/pull/47150)
* Dev - Remove upload plugin test from daily reporting [#47067](https://github.com/woocommerce/woocommerce/pull/47067)
* Dev - Restore the playwright/no-hooks linter rule introduced in #46432 and accidentally removed in #47228. [#47500](https://github.com/woocommerce/woocommerce/pull/47500)
* Dev - This PR fixes a minor typo in the Exposing your data in the Store API doc. [#43488](https://github.com/woocommerce/woocommerce/pull/43488)
* Dev - Try out the BuildKite Test Analytics in CI [#47202](https://github.com/woocommerce/woocommerce/pull/47202)
* Dev - Update cart/checkout usage of the @wordpress/components Slot Fill [#47105](https://github.com/woocommerce/woocommerce/pull/47105)
* Dev - Update docs about blocks styling to clearly state global styles are the recommended approach [#47269](https://github.com/woocommerce/woocommerce/pull/47269)
* Dev - Update events that should trigger the test job(s) [#47612](https://github.com/woocommerce/woocommerce/pull/47612)
* Dev - Update fast-xml-parser from 4.2.4 to 4.2.5 [#41982](https://github.com/woocommerce/woocommerce/pull/41982)
* Dev - Update pnpm to 9.1.0 [#47385](https://github.com/woocommerce/woocommerce/pull/47385)
* Dev - Update the Blocks JS tests to React 18 [#47383](https://github.com/woocommerce/woocommerce/pull/47383)
* Tweak - Add aria-label to account page [#43696](https://github.com/woocommerce/woocommerce/pull/43696)
* Tweak - Correct the close days for the flaky test stalebot workflow [#47484](https://github.com/woocommerce/woocommerce/pull/47484)
* Tweak - Fix coming soon page mobile UI issue [#47491](https://github.com/woocommerce/woocommerce/pull/47491)
* Tweak - Make sure "Change Address" button in Cart block is accessible. [#47460](https://github.com/woocommerce/woocommerce/pull/47460)
* Tweak - Reduce the number of tags in the plugin's readme file, to avoid warnings. [#47688](https://github.com/woocommerce/woocommerce/pull/47688)
* Tweak - Remove "Powered by WooCommerce" footer [#47075](https://github.com/woocommerce/woocommerce/pull/47075)
* Tweak - Removed bold highlight from selected payment method in the Checkout block. This has been replaced with a border highlight. [#47412](https://github.com/woocommerce/woocommerce/pull/47412)
* Tweak - Remove repetitive words [#47158](https://github.com/woocommerce/woocommerce/pull/47158)
* Tweak - Remove unused order type registration property. [#46843](https://github.com/woocommerce/woocommerce/pull/46843)
* Tweak - Respect locale settings when formatting order counts in admin orders page. [#47373](https://github.com/woocommerce/woocommerce/pull/47373)
* Tweak - Update core profiler industry list [#47605](https://github.com/woocommerce/woocommerce/pull/47605)
* Tweak - Update the order summary on Cart & Checkout with some minor visual changes [#45767](https://github.com/woocommerce/woocommerce/pull/45767)
* Tweak - Update XPF currency symbol to XPF and change its default formatting. [#46960](https://github.com/woocommerce/woocommerce/pull/46960)
* Tweak - Use a real em dash character (—) in the coming soon template [#47394](https://github.com/woocommerce/woocommerce/pull/47394)
* Tweak - Use site editor to set fonts, set default fonts to cardo and inter, add type safety for filter [#47613](https://github.com/woocommerce/woocommerce/pull/47613)
* Performance - Add experimental support for FTS indexes in HPOS. Additionally, revert existing HPOS search queries to use post like structure. [#46130](https://github.com/woocommerce/woocommerce/pull/46130)
* Performance - Add index on SKU filed in wc_product_meta_lookup table [#47051](https://github.com/woocommerce/woocommerce/pull/47051)
* Performance - Create a hook to filter the woocommerce blocks that can be registered [#47066](https://github.com/woocommerce/woocommerce/pull/47066)
* Performance - CYS > Ensure get_patterns_ai_data_post is triggered only if AI enabled and improve performance. [#46999](https://github.com/woocommerce/woocommerce/pull/46999)
* Performance - Free some in-memory usage when doing batch processing in HPOS [#47159](https://github.com/woocommerce/woocommerce/pull/47159)
* Performance - HPOS - Made the query for retrieving meta keys more performant [#46985](https://github.com/woocommerce/woocommerce/pull/46985)
* Performance - Remove duplicate css code from any woo scss file [#47122](https://github.com/woocommerce/woocommerce/pull/47122)
* Enhancement - Add Business Services to the Extensions catalogue [#47303](https://github.com/woocommerce/woocommerce/pull/47303)
* Enhancement - Added a "manual_update" parameter to the Orders REST API endpoint that will make it so that, when set to "true", status changes to an order will be attributed to a specific user in the order notes. [#46900](https://github.com/woocommerce/woocommerce/pull/46900)
* Enhancement - Add support for FI and SE postcode validation [#45480](https://github.com/woocommerce/woocommerce/pull/45480)
* Enhancement - Add support for insert_or_update for better concurrency. [#47610](https://github.com/woocommerce/woocommerce/pull/47610)
* Enhancement - Add woocommerce_order_received_verify_known_shoppers filter to Order Confirmation template [#46957](https://github.com/woocommerce/woocommerce/pull/46957)
* Enhancement - Enable guest users to visualize shipping/billing information on the order received page. [#47477](https://github.com/woocommerce/woocommerce/pull/47477)
* Enhancement - Fix: Reset password form missing required indicator [#47229](https://github.com/woocommerce/woocommerce/pull/47229)
* Enhancement - Improved readability and better UX for GitHub bug reports, by optimizing the format of the SSR [#47088](https://github.com/woocommerce/woocommerce/pull/47088)
* Enhancement - Mark the checkout block sidebar as sticky on desktop. [#47376](https://github.com/woocommerce/woocommerce/pull/47376)
* Enhancement - Replace copy: List Price to Regular Price [#47658](https://github.com/woocommerce/woocommerce/pull/47658)
= 8.9.3 2024-06-10 =
**WooCommerce**
* Security - Prevent HTML & JS injection attacks on registration and checkout forms when the Order Attribution is enabled. [#48348](https://github.com/woocommerce/woocommerce/pull/48348)
= 8.9.2 2024-06-04 =
**WooCommerce**
* Fix - Prevent tracking files from being enqueued on the front end. [#47938](https://github.com/woocommerce/woocommerce/pull/47938)
= 8.9.1 2024-05-21 =
**WooCommerce**
* Fix - Automated installation of the Legacy REST API plugin should only happen once. After that, it must be installed manually (if needed). [#47563](https://github.com/woocommerce/woocommerce/pull/47563)
* Fix - Fixes a crash in the modal block editor when the Add button is clicked with Gutenberg 18.3.0 and later [#47561](https://github.com/woocommerce/woocommerce/pull/47561)
* Fix - Fix warning when loading guest sessions from previous sessions. [#47514](https://github.com/woocommerce/woocommerce/pull/47514)
* Fix - Prevent calling woocommerce.com on empty update-check and update-check-public payload. [#47507](https://github.com/woocommerce/woocommerce/pull/47507)
= 8.9.0 2024-05-14 =
**WooCommerce**
* Fix - Fix fatal error when trying to download log files [#47398](https://github.com/woocommerce/woocommerce/pull/47398)
* Fix - Don't automatically insert hooked customer account block into header for sites running less than WP 6.5 [#47171](https://github.com/woocommerce/woocommerce/pull/47171)
* Fix - Fix HPOS order searches involving terms with characters resembling URL-encoded characters. [#46972](https://github.com/woocommerce/woocommerce/pull/46972)
* Fix - Add a bailout to prevent JavaScript errors if Sourcebuster isn't loaded [#46723](https://github.com/woocommerce/woocommerce/pull/46723)
* Fix - Add a safety check for the numbers with the same value for the separators [#46241](https://github.com/woocommerce/woocommerce/pull/46241)
* Fix - Addresses a fatal error that can occur when applying a coupon within the order editor (where one of the products has been deleted). [#46251](https://github.com/woocommerce/woocommerce/pull/46251)
* Fix - Add safety check to prevent rare occurences of a fatal in WooSubscriptionsNotes [#46472](https://github.com/woocommerce/woocommerce/pull/46472)
* Fix - Allow enbling HPOS when the only incompatible plugin is the Legacy REST API one [#46634](https://github.com/woocommerce/woocommerce/pull/46634)
* Fix - Always validate missing additional fields [#45840](https://github.com/woocommerce/woocommerce/pull/45840)
* Fix - Be less aggressive when checking for selected shipping rates in Store API. Reminder that shipping rate id should be on the shape of `method_id:instance_id`. [#46719](https://github.com/woocommerce/woocommerce/pull/46719)
* Fix - can only be inserted once excludes the mini-cart template button [#46478](https://github.com/woocommerce/woocommerce/pull/46478)
* Fix - Changed LYS task list task id from underscore to hyphens for consistency with the other tasks [#46055](https://github.com/woocommerce/woocommerce/pull/46055)
* Fix - Ensure local pickup settings are reflected in Checkout block [#46334](https://github.com/woocommerce/woocommerce/pull/46334)
* Fix - Ensure queryId and id uniqueness when duplicating the Product Collection block. [#44522](https://github.com/woocommerce/woocommerce/pull/44522)
* Fix - Ensure the wc/v3/reports/orders/totals endpoint is compatible with HPOS. [#46715](https://github.com/woocommerce/woocommerce/pull/46715)
* Fix - Fix "Add a filter" UI issue in Analytics. [#46750](https://github.com/woocommerce/woocommerce/pull/46750)
* Fix - Fix: Hand-picked control only allow selection from first 100 products [#45931](https://github.com/woocommerce/woocommerce/pull/45931)
* Fix - Fix a bug that prevented placing an order when shipping is disabled, but Local Pickup is still enabled. [#45828](https://github.com/woocommerce/woocommerce/pull/45828)
* Fix - Fix a bug where Site Visibility setting tab appears without launch-your-store feature flag turned on. [#46622](https://github.com/woocommerce/woocommerce/pull/46622)
* Fix - Fix admin header page title [#46450](https://github.com/woocommerce/woocommerce/pull/46450)
* Fix - Fix a few broken links. [#46381](https://github.com/woocommerce/woocommerce/pull/46381)
* Fix - Fix back from CYS via LYS goes to Home, not LYS [#46665](https://github.com/woocommerce/woocommerce/pull/46665)
* Fix - Fix bug parsing memory_limit in product importer [#46051](https://github.com/woocommerce/woocommerce/pull/46051)
* Fix - Fix code typo in Orders Analytics. [#46487](https://github.com/woocommerce/woocommerce/pull/46487)
* Fix - Fix coming soon page fatal error with non-FSE theme [#46570](https://github.com/woocommerce/woocommerce/pull/46570)
* Fix - Fix crashes in the mini-cart when combined with product and filter blocks. Closes #46542. [#46814](https://github.com/woocommerce/woocommerce/pull/46814)
* Fix - Fix deprecated error message with strlen usage in PHP 8.1 [#46661](https://github.com/woocommerce/woocommerce/pull/46661)
* Fix - Fix duplicate product endpoint args for item schema #46551 [#46551](https://github.com/woocommerce/woocommerce/pull/46551)
* Fix - Fixed the path for the LYS private link woo-share cookie entry [#46571](https://github.com/woocommerce/woocommerce/pull/46571)
* Fix - Fixes for some flaky e2e [#46845](https://github.com/woocommerce/woocommerce/pull/46845)
* Fix - Fixes order counts in the status widget for persistent caches. [#46860](https://github.com/woocommerce/woocommerce/pull/46860)
* Fix - Fix Home screen grey background #45895 [#45895](https://github.com/woocommerce/woocommerce/pull/45895)
* Fix - Fix input layout issue with shipping task in Firefox. [#45778](https://github.com/woocommerce/woocommerce/pull/45778)
* Fix - Fix issue preventing some blocks from being direct children of the Single Product block. [#45530](https://github.com/woocommerce/woocommerce/pull/45530)
* Fix - Fix K6 test with coming soon feature flag enabled [#46539](https://github.com/woocommerce/woocommerce/pull/46539)
* Fix - Fix Launch Your Store task item should not be clickable once completed [#46361](https://github.com/woocommerce/woocommerce/pull/46361)
* Fix - Fix linked product e2e tests #46286 [#46286](https://github.com/woocommerce/woocommerce/pull/46286)
* Fix - Fix LYS success page shown but Task not crossed off [#46663](https://github.com/woocommerce/woocommerce/pull/46663)
* Fix - Fix sanitization of special letters in Additional fields API [#46762](https://github.com/woocommerce/woocommerce/pull/46762)
* Fix - Fix some e2e tests for linked product #46506 [#46506](https://github.com/woocommerce/woocommerce/pull/46506)
* Fix - Fix the broken contract in the StoreAPI and the bug in the price clauses causing the incorrect filter counts. [#45247](https://github.com/woocommerce/woocommerce/pull/45247)
* Fix - Fix the link in the custom field helper test [#46640](https://github.com/woocommerce/woocommerce/pull/46640)
* Fix - Fix the LYS Hub tasklist so that it only shows incomplete tasks and tasks that were recently actioned [#46190](https://github.com/woocommerce/woocommerce/pull/46190)
* Fix - Fix the overlay color of the "Featured Category Triple" pattern. [#46170](https://github.com/woocommerce/woocommerce/pull/46170)
* Fix - Fix undefined error with current_screen in lys class. [#46093](https://github.com/woocommerce/woocommerce/pull/46093)
* Fix - Fix Woo.com reference in the inbox during onboarding. [#46600](https://github.com/woocommerce/woocommerce/pull/46600)
* Fix - Highlighting text in the product's description of the new product editor is not visible inside editor [#46728](https://github.com/woocommerce/woocommerce/pull/46728)
* Fix - Move the feature flag check to add_lys_default_values method [#46154](https://github.com/woocommerce/woocommerce/pull/46154)
* Fix - Only query order meta for orders that were successfully retrieved from the DB [#45544](https://github.com/woocommerce/woocommerce/pull/45544)
* Fix - Prevent fatal error on the Status page when the log directory contains an unreadable directory [#46709](https://github.com/woocommerce/woocommerce/pull/46709)
* Fix - Prevent PHP warning if local pickup has not been set up in your store [#46182](https://github.com/woocommerce/woocommerce/pull/46182)
* Fix - Prevent reading items with zero order ID to avoid mixups. [#46161](https://github.com/woocommerce/woocommerce/pull/46161)
* Fix - Product Collection: Don't show publicly non-queryable taxonomies [#45781](https://github.com/woocommerce/woocommerce/pull/45781)
* Fix - Product Collection: Fix the "Reset All" funtionality in Editor filters [#46226](https://github.com/woocommerce/woocommerce/pull/46226)
* Fix - Product Editor: Fixes a mis-alignment of the form when certain extensions are installed. [#45963](https://github.com/woocommerce/woocommerce/pull/45963)
* Fix - Removed explat test that calls live explat server [#46818](https://github.com/woocommerce/woocommerce/pull/46818)
* Fix - Remove pointer cursor and underline on hover for the product collection product title in the editor [#45998](https://github.com/woocommerce/woocommerce/pull/45998)
* Fix - Skip mini cart e2e tests, flaky test fixes [#46199](https://github.com/woocommerce/woocommerce/pull/46199)
* Fix - Update background color and padding in WooCommerce LYS status popover [#46322](https://github.com/woocommerce/woocommerce/pull/46322)
* Fix - Update `WC_Order_Factory::get_order()` to return false when failing to load cached order. [#46393](https://github.com/woocommerce/woocommerce/pull/46393)
* Fix - [CYS] - Fix color inconsistencies in the color palette buttons. [#46216](https://github.com/woocommerce/woocommerce/pull/46216)
* Fix - [CYS] Fix logo position styles while saving. [#46833](https://github.com/woocommerce/woocommerce/pull/46833)
* Fix - [CYS] Fix the AI-generated site title comparison. [#46819](https://github.com/woocommerce/woocommerce/pull/46819)
* Add - Send tracks event for woocommerce.com connect notices [#47003](https://github.com/woocommerce/woocommerce/pull/47003)
* Add - Add a connect to woocommerce.com notices for unconnected stores in the wc settings and wc marketplace page. [#45536](https://github.com/woocommerce/woocommerce/pull/45536)
* Add - Add a new task (connect to WooCommerce.com) in WC onboarding tasklist [#46259](https://github.com/woocommerce/woocommerce/pull/46259)
* Add - Add a tour for the homescreen site status badge. [#46203](https://github.com/woocommerce/woocommerce/pull/46203)
* Add - Add coming soon exclusion for users with a private link. [#46465](https://github.com/woocommerce/woocommerce/pull/46465)
* Add - Add coming soon mode routing. [#46223](https://github.com/woocommerce/woocommerce/pull/46223)
* Add - Add coming soon page and its page selector [#45773](https://github.com/woocommerce/woocommerce/pull/45773)
* Add - Add coming soon page editor links [#46100](https://github.com/woocommerce/woocommerce/pull/46100)
* Add - Add E2E tests for grouped products #45964 [#45964](https://github.com/woocommerce/woocommerce/pull/45964)
* Add - Add e2e tests for linked products #46024 [#46024](https://github.com/woocommerce/woocommerce/pull/46024)
* Add - Add E2E tests for product variation notices [#45853](https://github.com/woocommerce/woocommerce/pull/45853)
* Add - Add e2e tests for virtual orders [#45824](https://github.com/woocommerce/woocommerce/pull/45824)
* Add - Added lys hub sidebar [#46056](https://github.com/woocommerce/woocommerce/pull/46056)
* Add - Added the action to set the appropriate options when launch store button is clicked in LYS [#46235](https://github.com/woocommerce/woocommerce/pull/46235)
* Add - Added tracks events for LYS hub [#46462](https://github.com/woocommerce/woocommerce/pull/46462)
* Add - Added URL handling for LYS XState pages [#45803](https://github.com/woocommerce/woocommerce/pull/45803)
* Add - Add isSelectableByUser attribute to product templates [#46394](https://github.com/woocommerce/woocommerce/pull/46394)
* Add - Add Launch Your Store success screen [#46103](https://github.com/woocommerce/woocommerce/pull/46103)
* Add - Add LYS hub site preview [#45976](https://github.com/woocommerce/woocommerce/pull/45976)
* Add - Add meta_data parameter in generate variations endpoint [#45953](https://github.com/woocommerce/woocommerce/pull/45953)
* Add - Add origin column in Orders Analytics report. [#46424](https://github.com/woocommerce/woocommerce/pull/46424)
* Add - Adds a prefetch for the LYS congrats data [#46406](https://github.com/woocommerce/woocommerce/pull/46406)
* Add - Add shipping phone number in the order preview panel. [#45788](https://github.com/woocommerce/woocommerce/pull/45788)
* Add - Adds support for sanitizing styled chunks of HTML (a slight expansion of normal `wp_kses_post` rules). [#45407](https://github.com/woocommerce/woocommerce/pull/45407)
* Add - Add support for hooking into reading and saving additional fields. [#46870](https://github.com/woocommerce/woocommerce/pull/46870)
* Add - Add the Customer Account block to the header automatically on approved themes (including TT4). [#43267](https://github.com/woocommerce/woocommerce/pull/43267)
* Add - Add wc_rest_is_from_product_editor() function to check if REST request was made by product editor. [#46741](https://github.com/woocommerce/woocommerce/pull/46741)
* Add - Coming soon mode and the Launch Your Store task. [#46510](https://github.com/woocommerce/woocommerce/pull/46510)
* Add - Disable the fields that are not required in variable products because they are set in each variation [#45838](https://github.com/woocommerce/woocommerce/pull/45838)
* Add - Move LYS coming soon initialization to core profiler flow [#46708](https://github.com/woocommerce/woocommerce/pull/46708)
* Add - Sync local pickup title between Checkout page and shipping settings UI [#45720](https://github.com/woocommerce/woocommerce/pull/45720)
* Add - Use a public helper API endpoint update-check-public to check latest versions of WooCommerce extensions and show a plugin update message in the plugin table list to connect to woocommerce.com. [#46082](https://github.com/woocommerce/woocommerce/pull/46082)
* Add - Use state names in Checkout Block address cards. [#45799](https://github.com/woocommerce/woocommerce/pull/45799)
* Add - [Product Block Editor]: register `metadata` attribute for all blocks [#45657](https://github.com/woocommerce/woocommerce/pull/45657)
* Update - Remove wc_update_890_add_launch_your_store_tour_option function. [#47005](https://github.com/woocommerce/woocommerce/pull/47005)
* Update - Add coming soon banner on the frontend when coming soon mode is enabled. [#46096](https://github.com/woocommerce/woocommerce/pull/46096)
* Update - Add feature flag check for patterns and wrap coming soon template and patterns under feature flag [#46856](https://github.com/woocommerce/woocommerce/pull/46856)
* Update - Additional Checkout Fields has been graduated to stable. [#46805](https://github.com/woocommerce/woocommerce/pull/46805)
* Update - Add more robust method of filesystem initialization [#45914](https://github.com/woocommerce/woocommerce/pull/45914)
* Update - Add order search by transaction_id [#46129](https://github.com/woocommerce/woocommerce/pull/46129)
* Update - Add private link with copy link functionality [#45915](https://github.com/woocommerce/woocommerce/pull/45915)
* Update - Adds cog and edit icons to homescreen LYS status pill [#46098](https://github.com/woocommerce/woocommerce/pull/46098)
* Update - Add tracks for site visibility settings [#46078](https://github.com/woocommerce/woocommerce/pull/46078)
* Update - Add warnings about the incompatibility of the legacy REST API and HPOS [#46841](https://github.com/woocommerce/woocommerce/pull/46841)
* Update - Apply styles to Coming soon entire store regardless of theme [#46619](https://github.com/woocommerce/woocommerce/pull/46619)
* Update - Bump node version. [#45148](https://github.com/woocommerce/woocommerce/pull/45148)
* Update - Change styling for shipping, payment, and local pickup radio buttons in the Checkout block [#46150](https://github.com/woocommerce/woocommerce/pull/46150)
* Update - Copy change for the coming soon label in advanced setting. [#46204](https://github.com/woocommerce/woocommerce/pull/46204)
* Update - Copy text update for LYS homescreen badge. [#46097](https://github.com/woocommerce/woocommerce/pull/46097)
* Update - CYS - E2E tests: Add footer section E2E tests [#45984](https://github.com/woocommerce/woocommerce/pull/45984)
* Update - CYS - E2E tests: Add header section E2E tests [#46011](https://github.com/woocommerce/woocommerce/pull/46011)
* Update - Deprecate CLI tools under "cot" namespace and add aliases in "hpos" namespace. [#46766](https://github.com/woocommerce/woocommerce/pull/46766)
* Update - Ensure consistent styling for single shipping methods in the Checkout block [#46284](https://github.com/woocommerce/woocommerce/pull/46284)
* Update - Group subtotals in the Order Summary of the Cart & Checkout blocks [#46386](https://github.com/woocommerce/woocommerce/pull/46386)
* Update - Hide coming soon banner from LYS preview frame [#46321](https://github.com/woocommerce/woocommerce/pull/46321)
* Update - Implement dismiss button for the coming soon banner and restrict the banner on the store pages only when 'Restrict to store pages only' option is selected. [#46149](https://github.com/woocommerce/woocommerce/pull/46149)
* Update - Increase the spacing between the title and the rest of the pattern for: "Product Gallery", "Product Collection: Featured Products 5 Columns" and "Testimonials 3 Columns". [#45830](https://github.com/woocommerce/woocommerce/pull/45830)
* Update - Make LYS preview frame resizable [#46327](https://github.com/woocommerce/woocommerce/pull/46327)
* Update - Move site visibility settings to a new tab [#46140](https://github.com/woocommerce/woocommerce/pull/46140)
* Update - Product Collection: recognise if block is inside Cart or Checkout block [#46059](https://github.com/woocommerce/woocommerce/pull/46059)
* Update - Product Collection: Rename "other" location from `generic` to `site` [#46228](https://github.com/woocommerce/woocommerce/pull/46228)
* Update - Product Collection: split Taxonomies filter into separate filter per taxonomy for better readibility [#46160](https://github.com/woocommerce/woocommerce/pull/46160)
* Update - Product Collection: track collection being chosen in Product Collection [#45827](https://github.com/woocommerce/woocommerce/pull/45827)
* Update - Product Elements: unify the Product Elements inserter category [#46064](https://github.com/woocommerce/woocommerce/pull/46064)
* Update - Redirect to the CYS intro screen when accessing the transitional page without going through the customizing process. [#45933](https://github.com/woocommerce/woocommerce/pull/45933)
* Update - Remove BNPL (Klarna) additional payment method from WooPayments welcome page, update payment method icons [#46523](https://github.com/woocommerce/woocommerce/pull/46523)
* Update - Remove the red badge shown on extensions menu item when the site is not connected to WooCommerce.com [#46807](https://github.com/woocommerce/woocommerce/pull/46807)
* Update - Remove ToS acceptance where unnecessary [#46003](https://github.com/woocommerce/woocommerce/pull/46003)
* Update - Sync LYS task completion with woocommerce_coming_soon optionSync LYS task completion with woocommerce_coming_soon option [#46358](https://github.com/woocommerce/woocommerce/pull/46358)
* Update - Toggle LYS feature flag off for 8.9 [#46852](https://github.com/woocommerce/woocommerce/pull/46852)
* Update - Update @woo.com email addresses to @woocommerce.com. [#46387](https://github.com/woocommerce/woocommerce/pull/46387)
* Update - Update coming soon page link to template editor [#46566](https://github.com/woocommerce/woocommerce/pull/46566)
* Update - Update HPOS tracker and status entries. [#46239](https://github.com/woocommerce/woocommerce/pull/46239)
* Update - Update Launch Your Store task action URL [#45932](https://github.com/woocommerce/woocommerce/pull/45932)
* Update - Update LYS site visibility settings copies. [#46095](https://github.com/woocommerce/woocommerce/pull/46095)
* Update - Update lys status badge padding and only show it on WooCommerce home' [#46359](https://github.com/woocommerce/woocommerce/pull/46359)
* Update - Update the shipping selector to show FREE instead of a zero amount [#46345](https://github.com/woocommerce/woocommerce/pull/46345)
* Update - Update to use template_include instead, handle 404 for restrict store pages only [#46667](https://github.com/woocommerce/woocommerce/pull/46667)
* Update - Update WC Admin Homescreen header icons [#46353](https://github.com/woocommerce/woocommerce/pull/46353)
* Update - Update Woo.com references to WooCommerce.com. [#46259](https://github.com/woocommerce/woocommerce/pull/46259)
* Update - Use individual meta keys for Additional checkout fields. [#46091](https://github.com/woocommerce/woocommerce/pull/46091)
* Update - Use the address formats from WC_Countries in the checkout block address card [#45852](https://github.com/woocommerce/woocommerce/pull/45852)
* Update - [CYS - E2E tests] Add E2E tests for the intro screen. [#45356](https://github.com/woocommerce/woocommerce/pull/45356)
* Update - [CYS - E2E tests] Add E2E tests for the transitional screen. [#45894](https://github.com/woocommerce/woocommerce/pull/45894)
* Update - [CYS] Remove the "Save" button from inside the different sections. [#46526](https://github.com/woocommerce/woocommerce/pull/46526)
* Dev - Deprecate the woocommerce_should_load_paypal_standard filter used to bypass loading PayPal Standard. Only load the PayPal Standard payment method on stores that have connected their account or have existing PayPal orders. [#47205](https://github.com/woocommerce/woocommerce/pull/47205)
* Dev - Add an e2e test to ensure that each <CheckboxControl> component has a unique ID. [#45655](https://github.com/woocommerce/woocommerce/pull/45655)
* Dev - Add API Rest endpoint to duplicate product #46141 [#46141](https://github.com/woocommerce/woocommerce/pull/46141)
* Dev - Add a stalebot workflow for the flaky e2e test reporter [#46585](https://github.com/woocommerce/woocommerce/pull/46585)
* Dev - Add a test for the `woocommerce_specific_allowed_countries` option. [#45810](https://github.com/woocommerce/woocommerce/pull/45810)
* Dev - Add changes to tests projects [#46016](https://github.com/woocommerce/woocommerce/pull/46016)
* Dev - Add E2E test for Analytics products segmentation filter. [#46164](https://github.com/woocommerce/woocommerce/pull/46164)
* Dev - Add E2E tests for the Product Filter: Price block [#45855](https://github.com/woocommerce/woocommerce/pull/45855)
* Dev - Add E2E tests to cover Publish dropdown options #46658 [#46658](https://github.com/woocommerce/woocommerce/pull/46658)
* Dev - Added xstate v5 inspector functionality [#45879](https://github.com/woocommerce/woocommerce/pull/45879)
* Dev - Add k6 perf test assertions to check for the correct page title and presence of footer. [#46485](https://github.com/woocommerce/woocommerce/pull/46485)
* Dev - Adds an e2e test to initiate a woo.com connection [#45813](https://github.com/woocommerce/woocommerce/pull/45813)
* Dev - Adds JS linting scripts for woocommerce plugin [#46214](https://github.com/woocommerce/woocommerce/pull/46214)
* Dev - Adds some end to end tests to verify page titles of key WC pages [#46448](https://github.com/woocommerce/woocommerce/pull/46448)
* Dev - Adds tests for merchant shipping methods [#45966](https://github.com/woocommerce/woocommerce/pull/45966)
* Dev - add the expected template version to template bump warning [#46021](https://github.com/woocommerce/woocommerce/pull/46021)
* Dev - Add WordPress.WP.Capabilities config to phpcs.xml [#45927](https://github.com/woocommerce/woocommerce/pull/45927)
* Dev - Blocks - E2E: Fix visibility store [#46521](https://github.com/woocommerce/woocommerce/pull/46521)
* Dev - Blocks: Isolate performance tests from E2E tests [#46773](https://github.com/woocommerce/woocommerce/pull/46773)
* Dev - Blocks E2E: Ensure legacy template names are supported [#46269](https://github.com/woocommerce/woocommerce/pull/46269)
* Dev - Blocks E2E: Fix basic role-based functionality tests [#46684](https://github.com/woocommerce/woocommerce/pull/46684)
* Dev - Blocks E2E: Fix translation test where "Verzendmethoden" label is not visible [#46756](https://github.com/woocommerce/woocommerce/pull/46756)
* Dev - Bump data-loader from 2.1.0 to 2.2.2 [#45906](https://github.com/woocommerce/woocommerce/pull/45906)
* Dev - Bump eslint-import-resolver-typescript from 3.2.4 to 3.6.1 [#45910](https://github.com/woocommerce/woocommerce/pull/45910)
* Dev - Change the support request GH workflow to label issues as not planned when closing them [#46202](https://github.com/woocommerce/woocommerce/pull/46202)
* Dev - CI: adds e2e tests into ci-jobs and ci.yml [#45190](https://github.com/woocommerce/woocommerce/pull/45190)
* Dev - Classic Templates: enable Products by Tag E2E test [#46428](https://github.com/woocommerce/woocommerce/pull/46428)
* Dev - cleanup in blocks package.json [#45230](https://github.com/woocommerce/woocommerce/pull/45230)
* Dev - Convert the downloable checkbox into a toggle #46693 [#46693](https://github.com/woocommerce/woocommerce/pull/46693)
* Dev - E2E tests: add merchant e2e tests to cover inserting WooCoommerce patterns [#46066](https://github.com/woocommerce/woocommerce/pull/46066)
* Dev - E2E tests: add remaining tests to cover merchant checkout block flow / milestone [#45755](https://github.com/woocommerce/woocommerce/pull/45755)
* Dev - E2E tests: add test for merchant insert all woo blocks to page [#45896](https://github.com/woocommerce/woocommerce/pull/45896)
* Dev - E2E tests: fix command palette tests failing with Gutenberg installed [#46407](https://github.com/woocommerce/woocommerce/pull/46407)
* Dev - E2E tests: fixed flaky product creation test [#45884](https://github.com/woocommerce/woocommerce/pull/45884)
* Dev - E2E tests: fix locator in create order tests [#45983](https://github.com/woocommerce/woocommerce/pull/45983)
* Dev - E2E tests: fix tests that are failing with Gutenberg active [#46842](https://github.com/woocommerce/woocommerce/pull/46842)
* Dev - E2E tests: make payment page tests more resilient to theme changes [#45888](https://github.com/woocommerce/woocommerce/pull/45888)
* Dev - E2E tests: stabilize more tests [#45923](https://github.com/woocommerce/woocommerce/pull/45923)
* Dev - E2E tests: update the default theme to use twentytwentythree [#45937](https://github.com/woocommerce/woocommerce/pull/45937)
* Dev - Enable "Custom Fields" feature flag for by default #46832 [#46832](https://github.com/woocommerce/woocommerce/pull/46832)
* Dev - Enhance merchant new order test [#45965](https://github.com/woocommerce/woocommerce/pull/45965)
* Dev - Enhances the e2e tests for the marketing overview page [#45814](https://github.com/woocommerce/woocommerce/pull/45814)
* Dev - Enhance the merchant create order e2e tests [#45816](https://github.com/woocommerce/woocommerce/pull/45816)
* Dev - Fix a few flaky e2e tests [#46494](https://github.com/woocommerce/woocommerce/pull/46494)
* Dev - Fix daily e2e tests run setup [#46511](https://github.com/woocommerce/woocommerce/pull/46511)
* Dev - Fixes a bug introduced previously where enabling localStorage.xstateV5_inspect would cause the page to crash because it's not supposed to be used in prod builds. [#46109](https://github.com/woocommerce/woocommerce/pull/46109)
* Dev - Fix some flaky e2e tests [#45856](https://github.com/woocommerce/woocommerce/pull/45856)
* Dev - Fix template revert tests where the template is unreachable due to pagination. [#46373](https://github.com/woocommerce/woocommerce/pull/46373)
* Dev - Fix tests that were failing against HPOS environment setup. [#46242](https://github.com/woocommerce/woocommerce/pull/46242)
* Dev - Implement Lazy Loading inside ProductPage component #46399 [#46601](https://github.com/woocommerce/woocommerce/pull/46601)
* Dev - Include list of failed tests in Slack notifications [#46360](https://github.com/woocommerce/woocommerce/pull/46360)
* Dev - In k6 perf tests, add checks for the Shop page title and presence of product headers. [#46469](https://github.com/woocommerce/woocommerce/pull/46469)
* Dev - Move metrics job into ci.yml [#46471](https://github.com/woocommerce/woocommerce/pull/46471)
* Dev - Perf tests: fix environment setup issue [#46787](https://github.com/woocommerce/woocommerce/pull/46787)
* Dev - Remove a few unnecessary test annotations. [#45596](https://github.com/woocommerce/woocommerce/pull/45596)
* Dev - Remove periods at the end of section descriptions #46346 [#46346](https://github.com/woocommerce/woocommerce/pull/46346)
* Dev - Skip CYS header test. [#46217](https://github.com/woocommerce/woocommerce/pull/46217)
* Dev - Update @wordpress-env package to version 9.0.7 [#46177](https://github.com/woocommerce/woocommerce/pull/46177)
* Dev - Update copy of inventory management fields #45801 [#45801](https://github.com/woocommerce/woocommerce/pull/45801)
* Dev - Update core critical flows documentation [#46400](https://github.com/woocommerce/woocommerce/pull/46400)
* Dev - Update deprecated node 16 action to the latest in ci.yml [#46673](https://github.com/woocommerce/woocommerce/pull/46673)
* Dev - update makepot command to use include vs exclude [#46287](https://github.com/woocommerce/woocommerce/pull/46287)
* Dev - [CYS] Update footer and header test to not use snapshots. [#46221](https://github.com/woocommerce/woocommerce/pull/46221)
* Tweak - Adjusts the way refunds are displayed (including in emails), to make it clearer that the line item is indeed a refund. [#45455](https://github.com/woocommerce/woocommerce/pull/45455)
* Tweak - Change private methods to protected in ProductVariationTemplate [#46395](https://github.com/woocommerce/woocommerce/pull/46395)
* Tweak - CYS - AI flow: keep persisted query param when redirecting. [#46820](https://github.com/woocommerce/woocommerce/pull/46820)
* Tweak - Fix breadcrumb back icon color to follow the admin theme color. [#40106](https://github.com/woocommerce/woocommerce/pull/40106)
* Tweak - Fix the hover color in the reports page and star rating color in the dashboard widget. [#40243](https://github.com/woocommerce/woocommerce/pull/40243)
* Tweak - refactor: `woocommerce_rest_checkout_process_payment_error` returns a `400` response code, instead of `402`. [#45979](https://github.com/woocommerce/woocommerce/pull/45979)
* Tweak - Removed unused local variable 'discount_amount_html' to improve code clarity and efficiency. [#46437](https://github.com/woocommerce/woocommerce/pull/46437)
* Tweak - Removes unnecessary margin from Customer Account block label. [#45934](https://github.com/woocommerce/woocommerce/pull/45934)
* Tweak - Remove unneeded empty "Unknown" code handling in Order Attribution. [#46654](https://github.com/woocommerce/woocommerce/pull/46654)
* Tweak - Remove unused "No order source data available." message in Order Attribution feature. [#46648](https://github.com/woocommerce/woocommerce/pull/46648)
* Tweak - Rename "Origin" column to "Attribution" in Orders Analytics. [#46760](https://github.com/woocommerce/woocommerce/pull/46760)
* Tweak - Tewak Launch Your Store sidebar UI [#46449](https://github.com/woocommerce/woocommerce/pull/46449)
* Tweak - Tweaks Site visibility settings page' [#46365](https://github.com/woocommerce/woocommerce/pull/46365)
* Tweak - Updates Launch Your Store and Coming Soon Mode copy [#46668](https://github.com/woocommerce/woocommerce/pull/46668)
* Tweak - Use "Youre" in task list progress title [#45978](https://github.com/woocommerce/woocommerce/pull/45978)
* Tweak - WC_Discount: Add a filter for the items to apply coupons array. [#45791](https://github.com/woocommerce/woocommerce/pull/45791)
* Performance - Apply upstream performance improvement to _get_templates_paths [#45619](https://github.com/woocommerce/woocommerce/pull/45619)
* Performance - Avoid unnecessary query when HPOS compatibility mode is disabled. [#46616](https://github.com/woocommerce/woocommerce/pull/46616)
* Performance - Don't load REST API when generating possible routes. [#45134](https://github.com/woocommerce/woocommerce/pull/45134)
* Performance - Introduce vendor bundling to the blocks cart and checkout pages to improve performance. [#45859](https://github.com/woocommerce/woocommerce/pull/45859)
* Performance - [Performance] Don't load REST API when hydrating blocks requests. [#45134](https://github.com/woocommerce/woocommerce/pull/45134)
* Enhancement - Add filters to support adding custom search methods in HPOS admin and remember the last used search option [#45954](https://github.com/woocommerce/woocommerce/pull/45954)
* Enhancement - Add more translator context to ambiguous words [#46382](https://github.com/woocommerce/woocommerce/pull/46382)
* Enhancement - Adds support for co-branded credit cards [#45903](https://github.com/woocommerce/woocommerce/pull/45903)
* Enhancement - Don't show a product in the featured products block if the status is other than published and the user doesn't have read capability for that product. [#45763](https://github.com/woocommerce/woocommerce/pull/45763)
* Enhancement - Improve formatting for SE, LV, CZ, SK postcodes [#45478](https://github.com/woocommerce/woocommerce/pull/45478)
* Enhancement - Regenerate share key on the fly [#46662](https://github.com/woocommerce/woocommerce/pull/46662)
* Enhancement - Various UX improvements in HPOS CLI cleanup tool. [#45322](https://github.com/woocommerce/woocommerce/pull/45322)
= 8.8.5 2024-06-10 =
**WooCommerce**
* Security - Prevent HTML & JS injection attacks on registration and checkout forms when the Order Attribution is enabled. [#48348](https://github.com/woocommerce/woocommerce/pull/48348)
= 8.8.4 2024-06-04 =
**WooCommerce**
* Fix - Prevent tracking files from being enqueued on the front end. [#47938](https://github.com/woocommerce/woocommerce/pull/47938)
= 8.8.3 2024-04-29 =
* Update - Reverts auto-injecting specific Woo Blocks in every block theme and restores only auto-injecting in themes found in the allow list. [#46935](https://github.com/woocommerce/woocommerce/pull/46935)
@ -208,6 +721,14 @@
* Enhancement - Remove 'List price' and 'Sale price' fields from the General tab [#45495](https://github.com/woocommerce/woocommerce/pull/45495)
* Enhancement - Validate coupons with email restrictions upfront and change user's feedback when a coupon is not valid for the user. [#43872](https://github.com/woocommerce/woocommerce/pull/43872)
= 8.7.1 2024-06-04 =
**WooCommerce**
* Fix - Prevent tracking files from being enqueued on the front end. [#47938](https://github.com/woocommerce/woocommerce/pull/47938)
= 8.7.0 2024-03-01 =
**WooCommerce**
@ -402,6 +923,13 @@
* Enhancement - Product Collection: enable "Sync with query" option by default only for the first Product Catalog instance, disable for 2nd and next ones [#44577](https://github.com/woocommerce/woocommerce/pull/44577)
= 8.6.2 2024-06-04 =
**WooCommerce**
* Fix - Prevent tracking files from being enqueued on the front end. [#47938](https://github.com/woocommerce/woocommerce/pull/47938)
= 8.6.1 2024-02-20 =
**WooCommerce**
@ -581,6 +1109,13 @@
* Enhancement - Update WooPayments task copy [#43365](https://github.com/woocommerce/woocommerce/pull/43365)
= 8.5.3 2024-06-04 =
**WooCommerce**
* Fix - Prevent tracking files from being enqueued on the front end. [#47938](https://github.com/woocommerce/woocommerce/pull/47938)
= 8.5.2 2024-01-25 =
**WooCommerce**
@ -743,6 +1278,13 @@
* Enhancement - Update the pattern imageSizing to single. [#42767](https://github.com/woocommerce/woocommerce/pull/42767)
= 8.4.1 2024-06-04 =
**WooCommerce**
* Fix - Prevent tracking files from being enqueued on the front end. [#47938](https://github.com/woocommerce/woocommerce/pull/47938)
= 8.4.0 2023-12-12 =
**WooCommerce**
@ -891,6 +1433,13 @@
* Enhancement - Check if $data['billing_email'] is set in the create_order function. [#41098](https://github.com/woocommerce/woocommerce/pull/41098)
= 8.3.2 2024-06-04 =
**WooCommerce**
* Fix - Prevent tracking files from being enqueued on the front end. [#47938](https://github.com/woocommerce/woocommerce/pull/47938)
= 8.3.1 2023-11-21 =
**WooCommerce**
@ -1079,6 +1628,13 @@
* Enhancement - Hide "Preview" icon to other users when order is locked for edits. [#40730](https://github.com/woocommerce/woocommerce/pull/40730)
= 8.2.3 2024-06-04 =
**WooCommerce**
* Fix - Prevent tracking files from being enqueued on the front end. [#47938](https://github.com/woocommerce/woocommerce/pull/47938)
= 8.2.2 2023-11-08 =
**WooCommerce**
@ -1222,6 +1778,13 @@
* Enhancement - Update Venezuelan currency: Bolívar (Bs.). [#29380](https://github.com/woocommerce/woocommerce/pull/29380)
= 8.1.2 2024-06-04 =
**WooCommerce**
* Fix - Prevent tracking files from being enqueued on the front end. [#47938](https://github.com/woocommerce/woocommerce/pull/47938)
= 8.1.1 2023-09-18 =
**WooCommerce**
@ -1319,6 +1882,13 @@
* Enhancement - Update the admin's menu remaining tasks bubble CSS class and handling [#39273](https://github.com/woocommerce/woocommerce/pull/39273)
= 8.0.4 2024-06-04 =
**WooCommerce**
* Fix - Prevent tracking files from being enqueued on the front end. [#47938](https://github.com/woocommerce/woocommerce/pull/47938)
= 8.0.3 2023-08-29 =
* Update - Bump WooCommerce Blocks to 10.6.6. [#39853](https://github.com/woocommerce/woocommerce/pull/39853)
@ -1422,6 +1992,13 @@
* Enhancement - Refresh UX to enable HPOS to make it user friendly. [[#38993]](https://github.com/woocommerce/woocommerce/pull/38993)
= 7.9.1 2024-06-04 =
**WooCommerce**
* Fix - Prevent tracking files from being enqueued on the front end. [#47938](https://github.com/woocommerce/woocommerce/pull/47938)
= 7.9.0 2023-07-17 =
**WooCommerce**
@ -1556,6 +2133,13 @@
* Enhancement - Update product editor tour/guide copy and style. [[#38726]](https://github.com/woocommerce/woocommerce/pull/38726)
= 7.8.3 2024-06-04 =
**WooCommerce**
* Fix - Prevent tracking files from being enqueued on the front end. [#47938](https://github.com/woocommerce/woocommerce/pull/47938)
= 7.8.2 2023-07-04 =
**WooCommerce**

View File

@ -7,6 +7,10 @@ If you are unfamiliar with code and resolving potential conflicts, we have an ex
Custom code should be copied into your child theme's **functions.php** file.
## Note
Some parts of this document only applies to the shortcode Checkout, for adding fields to the Checkout block, consult [the additional checkout fields documentation](https://github.com/woocommerce/woocommerce/blob/trunk/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-block/additional-checkout-fields.md).
## How Are Checkout Fields Loaded to WooCommerce?
The billing and shipping fields for checkout pull from the countries class `class-wc-countries.php` and the **`get_address_fields`** function. This allows WooCommerce to enable/disable fields based on the user's location.

View File

@ -36,9 +36,9 @@ mysqladmin: CREATE DATABASE failed; error: 'Access denied for user 'wp'@'localho
To fix:
- Open MySQL with `sudo mysql`.
- Run `GRANT ALL PRIVILEGES ON * . * TO 'wp'@'localhost';`. Exit by typing `exit;`.
- Run the `install-wp-tests.sh` script again.
- Open MySQL with `sudo mysql`.
- Run `GRANT ALL PRIVILEGES ON * . * TO 'wp'@'localhost';`. Exit by typing `exit;`.
- Run the `install-wp-tests.sh` script again.
## Timeout / 404 errors while running e2e tests
@ -115,11 +115,3 @@ and set Chrome's log level "verbose" to checked.
5. All tests: `./vendor/bin/phpunit`
You might need to `composer install` if `phpunit` doesn't exist.
## Show the welcome modal again
Delete the option `woocommerce_task_list_welcome_modal_dismissed`:
```sql
DELETE FROM wp_options WHERE option_name = 'woocommerce_task_list_welcome_modal_dismissed'
```

View File

@ -97,7 +97,7 @@
"post_title": "Customizing checkout fields using actions and filters",
"tags": "code-snippet",
"edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/code-snippets/customising-checkout-fields.md",
"hash": "95cdfe40544c35e1918a56654d3fe2c42490b3b91ac10713cc1c005baa003686",
"hash": "8bbfe162402e484ae89427e1aedaed4faa57555b64b5a77ca800f701524314cb",
"url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/code-snippets/customising-checkout-fields.md",
"id": "83097d3b7414557fc80dcf9f8f1a708bbdcdd884"
},
@ -227,7 +227,7 @@
"menu_title": "Common issues",
"tags": "reference",
"edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/contributing/common-issues.md",
"hash": "9d8f0b78a0597ab22dce58e2b3707e3a08770bc22e2b901c0c6690928b1596bf",
"hash": "7c6e9eff5f207685b7bb106c4b91d25c72d991895e8bceb9a93458b354704198",
"url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/contributing/common-issues.md",
"id": "5766fb43cf9135d5a2cceaf0d386ec14b57c9ba0"
},
@ -309,7 +309,7 @@
"menu_title": "Integrating admin pages",
"tags": "how-to",
"edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/extension-development/working-with-woocommerce-admin-pages.md",
"hash": "9d01da78347ee7379fe096cce5e3982cd13e46617f90ad78e03af72bc3fb8aba",
"hash": "c172fff2814f552e2ab5712edb9e716f75c27946d993a1ade8f2269cc9a8689d",
"url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/extension-development/working-with-woocommerce-admin-pages.md",
"id": "6f9cc63bc4c614b9e01174069a5ddc4f3d7aa467"
},
@ -354,6 +354,14 @@
"url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/extension-development/logging.md",
"id": "c684e2efba45051a4e1f98eb5e6ef6bab194f25c"
},
{
"post_title": "Integrating with coming soon mode",
"tags": "how-to, coming-soon",
"edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/extension-development/integrating-coming-soon-mode.md",
"hash": "d702df70aff95e040624ffc6f9c8383ef98df2616a508e8ba2b031a9743de7e5",
"url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/extension-development/integrating-coming-soon-mode.md",
"id": "787743efb6ef0ad509b17735eaf58b2a9a08afbc"
},
{
"post_title": "Creating custom settings for WooCommerce extensions",
"menu_title": "Creating custom settings",
@ -432,6 +440,15 @@
"url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/extension-development/data-storage.md",
"id": "b3e0b17ca74596e858c26887c1e4c8ee6c8f6102"
},
{
"post_title": "How to create custom product tours",
"menu_title": "How to create custom product tours",
"tags": "how-to",
"edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/extension-development/creating-custom-product-tours.md",
"hash": "0c92334bb1ac4da6f3e60c9d8ad7fbe8e0854c4c808049ce116df1e4d6f70329",
"url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/extension-development/creating-custom-product-tours.md",
"id": "7b6e4726678c0280f050dba86b9f7ea1fc417dea"
},
{
"post_title": "Classes in WooCommerce",
"menu_title": "Classes in WooCommerce",
@ -459,6 +476,15 @@
"url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/extension-development/building-your-first-extension.md",
"id": "278c2822fe06f1ab72499a757ef0c4981cfbffb5"
},
{
"post_title": "How to add custom product types to Add Products onboarding list",
"menu_title": "Add custom product types to Add Products onboarding list",
"tags": "how-to",
"edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/extension-development/adding-custom-products-to-add-products-onboarding-list.md",
"hash": "60e50ef5d7e2ac6d0745c31031140df1dbb3c1b8724230cab1eaedebe3814688",
"url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/extension-development/adding-custom-products-to-add-products-onboarding-list.md",
"id": "747321d7fd2eb5c9c3351ea38374dfc80d3ec968"
},
{
"post_title": "How to add actions and filters",
"menu_title": "Add actions and filters",
@ -648,13 +674,39 @@
"menu_title": "Payment Gateway API",
"tags": "reference",
"edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/payments/payment-gateway-api.md",
"hash": "812b0beff6b99ca3ac54a896be7daf3c2baca79cc0ba6caa6010c5563c97bd8f",
"hash": "f199d04a262bac32d1e22eb3f8410d5c30f10fa86cbb303d4149363a44dc3562",
"url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/payments/payment-gateway-api.md",
"id": "b337203996650b567f91c70306e1010d6f1ae552"
}
],
"categories": []
},
{
"content": "\nThis section is dedicated to providing you with guides and best practices to optimize the performance of WooCommerce stores and extensions. Whether you're a store developer looking to enhance your site's speed and efficiency or an extension developer aiming to ensure your products contribute positively to store performance, you'll find valuable resources here to assist you.\n",
"category_slug": "performance",
"category_title": "Performance",
"posts": [
{
"post_title": "How to optimize performance for WooCommerce stores",
"menu_title": "Optimize store performance",
"tags": "reference",
"edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/performance/performance-optimization.md",
"hash": "25588fe2fab942f8db82a47d98594a3b0b6f35748185719b5c3b453876a9714b",
"url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/performance/performance-optimization.md",
"id": "7294890af7805de703ce7b3d4b55d3c56ff39186"
},
{
"post_title": "WooCommerce performance best practices",
"menu_title": "Performance best practices",
"tags": "reference",
"edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/performance/performance-best-practices.md",
"hash": "5af1f4e4085e85a1693390f40e238cbd6a4a0b7d5d304afdda935c34fed97c64",
"url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/performance/performance-best-practices.md",
"id": "35bda1cd7068d6179a9e46cca8d7dc2694d0df96"
}
],
"categories": []
},
{
"content": "\nDiscover how to customize the WooCommerce product editor, from extending product data to adding unique functionalities.\n\nThis handbook is a guide for extension developers looking to add support for the new product editor in their extensions. The product editor uses [Gutenberg's Block Editor](https://github.com/WordPress/gutenberg/tree/trunk/packages/block-editor), which is going to help WooCommerce evolve alongside the WordPress ecosystem.",
"category_slug": "product-editor",
@ -676,7 +728,7 @@
"post_title": "Product editor extensibility guidelines",
"menu_title": "Extensibility guidelines",
"edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/product-editor-development/product-editor-extensibility-guidelines.md",
"hash": "4e42c13decac01baccb57fa4f7542c3f14347ad60a53272a328bbc290e2a2625",
"hash": "8b6102ecab0ceda36afe6d7b2b12fd9d1e62c893ed7409d79cc15da8fc1e76c8",
"url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/product-editor-development/product-editor-extensibility-guidelines.md",
"id": "a837eb947d31fcff3c6e1f775926ba5eb13cd790"
},
@ -685,7 +737,7 @@
"menu_title": "Block template lifecycle",
"tags": "reference",
"edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/product-editor-development/block-template-lifecycle.md",
"hash": "8412c1fc634341ef4d4e81cd3212e368acca7e2c8c3ded15de1726cbec88424f",
"hash": "85c88e4c85786405b1eb0436b9e4e478c70ac4dd9ffd08f2a8db256b139ee290",
"url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/product-editor-development/block-template-lifecycle.md",
"id": "0c29c74a7e7e9fd88562df1afa489659f460879e"
}
@ -705,6 +757,15 @@
"url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/quality-and-best-practices/writing-high-quality-testing-instructions.md",
"id": "56a8ef0ef0afec9c884f655e7fdd23d9666c9d00"
},
{
"post_title": "Support and documentation for WooCommerce extensions",
"menu_title": "Support and documentation",
"tags": "reference",
"edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/quality-and-best-practices/support-and-documentation.md",
"hash": "48ec15e8c50c2fceea0bce267a52dcd7c740a9f1614773b10b6bab4a2e605a8c",
"url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/quality-and-best-practices/support-and-documentation.md",
"id": "c7ab700f5ab812a79b646a865caf429864becdb8"
},
{
"post_title": "Understanding the risks of removing URL bases in WooCommerce",
"menu_title": "Risks of removing URL bases",
@ -714,6 +775,18 @@
"url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/quality-and-best-practices/removing-product-product-category-or-shop-from-the-url.md",
"id": "827bfa56d40c2155542147ea5afe7cc756e18c5d"
},
{
"post_title": "Privacy Standards for WooCommerce Extensions",
"menu_title": "Privacy Standards",
"tags": "reference",
"edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/quality-and-best-practices/privacy-standards.md",
"hash": "44496b3d6244ea09c86b9d13fbefe9b77478311df25def6ae5e4e567a0e2bd6f",
"url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/quality-and-best-practices/privacy-standards.md",
"id": "840cf3001ed520ed206a42b147a2e3afa4ed82ae",
"links": {
"./gdpr-compliance.md": "af392a92b41b69b543c5ec77a07af770f6bb1587"
}
},
{
"post_title": "How to optimize performance for WooCommerce stores",
"menu_title": "Optimize store performance",
@ -735,6 +808,15 @@
"./css-sass-naming-conventions.md": "a34404f72868f2780ccf07da9b998204b8213d32"
}
},
{
"post_title": "Maintaining and updating WooCommerce extensions",
"menu_title": "Maintainability and updates",
"tags": "reference",
"edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/quality-and-best-practices/maintainability.md",
"hash": "6c1afab52dfab6998b87c4fac3acaba05ef516c4ff483b1ad46be13bc1b299c1",
"url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/quality-and-best-practices/maintainability.md",
"id": "828687b931d51c041ff4b4e0dc9a3a5b832b7ead"
},
{
"post_title": "WooCommerce grammar, punctuation and capitalization guide",
"menu_title": "Grammar, punctuation and capitalization",
@ -769,12 +851,21 @@
"url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/quality-and-best-practices/core-critical-flows.md",
"id": "e561b46694dba223c38b87613ce4907e4e14333a"
},
{
"post_title": "Compatibility and interoperability for WooCommerce extensions",
"menu_title": "Compatibility best practices",
"tags": "reference",
"edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/quality-and-best-practices/compatibility.md",
"hash": "c8e09923cffd4a3951dfc2db43823f9d469439775019104f687aa2c95caff142",
"url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/quality-and-best-practices/compatibility.md",
"id": "e3353f3e7a61bfd0f839d74c5baee2847b4b75d0"
},
{
"post_title": "WooCommerce coding standards",
"menu_title": "Coding standards",
"tags": "reference",
"edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/quality-and-best-practices/coding-standards.md",
"hash": "f23b9ab30de8af1356e92999d492ddb5bfb1303e88e64c4e58a26fbc9b93e6d4",
"hash": "7c5b8a0b555f81606fd6d2c85f62a00feaff369569666ba88d029fd384202f2f",
"url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/quality-and-best-practices/coding-standards.md",
"id": "b09a572b8a452b6cd795e0985daa85f06e5889fb"
}
@ -889,7 +980,7 @@
"categories": []
},
{
"content": "\nLearn to design and integrate custom themes in WooCommerce, focusing on responsive design and ecommerce optimization.\n",
"content": "\nLearn to design and integrate custom themes in WooCommerce, focusing on responsive design and ecommerce optimization.\n\nThis document was created for use when developing classic themes. Check this other document for [block theme development](../../plugins/woocommerce-blocks/docs/designers/theming/README.md).\n",
"category_slug": "theme-development",
"category_title": "Theme Development",
"posts": [
@ -913,28 +1004,35 @@
{
"post_title": "Template structure & Overriding templates via a theme",
"edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/theme-development/template-structure.md",
"hash": "e96f02bb6256e7f80bbe5bf5fa2b5006dd0d49cd67c8825414a64a6e34d0768a",
"hash": "6099b3a45f91390d9dd239f496eaf531be2b638c666858d6a066051ce915176a",
"url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/theme-development/template-structure.md",
"id": "34bfebec9fc45e680976814928a7b8a1778af14e"
"id": "34bfebec9fc45e680976814928a7b8a1778af14e",
"links": {
"../../plugins/woocommerce-blocks/docs/designers/theming/README.md": "64ff2179eb307d2bcd8d9736b3249ca56b77ba0c"
}
},
{
"post_title": "How to set up and use a child theme",
"menu_title": "Set up and use a child theme",
"tags": "how-to",
"edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/theme-development/set-up-a-child-theme.md",
"hash": "78e003139277d0e47b71921d64fd7c3225a8ada819f0989e1c0a605ac3d2e2f7",
"hash": "b362d5ddd34d8b81f6a2ee2369dd2cd68e51700836a85f96d629e87d564b0844",
"url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/theme-development/set-up-a-child-theme.md",
"id": "00b6916595cbde7766f080260a9ea26f53f3271c"
"id": "00b6916595cbde7766f080260a9ea26f53f3271c",
"links": {
"../../plugins/woocommerce-blocks/docs/designers/theming/README.md": "64ff2179eb307d2bcd8d9736b3249ca56b77ba0c"
}
},
{
"post_title": "Image sizing for theme developers",
"menu_title": "Image sizing",
"tags": "reference",
"edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/theme-development/image-sizes.md",
"hash": "c0c60cfd163c9fe935f1a6a8d1934eaf118668dd411212001f7f9f35a5cdcc8d",
"hash": "9883e7931ff8bd56dcd707974fe8ec992f21148818206aec354b0368dc999239",
"url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/theme-development/image-sizes.md",
"id": "3f5301ac3040d38bc449b440733da6a466209df3",
"links": {
"../../plugins/woocommerce-blocks/docs/designers/theming/README.md": "64ff2179eb307d2bcd8d9736b3249ca56b77ba0c",
"./thumbnail-image-regeneration.md": "733e1b16276d64f128ba0e337ca68ec3de0bf68f"
}
},
@ -960,9 +1058,12 @@
"post_title": "Classic theme development handbook",
"menu_title": "Classic theme development",
"edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/theme-development/classic-theme-developer-handbook.md",
"hash": "5b39b6db8ab9f08b8270e5803e19ee2abf6fc0fc6458780447fd8b24213d3100",
"hash": "1194437fbc2ec82d60c8b73a9742ec650bd90fe734758c3a2b27ed852d4d14f7",
"url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/theme-development/classic-theme-developer-handbook.md",
"id": "c2fde53e1dc3efbded3cfe1fb4df27136a3799a4"
"id": "c2fde53e1dc3efbded3cfe1fb4df27136a3799a4",
"links": {
"../../plugins/woocommerce-blocks/docs/designers/theming/README.md": "64ff2179eb307d2bcd8d9736b3249ca56b77ba0c"
}
}
],
"categories": []
@ -1123,7 +1224,7 @@
"post_title": "Product Editor Guidelines - Groups",
"menu_title": "Groups",
"edit_url": "https://github.com/woocommerce/woocommerce/edit/trunk/docs/ux-guidelines-product-editor/product-editor-form-groups.md",
"hash": "798c7cf96dd1a88be7a7763dae751dafa81acf0f0fba65a868d5ebe875ed75ea",
"hash": "70a01fcd0096461538f9071ea19c8c335f186c922b48e8c88a30fc874ce1cd81",
"url": "https://raw.githubusercontent.com/woocommerce/woocommerce/trunk/docs/ux-guidelines-product-editor/product-editor-form-groups.md",
"id": "03000dc9341d0d55a113c506e6e0bc87c98e3e1e",
"links": {
@ -1266,5 +1367,5 @@
"categories": []
}
],
"hash": "24c95fd5e28dc3e1fd03ffa495e1487bafc1dc8c3ffa91334f05ac2ea3b12e78"
"hash": "051ee4cdae51c1d92f1a5da2df9eafe45b32ce571b51bf6fe8d48f8dc29ff36d"
}

View File

@ -0,0 +1,76 @@
---
post_title: How to add custom product types to Add Products onboarding list
menu_title: Add custom product types to Add Products onboarding list
tags: how-to
---
## Introduction
WooCommerce allows developers to extend the product type onboarding list, offering a more customizable and engaging experience during the Add Products onboarding task. This tutorial will guide you through adding custom product types to your WooCommerce store using the `experimental_woocommerce_tasklist_product_types` JavaScript filter.
## Prerequisites
- A basic understanding of JavaScript and PHP.
- WooCommerce 8.8 or later installed on your WordPress site.
## Step 1: Adding a JavaScript Filter
To add a new product type to the onboarding list, we'll utilize the `@wordpress/hooks` package, specifically the addFilter function. If you're not already familiar, `@wordpress/hooks` allows you to modify or extend features within the WordPress and WooCommerce ecosystem without altering the core code.
First, ensure you have the `@wordpress/hooks` package installed. If not, you can add it to your project using `npm` or `yarn`:
`npm install @wordpress/hooks`
or:
`yarn add @wordpress/hooks`
Next, add the following JavaScript code to your project. This code snippet demonstrates how to add a "custom product" type to the onboarding list:
```javascript
/**
* External dependencies
*/
import { addFilter } from '@wordpress/hooks';
import { Icon, chevronRight } from '@wordpress/icons';
import { __ } from '@wordpress/i18n';
import FolderMultipleIcon from 'gridicons/dist/folder-multiple';
addFilter(
'experimental_woocommerce_tasklist_product_types',
'custom-product',
(productTypes) => [
...productTypes,
{
key: 'custom-product',
title: __('Custom product', 'custom-product'),
content: __('Create an awesome custom product.', 'custom-product'),
before: <FolderMultipleIcon />,
after: <Icon icon={chevronRight} />,
onClick: () => {
}
},
]
);
```
This filter adds a new product type called "Custom Product" with a brief description and icons before and after the title for a visually appealing presentation.
## Step 2: Optional - Customizing the onClick Handler
By default, if no onClick handler is supplied, the onboarding task will utilize the default CSV template handler. To customize this behavior, you can specify your own onClick handler within the product type object.
## Step 3: Modifying the CSV Template Path (Optional)
If you wish to use a different CSV template for your custom product type, you can modify the template path using the woocommerce_product_template_csv_file_path filter in PHP. Here's an example of how to change the template path:
```php
add_filter('woocommerce_product_template_csv_file_path', function($path) {
// Specify your custom template path here
return $newPath;
});
```
## Conclusion
With WooCommerce, extending the product type onboarding list is straightforward and offers significant flexibility for customizing the onboarding experience. By following the steps outlined in this tutorial, you can enhance your WooCommerce store and make the Add Products task more relevant and helpful to your specific needs.

View File

@ -0,0 +1,77 @@
---
post_title: How to create custom product tours
menu_title: How to create custom product tours
tags: how-to
---
## Introduction
WooCommerce allows developers to extend or replace the product tour, offering a more customizable and engaging experience during product creation. This tutorial will guide you through adding a custom product tour to your WooCommerce store using the `experimental_woocommerce_admin_product_tour_steps` JavaScript filter.
This works in conjunction with the ability to customize the product type onboarding list.
## Prerequisites
- A basic understanding of JavaScript and PHP.
- WooCommerce 8.8 or later installed on your WordPress site.
## Adding a JavaScript Filter
To alter or create a product tour, we'll utilize the `@wordpress/hooks` package, specifically the `addFilter` function. If you're not already familiar, `@wordpress/hooks` allows you to modify or extend features within the WordPress and WooCommerce ecosystem without altering the core code.
First, ensure you have the `@wordpress/hooks` package installed. If not, you can add it to your project using `npm` or `yarn`:
`npm install @wordpress/hooks`
or:
`yarn add @wordpress/hooks`
Next, add the following JavaScript code to your project. This code snippet demonstrates how to replace the product tour with an entire custom one:
```javascript
/**
* External dependencies
*/
import { addFilter } from '@wordpress/hooks';
import { __ } from '@wordpress/i18n';
addFilter(
experimental_woocommerce_admin_product_tour_steps,
'custom-product',
(tourSteps, tourType) => {
if ('custom-product' !== tourType) {
return tourSteps;
}
return [
{
referenceElements: {
desktop: '#title',// The element to highlight
},
focusElement: {
desktop: '#title',// A form element to be focused
},
meta: {
name: 'product-name', // Step name
heading: __( 'Product name', 'custom-product' ),
descriptions: {
desktop: __(
'Start typing your new product name here. This will be what your customers will see in your store.',
'custom-product'
),
},
},
},
];
}
);
```
This filter replaces the entire product tour for a `custom-product` product type. Using built-in JavaScript array manipulation functions, you can also customize the default tour (by altering, adding, or removing steps).
The `tourType` is set by the `tutorial_type` GET parameter.
## Conclusion
With WooCommerce, extending and customizing the product tour is straightforward and offers significant flexibility for customizing the onboarding experience. By following the steps outlined in this tutorial, you can enhance your WooCommerce store and make the Add Products tour more relevant and helpful to your specific needs.

View File

@ -0,0 +1,136 @@
---
post_title: Integrating with coming soon mode
tags: how-to, coming-soon
---
This guide provides examples for third-party developers and hosting providers on how to integrate their systems with WooCommerce's coming soon mode. For more details, please read the [developer blog post](https://developer.woocommerce.com/2024/06/18/introducing-coming-soon-mode/).
## Introduction
WooCommerce's coming soon mode allows you to temporarily make your site invisible to the public while you work on it. This guide will show you how to integrate this feature with your system, clear server cache when site visibility settings change, and sync coming soon mode with other plugins.
## Prerequisites
- Familiarity with PHP and WordPress development.
## Step-by-step instructions
### Clear server cache on site visibility settings change
When the site's visibility settings change, it may be necessary to clear a server cache to apply the changes and re-cache customer-facing pages. The [`update_option`](https://developer.wordpress.org/reference/hooks/update_option/) hook can be used to achieve this.
```php
add_action( 'update_option_woocommerce_coming_soon', 'clear_server_cache', 10, 3 );
add_action( 'update_option_woocommerce_store_pages_only', 'clear_server_cache', 10, 3 );
function clear_server_cache( $old_value, $new_value, $option ) {
// Implement your logic to clear the server cache.
if ( function_exists( 'your_cache_clear_function' ) ) {
your_cache_clear_function();
}
}
```
### Syncing coming soon mode with other plugins
The coming soon mode can be programmatically synced from a plugin or application. Here are some example use cases:
- Integrating with a maintenance mode plugin.
- Integrating with a hosting provider's coming soon mode.
#### Trigger from WooCommerce
You can use the following example to run a code such as setting your plugin's status when coming soon mode option is updated:
```php
add_action( 'update_option_woocommerce_coming_soon', 'sync_coming_soon_to_other_plugins', 10, 3 );
function sync_coming_soon_to_other_plugins( $old_value, $new_value, $option ) {
$is_enabled = $new_value === 'yes';
// Implement your logic to sync coming soon status.
if ( function_exists( 'set_your_plugin_status' ) ) {
set_your_plugin_status( $is_enabled );
}
}
```
#### Trigger from other plugins
You can use the following example to enable or disable WooCommerce coming soon mode from another plugin by directy updating `woocommerce_coming_soon` option:
```php
function sync_coming_soon_from_other_plugins( $is_enabled ) {
// Check user capability.
if ( ! current_user_can( 'manage_options' ) ) {
wp_die( 'You do not have sufficient permissions to access this page.' );
}
// Set coming soon mode.
if ( isset( $is_enabled ) ) {
update_option( 'woocommerce_coming_soon', $is_enabled ? 'yes' : 'no' );
}
}
```
#### 2-way sync with plugins
If 2-way sync is needed, use the following example where `update_option` will not recursively call `sync_coming_soon_from_other_plugins`:
```php
add_action( 'update_option_woocommerce_coming_soon', 'sync_coming_soon_to_other_plugins', 10, 3 );
function sync_coming_soon_to_other_plugins( $old_value, $new_value, $option ) {
$is_enabled = $new_value === 'yes';
// Implement your logic to sync coming soon status.
if ( function_exists( 'set_your_plugin_status' ) ) {
set_your_plugin_status( $is_enabled );
}
}
function sync_coming_soon_from_other_plugins( $is_enabled ) {
// Check user capability.
if ( ! current_user_can( 'manage_options' ) ) {
wp_die( 'You do not have sufficient permissions to access this page.' );
}
if ( isset( $is_enabled ) ) {
// Temporarily remove the action to prevent a recursive call.
remove_action( 'update_option_woocommerce_coming_soon', 'sync_coming_soon_to_other_plugins', 10, 3 );
// Set coming soon mode.
update_option( 'woocommerce_coming_soon', $is_enabled ? 'yes' : 'no' );
// Re-add the action.
add_action( 'update_option_woocommerce_coming_soon', 'sync_coming_soon_to_other_plugins', 10, 3 );
}
}
```
### Custom exclusions filter
It is possible for developers to add custom exclusions that bypass the coming soon protection. This is useful for exclusions like always bypassing the screen on a specific IP address, or making a specific landing page available.
#### Disabling coming soon in all pages
If there is another feature that behaves similarly to WooCommerce's coming soon mode, it can cause unintended conflicts. The coming soon mode can be disabled by excluding all customer-facing pages. The following is an example:
```php
add_filter( 'woocommerce_coming_soon_exclude', function() {
return true;
}, 10 );
```
#### Disabling coming soon except for a specific page
Use the following example to exclude a certain page based on the page's ID. Replace `<page-id>` with your page identifier:
```php
add_filter( 'woocommerce_coming_soon_exclude', function( $is_excluded ) {
if ( get_the_ID() === <page-id> ) {
return true;
}
return $is_excluded;
}, 10 );
```

View File

@ -48,7 +48,7 @@ If your extension adds new pages with tabs or subsections, be sure to use the `w
You can also use the `wc_admin_current_screen_id` filter to make any changes necessary to the screen ID generation behavior.
## Registering a Rect-powered page
## Registering a React-powered page
To register a React-powered page, use the [`wc_admin_register_page()`](https://woocommerce.github.io/code-reference/namespaces/default.html#function_wc_admin_register_page) function. It accepts an array of arguments:

View File

@ -19,7 +19,7 @@ Form and iFrame based gateways post data offsite, meaning there are less securit
## Creating a basic payment gateway
**Note:** The instructions below are for the default Checkout page. If you're looking to add a custom payment method for the new Checkout block, check out [this documentation.](https://github.com/woocommerce/woocommerce-blocks/blob/trunk/docs/third-party-developers/extensibility/checkout-payment-methods/payment-method-integration.md)
**Note:** The instructions below are for the default Checkout page. If you're looking to add a custom payment method for the new Checkout block, check out [the payment method integration documentation](https://github.com/woocommerce/woocommerce/blob/trunk/plugins/woocommerce-blocks/docs/third-party-developers/extensibility/checkout-payment-methods/payment-method-integration.md).
Payment gateways should be created as additional plugins that hook into WooCommerce. Inside the plugin, you need to create a class after plugins are loaded. Example:

View File

@ -0,0 +1,7 @@
---
category_title: Performance
category_slug: performance
post_title: Performance
---
This section is dedicated to providing you with guides and best practices to optimize the performance of WooCommerce stores and extensions. Whether you're a store developer looking to enhance your site's speed and efficiency or an extension developer aiming to ensure your products contribute positively to store performance, you'll find valuable resources here to assist you.

View File

@ -0,0 +1,42 @@
---
post_title: WooCommerce performance best practices
menu_title: Performance best practices
tags: reference
---
# Performance Best Practices for WooCommerce Extensions
Optimizing the performance of WooCommerce extensions is vital for ensuring that online stores run smoothly, provide a superior user experience, and rank well in search engine results. This guide is tailored for developers looking to enhance the speed and efficiency of their WooCommerce extensions, with a focus on understanding performance impacts, benchmarking, testing, and implementing strategies for improvement.
## Performance Optimization
For WooCommerce extensions, performance optimization means ensuring that your code contributes to a fast, responsive user experience without adding unnecessary load times or resource usage to the store.
### Why Performance is Critical
- **User Experience**: Fast-performing extensions contribute to a seamless shopping experience, encouraging customers to complete purchases.
- **Store Performance**: Extensions can significantly impact the overall speed of WooCommerce stores; optimized extensions help maintain optimal site performance.
- **SEO and Conversion Rates**: Speed is a critical factor for SEO rankings and conversion rates. Efficient extensions support better store rankings and higher conversions.
## Benchmarking Performance
Setting clear performance benchmarks is essential for development and continuous improvement of WooCommerce extensions. A recommended performance standard is achieving a Chrome Core Web Vitals "Performance" score of 90 or above on Woo Express, using tools like the [Chrome Lighthouse](https://developer.chrome.com/docs/lighthouse/overview/).
### Using Accessible Tools for Benchmarking
Chrome Lighthouse provides a comprehensive framework for evaluating the performance of web pages, including those impacted by your WooCommerce extension. By integrating Lighthouse testing into your development workflow, you can identify and address performance issues early on.
We recommend leveraging tools like this to assess the impact of your extension on a WooCommerce store's performance and to identify areas for improvement.
## Performance Improvement Strategies
Optimizing the performance of WooCommerce extensions can involve several key strategies:
- **Optimize Asset Loading**: Ensure that scripts and styles are loaded conditionally, only on pages where they're needed.
- **Efficient Database Queries**: Optimize database interactions to minimize query times and resource usage. Use indexes appropriately and avoid unnecessary data retrieval.
- **Lazy Loading**: Implement lazy loading for images and content loaded by your extension to reduce initial page load times.
- **Minification and Concatenation**: Minify CSS and JavaScript files and concatenate them where possible to reduce the number of HTTP requests.
- **Testing with and without Your Extension**: Regularly test WooCommerce stores with your extension activated and deactivated to clearly understand its impact on performance.
- **Caching Support**: Ensure your extension is compatible with popular caching solutions, and avoid actions that might bypass or clear cache unnecessarily.
By following these best practices and regularly benchmarking and testing your extension, you can ensure it enhances, rather than detracts from, the performance of WooCommerce stores. Implementing these strategies will lead to more efficient, faster-loading extensions that store owners and their customers will appreciate.

View File

@ -0,0 +1,93 @@
---
post_title: How to optimize performance for WooCommerce stores
menu_title: Optimize store performance
tags: reference
---
## Introduction
This guide covers best practices and techniques for optimizing the performance of WooCommerce stores, including caching, image optimization, database maintenance, code minification, and the use of Content Delivery Networks (CDNs). By following these recommendations, developers can build high-performing WooCommerce stores that provide a better user experience and contribute to higher conversion rates.
## Audience
This guide is intended for developers who are familiar with WordPress and WooCommerce and want to improve the performance of their online stores.
## Prerequisites
To follow this guide, you should have:
1. A basic understanding of WordPress and WooCommerce.
2. Access to a WordPress website with WooCommerce installed and activated.
## Step 1 - Implement caching
Caching plays a crucial role in speeding up your WooCommerce store by serving static versions of your pages to visitors, reducing the load on your server. There are several ways to implement caching for your WooCommerce store:
### Server-Side caching
Enable server-side caching through your hosting provider or by using server-level caching solutions like Varnish, NGINX FastCGI Cache, or Redis.
### WordPress caching plugins
Install and configure a WordPress caching plugin, such as WP Rocket, W3 Total Cache, or WP Super Cache. These plugins can help you set up page caching, browser caching, and object caching for your WooCommerce store.
### WooCommerce-Specific caching
Ensure that your caching solution is configured correctly for WooCommerce, allowing dynamic content such as cart and checkout pages to remain uncached. Some caching plugins, like WP Rocket, include built-in support for WooCommerce caching.
## Step 2 - Optimize images
Optimizing images can significantly improve your store's performance by reducing the size of image files without compromising quality. To optimize images for your WooCommerce store:
1. Use the right image format: Choose an appropriate format for your images, such as JPEG for photographs and PNG for graphics with transparency.
2. Compress images: Use an image compression tool like TinyPNG or ShortPixel to reduce file sizes before uploading them to your store.
3. Enable lazy loading: Lazy loading delays the loading of images until they're needed, improving initial page load times. Many caching plugins and performance optimization plugins offer built-in lazy loading options.
4. Use responsive images: Ensure that your theme and plugins serve appropriately sized images for different devices and screen resolutions.
## Step 3 - Minify and optimize code
Minifying and optimizing your store's HTML, CSS, and JavaScript files can help reduce file sizes and improve page load times. To minify and optimize code for your WooCommerce store:
1. Use a plugin: Install a performance optimization plugin like Autoptimize, WP Rocket, or W3 Total Cache to minify and optimize your store's HTML, CSS, and JavaScript files.
2. Combine and inline critical CSS: Where possible, combine and inline critical CSS to reduce the number of requests and improve page load times.
3. Defer non-critical JavaScript: Defer loading of non-critical JavaScript files to improve perceived page load times.
## Step 4 - Use a content delivery network (CDN)
A Content Delivery Network (CDN) can help speed up your WooCommerce store by serving static assets like images, CSS, and JavaScript files from a network of servers distributed across the globe. To use a CDN for your WooCommerce store:
1. Choose a CDN provider: Select a CDN provider like Cloudflare, Fastly, or Amazon CloudFront that fits your needs and budget.
2. Set up your CDN: Follow your chosen CDN provider's instructions to set up and configure the CDN for your WooCommerce store.
## Step 5 - Optimize database
Regularly optimizing your WordPress database can help improve your WooCommerce store's performance by removing unnecessary data and optimizing database tables. To optimize your database:
1. Use a plugin: Install a database optimization plugin like WP-Optimize, WP-Sweep, or Advanced Database Cleaner to clean up and optimize your WordPress database.
2. Remove unnecessary data: Regularly delete spam comments, post revisions, and expired transients to reduce database clutter.
3. Optimize database tables: Use the database optimization plugin to optimize your database tables, improving their efficiency and reducing query times.
## Step 6 - Choose a high-performance theme and plugins
The theme and plugins you choose for your WooCommerce store can have a significant impact on performance. To ensure your store runs efficiently:
1. Select a lightweight, performance-optimized theme: Choose a theme specifically designed for WooCommerce that prioritizes performance and follows best coding practices.
2. Evaluate plugin performance: Use tools like Query Monitor or WP Hive to analyze the performance impact of the plugins you install, and remove or replace those that negatively affect your store's performance.
## Step 7 - Enable GZIP compression
GZIP compression can help reduce the size of your store's HTML, CSS, and JavaScript files, leading to faster page load times. To enable GZIP compression:
1. Use a plugin: Install a performance optimization plugin like WP Rocket, W3 Total Cache, or WP Super Cache that includes GZIP compression options.
2. Configure your server: Alternatively, enable GZIP compression directly on your server by modifying your .htaccess file (for Apache servers) or nginx.conf file (for NGINX servers).
## Step 8 - Monitor and analyze performance
Continuously monitor and analyze your WooCommerce store's performance to identify potential bottlenecks and areas for improvement. To monitor and analyze performance:
1. Use performance testing tools: Regularly test your store's performance using tools like Google PageSpeed Insights, GTmetrix, or WebPageTest.
2. Implement performance monitoring: Install a performance monitoring plugin like New Relic or use a monitoring service like Uptime Robot to keep track of your store's performance over time.
## Conclusion
By following these best practices and techniques for performance optimization, you can build a high-performing WooCommerce store that offers a better user experience and contributes to higher conversion rates. Continuously monitor and analyze your store's performance to ensure it remains optimized as your store grows and evolves.

View File

@ -49,10 +49,10 @@ You can modify template instances in a hook for the following action:
The following actions are fired when blocks are added to or removed from a template, to support extensibility:
- `woocommerce_product_editor_block_template_{template_name}_after_add_block_{block_id}`
- `woocommerce_product_editor_block_template_after_add_block`
- `woocommerce_product_editor_block_template_{template_name}_after_remove_block_{block_id}`
- `woocommerce_product_editor_block_template_after_remove_block`
- `woocommerce_block_template_area_{template_area_name}_after_add_block_{block_id}`
- `woocommerce_block_template_after_add_block`
- `woocommerce_block_template_area_{template_area_name}_after_remove_block_{block_id}`
- `woocommerce_block_template_after_remove_block`
**In order for your action hooks to be called for all block additions and removals for a template, you should call `add_action()` for each of these hooks before the template is instantiated, in or before an `rest_api_init` action hook, priority 9 or lower. If your hooks are not being called, verify that you are hooking them up in an action that is called when REST API endpoints are called.**
@ -60,7 +60,7 @@ See the [Automattic\WooCommerce\Admin\BlockTemplates](https://github.com/woocomm
## Sent to client
A template is sent to the client in the handler for the `/wcv3/layout-templates` REST API endpoint, after the `rest_request_before_callbacks` filter hook.
A template is sent to the client in the handler for the `/wc/v3/layout-templates` REST API endpoint, after the `rest_request_before_callbacks` filter hook.
Any template modification after this point will not be sent to the client.

View File

@ -11,31 +11,31 @@ For this reason, the new product form features groups (tabs) that correspond wit
There are several ways to extend the new product form: from a single field to a whole group or section containing multiple fields and tables. These extension points are linked to the form structure, giving you plenty of freedom to create a great user experience.
- Product form
- Group
- Section
- Subsection
- Field
- Field
- ...
- Subsection
- Field
- Field
- ...
- ...
- Section
- Subsection
- Field
- Field
- ...
- Subsection
- Field
- Field
- ...
- ...
- ...
- Group
...
- Product form
- Group
- Section
- Subsection
- Field
- Field
- ...
- Subsection
- Field
- Field
- ...
- ...
- Section
- Subsection
- Field
- Field
- ...
- Subsection
- Field
- Field
- ...
- ...
- ...
- Group
...
Like everything in the new product form, each extension point is a separate block. For the sake of a consistent and smooth user experience, try to integrate your extension into an existing group or section before creating a new one.
@ -47,12 +47,12 @@ The new product form consists of groups currently displayed as tabs. Each is a s
If a tab doesn't contain any sections, it won't be shown to merchants.
- **General:** Essential product information, including the name, image, and description. This tab is also where key features live for non-standard product types: downloads, groups, links, etc.
- **Organization:** This tab contains all the data used to organize and categorize product information: from categories to attributes. Best for extensions that provide new ways to describe products, e.g., product identifiers, statuses, special tags, etc.
- **Pricing:** List price, sale price, and tax options. Best for extensions that allow merchants to set up additional payment methods (e.g., Subscriptions) or add advanced pricing schemes, like wholesale.
- **Inventory:** Basic inventory settings and stock management options. Here merchants come to update the quantity at hand or mark the product as out of stock. Best for extensions that enable conditional inventory management, dropshipping options, or various restrictions.
- **Shipping:** All the information merchants need to enter to present customers with accurate shipping rates at checkout. Best for physical product details that may impact shipping (e.g. capacity or volume), additional shipping carrier settings, or custom shipping options.
- **Variations:** Contains variation options and product variations.
- **General:** Essential product information, including the name, image, and description. This tab is also where key features live for non-standard product types: downloads, groups, links, etc.
- **Organization:** This tab contains all the data used to organize and categorize product information: from categories to attributes. Best for extensions that provide new ways to describe products, e.g., product identifiers, statuses, special tags, etc.
- **Pricing:** Regular price, sale price, and tax options. Best for extensions that allow merchants to set up additional payment methods (e.g., Subscriptions) or add advanced pricing schemes, like wholesale.
- **Inventory:** Basic inventory settings and stock management options. Here merchants come to update the quantity at hand or mark the product as out of stock. Best for extensions that enable conditional inventory management, dropshipping options, or various restrictions.
- **Shipping:** All the information merchants need to enter to present customers with accurate shipping rates at checkout. Best for physical product details that may impact shipping (e.g. capacity or volume), additional shipping carrier settings, or custom shipping options.
- **Variations:** Contains variation options and product variations.
Custom product types manage the visibility of the default groups and add new ones. This is particularly useful if a custom product has a unique structure and requires extra information that isn't included in the default groups.
@ -68,11 +68,11 @@ See the guide below for some practical examples.
#### Product code extension
##### What it does
##### What code extension does
The extension allows merchants to enter a product identifier, such as ISBN, EAN, or UPC.
##### Our recommendations
##### Our recommendations about code extension
The identifier is a single piece of information that helps merchants describe and categorize the product across their store and other sales channels. It's best suited to be added as a field in the Product catalog section in the Organization group.
@ -80,11 +80,11 @@ The identifier is a single piece of information that helps merchants describe an
#### Ticket extension
##### What it does
##### What ticket extension does
Merchants can set up and sell tickets with advanced settings, such as unique input fields, expiration dates, restrictions, tiers, and more.
##### Our recommendations
##### Our recommendations about ticket extension
With so much advanced functionality, the plugin would best register a new product type and define the structure and appearance of the product form. This could include the tabs at the top of the screen, the subgroups and sections inside, and the default values.
@ -96,24 +96,24 @@ With so much advanced functionality, the plugin would best register a new produc
Fields are the simplest type of extension. They let users add extra product information, replace or manage the visibility of other fields assigned to a specific product type, and control the contents of other fields.
**What they *are* for:**
**What they _are_ for:**
- Single-field, supplementary features
- Showing or hiding form elements depending on specific conditions
- Single-field, supplementary features
- Showing or hiding form elements depending on specific conditions
**What they *aren't* for:**
**What they _aren't_ for:**
- Multi-field or multi-step forms
- Complex tables, e.g., permissions, restrictions, shipping volumes, etc
- Embedded third-party experiences and websites
- Multi-field or multi-step forms
- Complex tables, e.g., permissions, restrictions, shipping volumes, etc
- Embedded third-party experiences and websites
Field extensions should always be logically related to the form area they are in. For example, if you're building a dropshipping extension, your warehouse selection field should live in the first section of the Inventory group. To ensure an excellent experience for our merchants, we do not recommend placing it in a separate group, section, or subsection.
**Other use cases include:**
- Adding extra product details, f.e. volume under Shipping
- Entering custom data, f.e. color or date and time
- Selecting from a third-party system, f.e. warranty type
- Adding extra product details, f.e. volume under Shipping
- Entering custom data, f.e. color or date and time
- Selecting from a third-party system, f.e. warranty type
### Subsections
@ -121,17 +121,17 @@ Field extensions should always be logically related to the form area they are in
Subsections add extra fields to existing form groups. They are small forms with a low to medium level of complexity. This interface location works best for extensions that add extra features that build off an existing Woo functionality.
**What they *are* for:**
**What they _are_ for:**
- Relevant features that can be crucial to merchants' product creation flow
- 2-5 field forms with simple functionality, e.g., dimensions or tax settings
- Lists of items, e.g., attachments, channels, or accounts
- Relevant features that can be crucial to merchants' product creation flow
- 2-5 field forms with simple functionality, e.g., dimensions or tax settings
- Lists of items, e.g., attachments, channels, or accounts
**What they *aren't* for:**
**What they _aren't_ for:**
- Simple extensions with 1-2 fields
- Multi-step forms and complex tables
- Read-only descriptions, setup guides, and advertisements
- Simple extensions with 1-2 fields
- Multi-step forms and complex tables
- Read-only descriptions, setup guides, and advertisements
**Example:**
@ -139,9 +139,9 @@ If you're developing an extension that allows merchants to upload 360 images or
**Other use cases include:**
- Adding extra product details, e.g., measurements under Shipping
- Setting up social channels in the Visibility section in the General tab
- Changing the VAT tax settings in the Pricing tab
- Adding extra product details, e.g., measurements under Shipping
- Setting up social channels in the Visibility section in the General tab
- Changing the VAT tax settings in the Pricing tab
### Sections
@ -149,17 +149,17 @@ If you're developing an extension that allows merchants to upload 360 images or
Sections are significant parts of the form that may consist of multiple subsections and fields. They should be used sparsely throughout the form, so merchants are not overwhelmed with options while filling out the information about their products.
**What they *are* for:**
**What they _are_ for:**
- Complex forms with multiple fields, tables, and list items
- Standalone features that don't build off of anything else
- Extensions that rely on user-created items, such as tags or attributes
- Complex forms with multiple fields, tables, and list items
- Standalone features that don't build off of anything else
- Extensions that rely on user-created items, such as tags or attributes
**What they *aren't* for:**
**What they _aren't_ for:**
- Simple extensions with 1-2 fields
- Read-only descriptions, setup guides, and advertisements
- Multi-step setup wizards and external content
- Simple extensions with 1-2 fields
- Read-only descriptions, setup guides, and advertisements
- Multi-step setup wizards and external content
**Example:**
@ -167,11 +167,11 @@ If you're working on an extension that allows merchants to offer discounts based
**Other use cases include:**
- Adding product labels with a robust interactive preview
- Managing product warranty options
- Creating product packages and bundles
- Adding product labels with a robust interactive preview
- Managing product warranty options
- Creating product packages and bundles
### Top bar (header) *(future feature)*
### Top bar (header) _(future feature)_
![Top bar example](https://developer.woocommerce.com/wp-content/uploads/2023/12/product-editor-ext-guidelines-top-bar.png)
@ -181,13 +181,13 @@ Each top bar extension has its unique icon in the top navigation bar. Note that
For example, top bar extensions can be used to:
- Provide product scheduling or extra visibility options,
- Let merchants view additional SEO metadata
- Offer easy access to documentation or step-by-step guides
- Provide product scheduling or extra visibility options,
- Let merchants view additional SEO metadata
- Offer easy access to documentation or step-by-step guides
Depending on their roles, top bar extensions can be displayed in either a **popover** or a **modal**.
### Dialog extensions *(future feature)*
### Dialog extensions _(future feature)_
![Dialog example](https://developer.woocommerce.com/wp-content/uploads/2023/12/product-editor-ext-guidelines-dialog-extensions.png)
@ -195,23 +195,23 @@ Dialog extensions differ from other extensions as they are unrelated to any sect
Dialogs can have different sizes (small, medium, large, or custom) and trigger locations (text or icon button anywhere in the form or in the form's top bar).
**What they *are* for:**
**What they _are_ for:**
- Focused experiences that require taking over most of the screen
- Advanced configuration and setup flows
- Dedicated content embedded from a third-party service
- Focused experiences that require taking over most of the screen
- Advanced configuration and setup flows
- Dedicated content embedded from a third-party service
**What they *aren't* for:**
**What they _aren't_ for:**
- Single-field features or simple settings screens
- Small functionalities that could fit within the form
- Onboarding experiences, product demos, and advertisements
- Single-field features or simple settings screens
- Small functionalities that could fit within the form
- Onboarding experiences, product demos, and advertisements
**Example use cases:**
- Third-party fulfillment, warehousing, and accounting service integration
- Robust image editing tool with complex interactions
- Media-heavy knowledge base with plenty of videos and interactive tutorials
- Third-party fulfillment, warehousing, and accounting service integration
- Robust image editing tool with complex interactions
- Media-heavy knowledge base with plenty of videos and interactive tutorials
## Custom product types
@ -219,15 +219,14 @@ Custom product types allow you to design a custom form and completely control it
With custom product types, you can:
- Add, hide, and reorder groups
- Add and hide sections within a group
- Add and hide subsections and fields
- Includes core fields
- Can be set up conditionally based on a custom field's value
- Add, hide, and reorder groups
- Add and hide sections within a group
- Add and hide subsections and fields
- Includes core fields
- Can be set up conditionally based on a custom field's value
Custom product types include niche and specific use cases, such as bookings, tickets, gift cards, rentals, etc. Here's when we suggest you should consider creating a custom product type:
- Your extension consists of several different form sections scattered across several different tabs
- Using just your extension, merchants can completely a product
- You want to help merchants create products faster and automate some of their work
- Your extension consists of several different form sections scattered across several different tabs
- Using just your extension, merchants can completely a product
- You want to help merchants create products faster and automate some of their work

View File

@ -4,11 +4,14 @@ menu_title: Coding standards
tags: reference
---
## Position of hooks
Adhering to WooCommerce coding standards is essential for maintaining high code quality, ensuring compatibility, and facilitating easier maintenance and updates. This document outlines the recommended coding practices for developers working within the WooCommerce ecosystem, including the use of hooks, function prefixing, translatable texts, and code structure.
Position hooks below the function call, as this follows the common pattern in the WordPress and WooCommerce ecosystem.
### Example
## Position of Hooks
Position hooks below the function call to align with the common pattern in the WordPress and WooCommerce ecosystem.
Example:
```php
/**
@ -22,9 +25,9 @@ add_action( 'wp_footer', 'YOUR_PREFIX_custom_message' );
## Prefixing function calls
Use a consistent prefix for all function calls. For the code snippets in this repo, use the prefix `YOUR_PREFIX`.
Use a consistent prefix for all function calls to avoid conflicts. For the code snippets in this repo, use `YOUR_PREFIX`.
### Example
Example:
```php
/**
@ -38,13 +41,13 @@ add_filter( 'woocommerce_product_get_price', 'YOUR_PREFIX_custom_discount', 10,
## Translatable texts and text domains
Make all plain texts translatable, and use a consistent text domain. This aligns with the best practices for internationalisation. For the code snippets in this repo, use the textdomain `YOUR-TEXTDOMAIN`.
Ensure all plain texts are translatable and use a consistent text domain, adhering to internationalization best practices. For the code snippets in this repo, use the textdomain `YOUR-TEXTDOMAIN`.
### Example
Example:
```php
/**
* Add custom message.
* Add welcome message.
*/
function YOUR_PREFIX_welcome_message() {
echo __( 'Welcome to our website', 'YOUR-TEXTDOMAIN' );
@ -54,9 +57,9 @@ add_action( 'wp_footer', 'YOUR_PREFIX_welcome_message' );
## Use of function_exists()
Wrap all function calls in a `function_exists()` call to prevent errors due to potential function redeclaration.
To prevent errors from potential function redeclaration, wrap all function calls with `function_exists()`.
### Example
Example:
```php
/**
@ -69,3 +72,26 @@ if ( ! function_exists( 'YOUR_PREFIX_theme_setup' ) ) {
}
add_action( 'after_setup_theme', 'YOUR_PREFIX_theme_setup' );
```
## Code Quality Standards
To ensure the highest standards of code quality, developers are encouraged to adhere to the following practices:
### WooCommerce Sniffs and WordPress Code Standards
- **Ensure no code style issues** when code is passed through WooCommerce Sniffs and WordPress Code Standards for PHP_CodeSniffer.
### Automated Testing
- **Unit Tests**: Implement automated unit tests to validate code functionality in isolation.
- **E2E Tests**: Utilize automated end-to-end tests to verify the integrated operation of components within the application.
### Tracking and Managing Bugs
- **Monitor and aim to minimize** the number of open bugs, ensuring a stable and reliable product.
### Code Organization
- **Organize code in self-contained classes** to avoid creating "god/super classes" that contain all plugin code. This practice promotes modularity and simplifies maintenance.
By following these coding standards and practices, developers can create high-quality, maintainable, and secure WooCommerce extensions that contribute positively to the WordPress ecosystem.

View File

@ -0,0 +1,59 @@
---
post_title: Compatibility and interoperability for WooCommerce extensions
menu_title: Compatibility best practices
tags: reference
---
Ensuring your WooCommerce extension is compatible and interoperable with the core platform, various components, and other extensions is fundamental to providing a seamless experience for users. This document covers the importance of compatibility, the process for self-declared compatibility checks, manual testing for compatibility issues, and troubleshooting common problems.
## Compatibility importance
Compatibility ensures that your extension works as expected across different environments, including various versions of WordPress and WooCommerce, as well as with other plugins and themes. Ensuring compatibility is crucial for:
- **User experience**: Preventing conflicts that can lead to functionality issues or site downtime.
- **Adoption and retention**: Users are more likely to install and keep updates if they're assured of compatibility.
- **Security and performance**: Compatible extensions are less likely to introduce vulnerabilities or degrade site performance.
## Self-declared compatibility checks
Developers should declare their extension's compatibility with the latest versions of WordPress and WooCommerce, as well as with specific components like Cart & Checkout blocks, High Performance Order Storage (HPOS), Product Editor, and Site Editor. This process involves:
1. **Testing**: Before release, thoroughly test the extension with the latest versions of WordPress and WooCommerce, as well as the specified components.
2. **Declaration**: Update the extension's documentation and metadata to reflect its compatibility with these platforms and components.
3. **Communication**: Inform users of the compatible versions in the extension's change log, website, or repository.
## Manual Compatibility Testing
Manual testing is essential to identify and resolve potential compatibility issues. Follow these steps for effective manual compatibility testing:
1. **Set up a testing environment** that mirrors a typical user setup, including the latest versions of WordPress and WooCommerce.
2. **Test with Core components**: Verify the extension's functionality with core components like Cart & Checkout blocks, HPOS, Product Editor, and Site Editor.
3. **Cross-plugin compatibility**: Activate your extension alongside other commonly used plugins to check for conflicts.
4. **Theme compatibility**: Test your extension with several popular themes to ensure it works correctly and maintains a consistent appearance.
## Troubleshooting and resolving compatibility issues
Despite thorough testing, compatibility issues may arise. Here are common problems and steps to resolve them:
### Conflicts with other extensions
- **Diagnosis**: Use tools like [Health Check & Troubleshooting plugin](https://wordpress.org/plugins/health-check/) to identify conflicting plugins.
- **Resolution**: Contact the other plugin's developer for collaboration, or implement conditional logic in your extension to avoid the conflict.
### Theme Compatibility Issues
- **Diagnosis**: Check for styling or layout issues when your extension is used with different themes.
- **Resolution**: Use more generic CSS selectors and provide configuration options for better theme integration.
### Updates Breaking Compatibility
- **Preventive Measures**: Subscribe to the [WooCommerce developer blog](https://developer.woocommerce.com) to stay informed about upcoming changes.
- **Quick Fixes**: Prepare patches or minor updates to address compatibility issues as soon as possible after a core update.
### No Errors with Multiple Extensions Activated
- **Best Practice**: Regularly test your extension in a multi-plugin environment to ensure it does not cause or suffer from conflicts.
## Conclusion
Maintaining compatibility and interoperability is a continuous effort that requires regular testing, updates, and communication with your users and the broader developer community. By following these guidelines, you can enhance the reliability, user satisfaction, and success of your WooCommerce extension.

View File

@ -0,0 +1,54 @@
---
post_title: Maintaining and updating WooCommerce extensions
menu_title: Maintainability and updates
tags: reference
---
Maintaining and updating WooCommerce extensions is crucial for ensuring they remain compatible, secure, and functional within the ever-evolving WordPress ecosystem. This document outlines best practices for ensuring easy maintainability, adhering to update frequency and process, and conducting manual update checks.
## Ensuring Easy Maintainability
Maintainable code is essential for the long-term success of any WooCommerce extension. It ensures that your extension can be easily updated, debugged, and extended, both by you and others in the future.
### Importance of Writing Maintainable Code
- **Future-proofing**: Maintainable code helps in adapting to future WooCommerce and WordPress updates.
- **Collaboration**: Makes it easier for teams to work together on the extension.
- **Cost-effective**: Reduces the time and resources required for adding new features or fixing issues.
### Strategies to Achieve Maintainability
- **Modular Code**: Break down your extension into smaller, focused modules or components.
- **Coding Standards**: Follow the [WordPress Coding Standards](https://developer.wordpress.org/coding-standards/) to ensure consistency.
- **Documentation**: Document your code extensively to explain "why" behind the code, not just "how" to use it.
- **Refactoring**: Regularly refactor your code to improve its structure without altering the external behavior.
## Update Frequency and Process
Keeping your extension up-to-date is vital for security, compatibility, and performance. Regular updates also signal to users that the extension is actively maintained.
### Best Practices for Regular Updates
- **Scheduled Updates**: Plan regular updates (e.g., monthly) to incorporate bug fixes, security patches, and new features.
- **Version Control**: Use version control systems like Git to manage changes and collaborate efficiently.
- **Compatibility Checks**: Before releasing an update, thoroughly test your extension with the latest versions of WordPress and WooCommerce to ensure compatibility.
- **Changelogs**: Maintain clear changelogs for each update to inform users about new features, fixes, and changes.
### Recommended Update Frequency
- We recommend that extensions receive an update **at least once every 30 days**. This frequency ensures that extensions can quickly adapt to changes in WooCommerce, WordPress, or PHP, and address any security vulnerabilities or bugs.
## Manual Update Checks
While automated update systems like the WordPress Plugin Repository offer a way to distribute updates, developers should also have a process for manually tracking and managing updates.
### How Developers Can Manually Track and Manage Updates
- **User Feedback**: Monitor forums, support tickets, and user feedback for issues that may require updates.
- **Security Monitoring**: Stay informed about the latest security vulnerabilities and ensure your extension is not affected.
- **Performance Testing**: Regularly test your extension for performance and optimize it in updates.
- **Compatibility Testing**: Manually test your extension with beta releases of WordPress and WooCommerce to anticipate compatibility issues before they arise.
## Conclusion
Maintainability and regular updates are key to the success and longevity of WooCommerce extensions. By writing maintainable code, adhering to a consistent update process, and actively monitoring the extension's performance and compatibility, developers can ensure their products remain valuable and functional for users over time.

View File

@ -0,0 +1,28 @@
---
post_title: Privacy Standards for WooCommerce Extensions
menu_title: Privacy Standards
tags: reference
---
Privacy and data protection are becoming increasingly important online, and WooCommerce extensions are no exception. This document outlines the key markers of quality regarding privacy for WooCommerce extensions, the current methods for testing compliance, and the standards developers should adhere to ensure user trust and legal compliance.
## Standards for privacy
To maintain high privacy standards, developers of WooCommerce extensions should adhere to the following:
### Presence of privacy policy page
- A privacy policy should be readily available and easy to understand. It must clearly describe the types of data collected by the extension, the purpose of data collection, how data is processed and stored, and the users' rights concerning their data.
### No unauthorized external requests
- All resources required by the extension should be hosted within the plugin folder/zip file unless there's a clear, justified reason for external requests, which should then be disclosed in the privacy policy.
- Unauthorized or undisclosed external requests, especially those that could expose user data to third-party services without consent, are strictly against privacy standards.
### GDPR compliance
For guidance on ensuring your WooCommerce extension complies with the General Data Protection Regulation (GDPR), please refer to our detailed documentation on [GDPR compliance](./gdpr-compliance.md).
## Conclusion
Adhering to privacy standards is essential for WooCommerce extension developers to build trust with users and ensure compliance with legal requirements. By establishing a clear privacy policy and avoiding unauthorized external requests, developers can demonstrate their commitment to privacy and data protection. Regular testing and compliance checks will help maintain these standards and protect user data effectively.

View File

@ -0,0 +1,66 @@
---
post_title: Support and documentation for WooCommerce extensions
menu_title: Support and documentation
tags: reference
---
Effective support and comprehensive documentation are fundamental to the success of any WooCommerce extension. They not only enhance the user experience but also facilitate easier maintenance and development. This document outlines the best practices for creating documentation, providing support, and establishing feedback mechanisms.
## Creating effective documentation
Good documentation serves as a guide, helping users understand and utilize your extension to its full potential. It can significantly reduce the volume of support requests by answering common questions and troubleshooting typical issues.
### Importance of good documentation
- **User Autonomy**: Allows users to solve problems independently.
- **Reduced Support Load**: Comprehensive documentation can answer many user questions, reducing the need for direct support.
- **Improved User Satisfaction**: Users are more satisfied with the product when they can easily find information.
### How to create effective documentation
- **User-friendly language**: Write in clear, simple language accessible to users of all skill levels.
- **Comprehensive coverage**: Cover all features of your extension, including setup, configuration, troubleshooting, and FAQs.
- **Accessibility**: Ensure documentation is easy to navigate with a clear structure and search functionality.
- **Regular updates**: Keep the documentation up to date with the latest version of the extension.
### Standards for documentation
- **Presence of public documentation**: Ensure that users have access to basic documentation that covers essential information about the extension.
- **Quality of public documentation**: Documentation should be clear, concise, and free of technical jargon.
- **Developer-oriented documentation**: Provide detailed documentation aimed at developers who wish to extend or integrate with your extension.
- **Advanced internal documentation**: Maintain in-depth documentation for internal use, covering complex features and developer notes.
## Providing support
Offering timely and effective support is crucial for resolving user issues and maintaining a positive reputation.
### Best practices for offering support
- **Service level agreements (SLA)**: Establish clear SLAs for response times to manage user expectations.
- **Knowledgeable staff**: Ensure your team is well-trained and familiar with the extension and common issues.
- **Proactive support**: Monitor for common issues and reach out to users who might be affected.
### Standards for support
- **Support - SLA**: Define an SLA for how quickly support requests will be acknowledged and resolved.
- **Support quality**: Regularly review support interactions to ensure quality, accuracy, and helpfulness.
## Feedback Mechanisms
Feedback is invaluable for continuous improvement of your extension and support services.
### How to establish and utilize feedback channels
- **Surveys and feedback forms**: Implement post-support surveys and feedback forms on your documentation pages.
- **Community forums**: Engage with users on community forums where they can share feedback, ask questions, and offer suggestions.
- **Social media and email**: Encourage feedback through social media channels and support emails.
### Utilizing feedback to improve
- **Act on feedback**: Regularly review feedback to identify areas for improvement in your extension and support services.
- **Update documentation**: Use feedback to fill gaps in your documentation and clarify existing content.
- **Train support staff**: Use common questions and feedback to train your support staff and improve their knowledge base.
## Conclusion
Support and documentation are critical components of the overall user experience for WooCommerce extensions. By investing in high-quality documentation, providing excellent support, and actively seeking and utilizing user feedback, developers can enhance user satisfaction, reduce support workload, and continuously improve their extensions.

View File

@ -5,3 +5,5 @@ post_title: Theme Development
---
Learn to design and integrate custom themes in WooCommerce, focusing on responsive design and ecommerce optimization.
This document was created for use when developing classic themes. Check this other document for [block theme development](../../plugins/woocommerce-blocks/docs/designers/theming/README.md).

View File

@ -5,7 +5,7 @@ menu_title: Classic theme development
---
**Note:** this document is geared toward the development of classic themes. For the recommended modern approach, visit [Develop Your First Low-Code Block Theme](https://learn.wordpress.org/course/develop-your-first-low-code-block-theme/) to learn about block theme development, and explore the [Create Block Theme plugin](https://wordpress.org/plugins/create-block-theme/) tool when you're ready to create a new theme.
**Note:** this document is geared toward the development of classic themes. Check this other document for [block theme development](../../plugins/woocommerce-blocks/docs/designers/theming/README.md).
---

View File

@ -4,7 +4,7 @@ menu_title: Image sizing
tags: reference
---
**Note:** this document was created for use when developing classic themes (as opposed to block themes).
**Note:** this document was created for use when developing classic themes (as opposed to block themes). Check this other document for [block theme development](../../plugins/woocommerce-blocks/docs/designers/theming/README.md).
To display images in your catalog, WooCommerce registers a few image sizes which define the actual image dimensions to be used. These sizes include:

View File

@ -4,7 +4,7 @@ menu_title: Set up and use a child theme
tags: how-to
---
**Note:** This document is intended for creating and using classic child themes. For a comprehensive guide on creating a child block theme and understanding the differences between a classic and block theme, please refer to [this detailed documentation](https://learn.wordpress.org/lesson-plan/create-a-basic-child-theme-for-block-themes/).
**Note:** This document is intended for creating and using classic child themes. For a comprehensive guide on creating a child block theme and understanding the differences between a classic and block theme, please refer to [WooCommerce block theme development](../../plugins/woocommerce-blocks/docs/designers/theming/README.md) and [WordPress block child theme development](https://learn.wordpress.org/lesson-plan/create-a-basic-child-theme-for-block-themes/).
Sometimes, you might need to customize your theme or WooCommerce beyond what is possible via the options. These guidelines will teach you the basics of how to go about customizing your site by using a child theme.

View File

@ -4,11 +4,7 @@ post_title: Template structure & Overriding templates via a theme
---
**Note:** this document is geared toward template development for classic themes. For the recommended modern approach,
visit [Develop Your First Low-Code Block Theme](https://learn.wordpress.org/course/develop-your-first-low-code-block-theme/)
to learn about block theme development, and explore
the [Create Block Theme plugin](https://wordpress.org/plugins/create-block-theme/) tool when you're ready to create a
new theme.
**Note:** this document is geared toward template development for classic themes. Check this other document for [block theme development](../../plugins/woocommerce-blocks/docs/designers/theming/README.md).
We are unable to provide support for customizations under our [Support Policy](http://woocommerce.com/support-policy/). If you
need to further customize a snippet, or extend its functionality, we highly
recommend [Codeable](https://codeable.io/?ref=z4Hnp), or a [Certified WooExpert](https://woocommerce.com/experts/).

View File

@ -9,12 +9,12 @@ The new product form consists of groups currently displayed as tabs. Each is a s
If a tab doesn't contain any sections, it won't be shown to merchants.
- **General:** Essential product information, including the name, image, and description. This tab is also where key features live for non-standard product types: downloads, groups, links, etc.
- **Organization:** This tab contains all the data used to organize and categorize product information: from categories to attributes. Best for extensions that provide new ways to describe products, e.g., product identifiers, statuses, special tags, etc.
- **Pricing:** List price, sale price, and tax options. Best for extensions that allow merchants to set up additional payment methods (e.g., Subscriptions) or add advanced pricing schemes, like wholesale.
- **Inventory:** Basic inventory settings and stock management options. Here merchants come to update the quantity at hand or mark the product as out of stock. Best for extensions that enable conditional inventory management, dropshipping options, or various restrictions.
- **Shipping:** All the information merchants need to enter to present customers with accurate shipping rates at checkout. Best for physical product details that may impact shipping (e.g. capacity or volume), additional shipping carrier settings, or custom shipping options.
- **Variations:** Contains variation options and product variations.
- **General:** Essential product information, including the name, image, and description. This tab is also where key features live for non-standard product types: downloads, groups, links, etc.
- **Organization:** This tab contains all the data used to organize and categorize product information: from categories to attributes. Best for extensions that provide new ways to describe products, e.g., product identifiers, statuses, special tags, etc.
- **Pricing:** Regular price, sale price, and tax options. Best for extensions that allow merchants to set up additional payment methods (e.g., Subscriptions) or add advanced pricing schemes, like wholesale.
- **Inventory:** Basic inventory settings and stock management options. Here merchants come to update the quantity at hand or mark the product as out of stock. Best for extensions that enable conditional inventory management, dropshipping options, or various restrictions.
- **Shipping:** All the information merchants need to enter to present customers with accurate shipping rates at checkout. Best for physical product details that may impact shipping (e.g. capacity or volume), additional shipping carrier settings, or custom shipping options.
- **Variations:** Contains variation options and product variations.
Custom product types manage the visibility of the default groups and add new ones. This is particularly useful if a custom product has a unique structure and requires extra information that isn't included in the default groups.

View File

@ -5,7 +5,7 @@
"homepage": "https://woocommerce.com/",
"engines": {
"node": "^20.11.1",
"pnpm": "^8.12.1"
"pnpm": "^9.1.0"
},
"private": true,
"repository": {
@ -23,6 +23,7 @@
"lint": "pnpm -r lint",
"cherry-pick": "node ./tools/cherry-pick/bin/run",
"clean": "rimraf -g '**/node_modules' '**/.wireit' && pnpm store prune && pnpm i",
"distclean": "git clean --force -d -X",
"preinstall": "npx only-allow pnpm",
"postinstall": "pnpm git:update-hooks",
"git:update-hooks": "if test -d .git; then rm -rf .git/hooks && mkdir -p .git/hooks && husky install; else husky install; fi",
@ -72,8 +73,8 @@
"pnpm": {
"overrides": {
"@types/react": "^17.0.71",
"react": "^17.0.2",
"react-resize-aware": "3.1.1"
"react-resize-aware": "3.1.1",
"@automattic/tour-kit>@wordpress/element": "4.4.1"
}
}
}

Some files were not shown because too many files have changed in this diff Show More