Skip to content

Commit ad41fef

Browse files
committed
Merge remote-tracking branch 'upstream/trunk' into priethor/skip-inner-blocks-prompt
# Conflicts: # src/wp-includes/class-wp-block-type.php
2 parents c478c13 + ba924ab commit ad41fef

3,356 files changed

Lines changed: 290041 additions & 61568 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.env.example‎

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@ LOCAL_PORT=8889
1414
# Where to run WordPress from. Valid options are 'src' and 'build'.
1515
LOCAL_DIR=src
1616

17+
# Whether or not to enable text compression (gzip) in the web server.
18+
# Valid options are 'on' and 'off'.
19+
LOCAL_NGINX_COMPRESSION=off
20+
21+
# How long browsers may cache static assets served by the web server, as an nginx `expires` value.
22+
# Valid options are 'off' and a duration such as '1y'. A far-future duration matches typical
23+
# production behavior, but edited CSS and JavaScript is then served stale until a hard reload.
24+
LOCAL_NGINX_STATIC_EXPIRES=off
25+
1726
# The PHP version to use. Valid options are 'latest', and '{version}-fpm'.
1827
LOCAL_PHP=latest
1928

@@ -36,6 +45,16 @@ LOCAL_PHP_XDEBUG_MODE=develop,debug
3645
# Whether or not to enable Memcached.
3746
LOCAL_PHP_MEMCACHED=false
3847

48+
##
49+
# Whether or not to enable PCOV.
50+
#
51+
# PCOV is not interoperable with Xdebug. To use PCOV, `LOCAL_PHP_XDEBUG` must be
52+
# set to `false`. When both are enabled, Xdebug is used and PCOV is disabled.
53+
#
54+
# PCOV is only available for PHP 7.4 and higher.
55+
##
56+
LOCAL_PHP_PCOV=false
57+
3958
##
4059
# The database software to use.
4160
#
@@ -65,9 +84,6 @@ LOCAL_WP_ENVIRONMENT_TYPE=local
6584
LOCAL_WP_DEVELOPMENT_MODE=core
6685
LOCAL_WP_TESTS_DOMAIN=example.org
6786

68-
# The URL to use when running e2e tests.
69-
WP_BASE_URL=http://localhost:${LOCAL_PORT}
70-
7187
##
7288
# This silences the tips output by the dotenv package.
7389
##

‎.eslintignore‎

Lines changed: 0 additions & 26 deletions
This file was deleted.

‎.eslintrc-jsdoc.js‎

