Skip to content

Commit c5d0e43

Browse files
committed
Merge secrets-require-key into secrets-site-health-takeover.
Brings in trunk through r65272 and the updated WordPress#15258. The key source test now uses `WP_Secrets_Config_Key_Provider::get_key_status()` rather than the text of the key source, and the Site Health tests this branch adds or changes follow r65272's conventions: a summary, `@covers`, and a failure message for each assertion.
2 parents 1b7c9d1 + 684099f commit c5d0e43

702 files changed

Lines changed: 29202 additions & 5990 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: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,16 @@ LOCAL_PHP_XDEBUG_MODE=develop,debug
4545
# Whether or not to enable Memcached.
4646
LOCAL_PHP_MEMCACHED=false
4747

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+
4858
##
4959
# The database software to use.
5060
#
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

‎.github/actions/setup-npm/action.yml‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,22 @@ runs:
1818
id: npm
1919
env:
2020
WORKING_DIRECTORY: ${{ inputs.working-directory }}
21+
NPM_INSTALL_MAX_ATTEMPTS: 3
2122
run: |
2223
NPM_VERSION="$(jq -r '.devEngines.packageManager.version // empty' package.json)"
2324
if [ -n "$NPM_VERSION" ]; then
2425
# Contributors need the floor; CI stays on that major's newest release.
25-
npm install --global "npm@${NPM_VERSION/>=/^}"
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
2637
echo "Required npm version: $NPM_VERSION"
2738
else
2839
echo "No devEngines.packageManager.version, keeping the bundled npm."

‎.github/pull_request_template.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ Hi there! Thanks for contributing to WordPress!
33
44
Pull Requests in this GitHub repository **must** be linked to a ticket in the WordPress Core Trac instance (https://core.trac.wordpress.org), and are only used for code review. **No pull requests will be merged on GitHub.**
55
6-
See the WordPress Handbook page on using PRs for Code Review more information: https://make.wordpress.org/core/handbook/contribute/git/github-pull-requests-for-code-review/
6+
See the WordPress Handbook page on using PRs for Code Review for more information: https://make.wordpress.org/core/handbook/contribute/git/github-pull-requests-for-code-review/
7+
8+
Do not open pull requests for security vulnerabilities. Please follow the responsible disclosure policy instead: https://make.wordpress.org/core/handbook/testing/reporting-security-vulnerabilities/
79
810
If this is your first time contributing, you may also find reviewing these guides first to be helpful:
911
- FAQs for New Contributors: https://make.wordpress.org/core/handbook/tutorials/faq-for-new-contributors/

‎.github/workflows/coding-standards.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ on:
7575

7676
# Cancels all previous workflow runs for pull requests that have not completed.
7777
concurrency:
78-
# The concurrency group contains the workflow name and the branch name for pull requests
78+
# The concurrency group contains the workflow name and the pull request number for pull requests
7979
# or the commit hash for any other events.
80-
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
80+
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.sha }}
8181
cancel-in-progress: true
8282

8383
# Disable permissions for all available scopes by default.

‎.github/workflows/end-to-end-tests.yml‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,16 @@ on:
4444
- 'tools/vendors/**'
4545
- 'tools/webpack/**'
4646
- '.github/actions/setup-npm/**'
47+
- '.github/actions/download-with-retry/**'
4748
- '.github/workflows/end-to-end-tests.yml'
4849
- '.github/workflows/reusable-end-to-end-tests*.yml'
4950
workflow_dispatch:
5051

5152
# Cancels all previous workflow runs for pull requests that have not completed.
5253
concurrency:
53-
# The concurrency group contains the workflow name and the branch name for pull requests
54+
# The concurrency group contains the workflow name and the pull request number for pull requests
5455
# or the commit hash for any other events.
55-
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
56+
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.sha }}
5657
cancel-in-progress: true
5758

5859
# Disable permissions for all available scopes by default.

‎.github/workflows/install-testing.yml‎

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ on:
1313
# Always test the workflow after it's updated.
1414
paths:
1515
- '.github/actions/setup-wp-cli/**'
16+
- '.github/actions/run-with-retry/**'
1617
- '.github/actions/smoke-check/**'
1718
- '.github/workflows/install-testing.yml'
1819
- '.version-support-*.json'
@@ -21,6 +22,7 @@ on:
2122
# Always test the workflow when changes are suggested.
2223
paths:
2324
- '.github/actions/setup-wp-cli/**'
25+
- '.github/actions/run-with-retry/**'
2426
- '.github/actions/smoke-check/**'
2527
- '.version-support-*.json'
2628
- '.github/workflows/install-testing.yml'
@@ -37,9 +39,9 @@ on:
3739