Lines changed: 86 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,88 @@
1-
module.exports = {
2-
rules: {
3-
'require-jsdoc': 'off',
4-
'valid-jsdoc': [ 'error', {
5-
prefer: {
6-
arg: 'param',
7-
argument: 'param',
8-
extends: 'augments',
9-
returns: 'return',
1+
/**
2+
* ESLint v10 flat config file for JSDoc linting.
3+
* This config is based on the original valid-jsdoc rules.
4+
*/
5+
6+
const jsdocPlugin = require( 'eslint-plugin-jsdoc' );
7+
8+
module.exports = [
9+
{
10+
plugins: {
11+
jsdoc: jsdocPlugin,
12+
},
13+
settings: {
14+
jsdoc: {
15+
tagNamePreference: {
16+
'arg': 'param',
17+
'argument': 'param',
18+
'extends': 'augments',
19+
'returns': 'return',
20+
},
21+
preferredTypes: {
22+
'array': 'Array',
23+
'bool': 'boolean',
24+
'Boolean': 'boolean',
25+
'float': 'number',
26+
'Float': 'number',
27+
'function': 'Function',
28+
'int': 'number',
29+
'integer': 'number',
30+
'Integer': 'number',
31+
'Number': 'number',
32+
'object': 'Object',
33+
'String': 'string',
34+
'Void': 'void',
35+
},
1036
},
11-
preferType: {
12-
array: 'Array',
13-
bool: 'boolean',
14-
Boolean: 'boolean',
15-
float: 'number',
16-
Float: 'number',
17-
int: 'number',
18-
integer: 'number',
19-
Integer: 'number',
20-
Number: 'number',
21-
object: 'Object',
22-
String: 'string',
23-
Void: 'void',
24-
},
25-
requireParamDescription: false,
26-
requireReturn: false,
27-
} ],
37+
},
38+
rules: {
39+
'jsdoc/check-alignment': 'error',
40+
'jsdoc/check-indentation': [ 'error', {
41+
excludeTags: [
42+
'deprecated',
43+
'example',
44+
'param',
45+
'property',
46+
'return',
47+
'since',
48+
'todo',
49+
],
50+
} ],
51+
'jsdoc/check-line-alignment': [ 'error', 'always', {
52+
tags: [ 'param', 'property' ],
53+
} ],
54+
'jsdoc/check-param-names': 'error',
55+
'jsdoc/check-property-names': 'error',
56+
'jsdoc/check-syntax': 'error',
57+
'jsdoc/check-tag-names': [ 'error', {
58+
definedTags: [
59+
'memberOf',
60+
'output',
61+
'ticket',
62+
'link',
63+
],
64+
} ],
65+
'jsdoc/check-types': 'error',
66+
'jsdoc/no-blank-blocks': 'error',
67+
'jsdoc/no-blank-block-descriptions': 'error',
68+
'jsdoc/require-description': 'error',
69+
'jsdoc/require-hyphen-before-param-description': [ 'error', 'never' ],
70+
'jsdoc/require-jsdoc': 'error',
71+
'jsdoc/require-param': [ 'error', {
72+
enableFixer: false,
73+
} ],
74+
'jsdoc/require-param-description': 'error',
75+
'jsdoc/require-param-name': 'error',
76+
'jsdoc/require-param-type': 'error',
77+
'jsdoc/require-property': 'error',
78+
'jsdoc/require-property-name': 'error',
79+
'jsdoc/require-property-description': 'error',
80+
'jsdoc/require-property-type': 'error',
81+
'jsdoc/require-returns': 'error',
82+
'jsdoc/require-returns-check': 'error',
83+
'jsdoc/require-returns-description': 'error',
84+
'jsdoc/require-returns-type': 'error',
85+
'jsdoc/valid-types': 'error',
86+
},
2887
},
29-
};
88+
];

‎.github/actionlint.yaml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# actionlint does not support the `$/` self-repository `uses:` syntax yet.
2+
# See https://github.com/rhysd/actionlint/issues/711.
3+
paths:
4+
.github/workflows/**/*.yml:
5+
ignore:
6+
- 'specifying action "\$/[^"]+" in invalid format because ref is missing'
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: 'Download with retry'
2+
description: 'Downloads a file with curl, retrying on any error.'
3+
4+
inputs:
5+
url:
6+
description: 'The URL to download.'
7+
required: true
8+
output:
9+
description: 'The path to save the file to, relative to the workspace.'
10+
required: true
11+
12+
runs:
13+
using: 'composite'
14+
steps:
15+
- name: Download the file
16+
shell: bash
17+
# A stalled attempt (connecting for over 30 s, or under 1 KB/s for 30 s) fails and is
18+
# retried: curl has no transfer timeout, and `timeout-minutes` would end the step unretried.
19+
# No retry starts after 10 minutes, so a long `Retry-After` can't stretch the waits.
20+
run: curl --fail --no-progress-meter --location --retry 5 --retry-all-errors --retry-max-time 600 --connect-timeout 30 --speed-limit 1024 --speed-time 30 --output "$OUTPUT" "$URL"
21+
env:
22+
URL: ${{ inputs.url }}
23+
OUTPUT: ${{ inputs.output }}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: 'Run with retry'
2+
description: 'Runs a Bash command, retrying it when it fails. For downloads curl can retry itself, use download-with-retry.'
3+
4+
inputs:
5+
command:
6+
description: 'The Bash command to run. It runs as code: read values from the `env` of the calling step, not from expressions.'
7+
required: true
8+
9+
runs:
10+
using: 'composite'
11+
steps:
12+
- name: Run the command
13+
shell: bash
14+
# Waits 10 s, then 20 s, between attempts, like `tools/local-env/scripts/utils.js`.
15+
run: |
16+
for (( attempt = 1; attempt <= MAX_ATTEMPTS; attempt++ )); do
17+
if bash -eo pipefail -c "$COMMAND"; then
18+
exit 0
19+
fi
20+
echo "::warning::Command failed on attempt $attempt of $MAX_ATTEMPTS."
21+
if (( attempt < MAX_ATTEMPTS )); then
22+
sleep $(( attempt * 10 ))
23+
fi
24+
done
25+
exit 1
26+
env:
27+
COMMAND: ${{ inputs.command }}
28+
MAX_ATTEMPTS: 3
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: 'Set up npm'
2+
description: 'Installs the npm version required by the devEngines field of package.json, so every job resolves dependencies identically. Keeps the bundled npm when the field is absent.'
3+
4+
inputs:
5+
working-directory:
6+
description: 'Optional. The directory holding the package.json to read the required npm version from. Defaults to the workspace root.'
7+
required: false
8+
default: '.'
9+
cache:
10+
description: 'Optional. Whether to restore and save the npm cache. Defaults to true.'
11+
required: false
12+
default: 'true'
13+
14+
runs:
15+
using: 'composite'
16+
steps:
17+
- name: Install npm
18+
id: npm
19+
env:
20+
WORKING_DIRECTORY: ${{ inputs.working-directory }}
21+
NPM_INSTALL_MAX_ATTEMPTS: 3
22+
run: |
23+
NPM_VERSION="$(jq -r '.devEngines.packageManager.version // empty' package.json)"
24+
if [ -n "$NPM_VERSION" ]; then
25+
# Contributors need the floor; CI stays on that major's newest release.
26+
# The registry can reset the connection mid-download (ECONNRESET), so retry.
27+
for (( attempt = 1; attempt <= NPM_INSTALL_MAX_ATTEMPTS; attempt++ )); do
28+
if npm install --global "npm@${NPM_VERSION/>=/^}"; then
29+
break
30+
fi
31+
echo "::warning::npm install failed on attempt $attempt of $NPM_INSTALL_MAX_ATTEMPTS."
32+
if (( attempt == NPM_INSTALL_MAX_ATTEMPTS )); then
33+
exit 1
34+
fi
35+
sleep $(( attempt * 10 ))
36+
done
37+
echo "Required npm version: $NPM_VERSION"
38+
else
39+
echo "No devEngines.packageManager.version, keeping the bundled npm."
40+
fi
41+
echo "Installed npm version: $(npm --version)"
42+
43+
# actions/setup-node cannot restore the npm cache: it locates the
44+
# directory with `npm config get cache`, which runs before this step
45+
# and fails the devEngines check under the bundled npm.
46+
echo "cache-dir=$(npm config get cache | tr -d '\r')" >> "$GITHUB_OUTPUT"
47+
48+
# Scopes the cache key to this package and keeps the hashFiles patterns
49+
# workspace-relative and free of a "./" prefix, so they match the same
50+
# files as every other cache key.
51+
PATH_PREFIX=""
52+
if [ "$WORKING_DIRECTORY" != '.' ] && [ -n "$WORKING_DIRECTORY" ]; then
53+
PATH_PREFIX="${WORKING_DIRECTORY%/}/"
54+
fi
55+
echo "path-prefix=$PATH_PREFIX" >> "$GITHUB_OUTPUT"
56+
working-directory: ${{ inputs.working-directory }}
57+
shell: bash
58+
59+
- name: Cache npm downloads
60+
if: ${{ inputs.cache == 'true' }}
61+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
62+
with:
63+
path: ${{ steps.npm.outputs.cache-dir }}
64+
key: npm-cache-${{ runner.os }}-${{ runner.arch }}-${{ steps.npm.outputs.path-prefix }}lock-${{ hashFiles(format('{0}package-lock.json', steps.npm.outputs.path-prefix), format('{0}patches/**', steps.npm.outputs.path-prefix)) }}
65+
restore-keys: |
66+
npm-cache-${{ runner.os }}-${{ runner.arch }}-${{ steps.npm.outputs.path-prefix }}lock-
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: 'Set up WP-CLI'
2+
description: 'Installs WP-CLI as `wp`, retrying the download and falling back to a previously cached phar when it fails.'
3+
4+
inputs:
5+
version:
6+
description: 'Optional. The WP-CLI version to install, e.g. 2.4.0. Defaults to the latest release.'
7+
required: false
8+
default: 'latest'
9+
10+
# Not installed with the setup-php `tools` input: that downloads WP-CLI in a single attempt
11+
# and only logs an error on failure, so the job breaks later with `wp: command not found`.
12+
# The phar is cached in 6 hour windows, so jobs keep getting new WP-CLI releases without each
13+
# downloading it. When a new window's download fails, the previous window's phar is used instead.
14+
runs:
15+
using: 'composite'
16+
steps:
17+
- name: Get the WP-CLI cache window
18+
id: get-wp-cli-window
19+
shell: bash
20+
run: echo "window=$(( $(/bin/date -u '+%s') / WP_CLI_CACHE_SECONDS ))" >> "$GITHUB_OUTPUT"
21+
env:
22+
WP_CLI_CACHE_SECONDS: 21600 # 6 hours.
23+
24+
- name: Cache WP-CLI
25+
id: cache-wp-cli
26+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
27+
with:
28+
path: ${{ runner.temp }}/wp-cli.phar
29+
key: ${{ runner.os }}-wp-cli-${{ inputs.version }}-${{ steps.get-wp-cli-window.outputs.window }}
30+
restore-keys: ${{ runner.os }}-wp-cli-${{ inputs.version }}-
31+
32+
- name: Install WP-CLI
33+
shell: bash
34+
run: |
35+
if [ "$CACHE_HIT" != 'true' ]; then
36+
if curl --fail --silent --show-error --location --retry 5 --retry-all-errors \
37+
--output "${RUNNER_TEMP}/wp-cli.phar.download" "$WP_CLI_URL"; then
38+
mv "${RUNNER_TEMP}/wp-cli.phar.download" "${RUNNER_TEMP}/wp-cli.phar"
39+
elif [ -f "${RUNNER_TEMP}/wp-cli.phar" ]; then
40+
echo "::warning::Could not download WP-CLI, using the previously cached version."
41+
else
42+
echo "::error::Could not download WP-CLI."
43+
exit 1
44+
fi
45+
fi
46+
sudo install -m 0755 "${RUNNER_TEMP}/wp-cli.phar" /usr/local/bin/wp
47+
wp --version
48+
env:
49+
CACHE_HIT: ${{ steps.cache-wp-cli.outputs.cache-hit }}
50+
WP_CLI_URL: ${{ inputs.version == 'latest' && 'https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar' || format('https://github.com/wp-cli/wp-cli/releases/download/v{0}/wp-cli-{0}.phar', inputs.version) }}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: 'Smoke check a WordPress installation'
2+
description: 'Serves an installed single site with PHP built-in web server and checks that its front end, REST API, and admin respond.'
3+
4+
inputs:
5+
admin-user:
6+
description: 'The username of an administrator account on the site.'
7+
required: true
8+
admin-password:
9+
description: 'The password of the administrator account.'
10+
required: true
11+
12+
runs:
13+
using: 'composite'
14+
steps:
15+
- name: Serve the site and check it
16+
shell: bash
17+
run: bash "${GITHUB_ACTION_PATH}/smoke-check.sh"
18+
env:
19+
WP_ADMIN_USER: ${{ inputs.admin-user }}
20+
WP_ADMIN_PASSWORD: ${{ inputs.admin-password }}

0 commit comments

Comments
 (0)