3840
# Cancels all previous workflow runs for pull requests that have not completed.
3941
concurrency:
40-
# The concurrency group contains the workflow name and the branch name for pull requests
42+
# The concurrency group contains the workflow name and the pull request number for pull requests
4143
# or the commit hash for any other events.
42-
group: ${{ github.workflow }}-${{ inputs.wp-version || github.event_name == 'pull_request' && github.head_ref || github.sha }}
44+
group: ${{ github.workflow }}-${{ inputs.wp-version || github.event_name == 'pull_request' && github.event.pull_request.number || github.sha }}
4345
cancel-in-progress: true
4446

4547
# Disable permissions for all available scopes by default.
@@ -104,11 +106,16 @@ jobs:
104106
- db-version: '9.4'
105107
- db-version: '9.5'
106108
- db-version: '9.6'
109+
- db-version: '26.7'
107110
# MySQL 9.0+ will not work on PHP 7.2 & 7.3. See https://core.trac.wordpress.org/ticket/61218.
108111
- php: '7.2'
109112
db-version: '9.7'
110113
- php: '7.3'
111114
db-version: '9.7'
115+
- php: '7.2'
116+
db-version: '26.10'
117+
- php: '7.3'
118+
db-version: '26.10'
112119

113120
services:
114121
database:
@@ -138,16 +145,20 @@ jobs:
138145
- name: Set up WP-CLI
139146
uses: $/.github/actions/setup-wp-cli
140147
with:
141-
version: ${{ contains( fromJSON('["5.4", "5.5"]'), matrix.php ) && '2.4.0' || 'latest' }}
148+
version: ${{ contains( fromJSON('["5.4", "5.5"]'), matrix.php ) && '2.4.0' || contains( fromJSON('["5.6", "7.0", "7.1"]'), matrix.php ) && '2.12.0' || 'latest' }}
142149

143-
# WP-CLI extracts tarballs with PharData, which truncates paths longer than 100 characters.
144-
# Nightly builds are only available as a zip, which is not affected.
150+
# WP-CLI 2.x extracts tarballs with PharData, which truncates paths longer than 100 characters.
151+
# Zip archives are not affected, so download the zip for every version.
145152
- name: Download WordPress
146-
run: |
147-
case "${WP_VERSION}" in
148-
nightly|trunk) wp core download --version=nightly ;;
149-
*) curl -fsSL "https://wordpress.org/wordpress-${WP_VERSION}.tar.gz" | tar xz --strip-components=1 ;;
150-
esac
153+
# WP-CLI requests WordPress from WordPress.org once, so a network error fails the job.
154+
# It extracts only after a complete download, so a retry starts from an empty directory.
155+
uses: $/.github/actions/run-with-retry
156+
with:
157+
command: |
158+
case "${WP_VERSION}" in
159+
nightly|trunk) wp core download --version=nightly ;;
160+
*) wp core download "https://wordpress.org/wordpress-${WP_VERSION}.zip" ;;
161+
esac
151162
env:
152163
WP_VERSION: ${{ inputs.wp-version || 'nightly' }}
153164

‎.github/workflows/javascript-tests.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ on:
7676

7777
# Cancels all previous workflow runs for pull requests that have not completed.
7878
concurrency:
79-
# The concurrency group contains the workflow name and the branch name for pull requests
79+
# The concurrency group contains the workflow name and the pull request number for pull requests
8080
# or the commit hash for any other events.
81-
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
81+
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.sha }}
8282
cancel-in-progress: true
8383

8484
# Disable permissions for all available scopes by default.

‎.github/workflows/javascript-type-checking.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ on:
3131

3232
# Cancels all previous workflow runs for pull requests that have not completed.
3333
concurrency:
34-
# The concurrency group contains the workflow name and the branch name for pull requests
34+
# The concurrency group contains the workflow name and the pull request number for pull requests
3535
# or the commit hash for any other events.
36-
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
36+
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.sha }}
3737
cancel-in-progress: true
3838

3939
# Disable permissions for all available scopes by default.

0 commit comments

Comments
 (0)