Skip to content

Commit 75bcd25

Browse files
authored
Merge branch 'main' into copilot/fix-core-install-error-255
2 parents afcc087 + c8fd1ed commit 75bcd25

File tree

12 files changed

+264
-15
lines changed

12 files changed

+264
-15
lines changed

.github/workflows/code-quality.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
branches:
77
- main
88
- master
9+
schedule:
10+
- cron: '17 2 * * *' # Run every day on a seemly random time.
911

1012
jobs:
1113
code-quality:

.github/workflows/copilot-setup-steps.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@ jobs:
1717

1818
steps:
1919
- name: Checkout code
20-
uses: actions/checkout@v6
20+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
2121

2222
- name: Check existence of composer.json file
2323
id: check_composer_file
24-
uses: andstor/file-existence-action@v3
24+
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3
2525
with:
2626
files: "composer.json"
2727

2828
- name: Set up PHP environment
2929
if: steps.check_composer_file.outputs.files_exists == 'true'
30-
uses: shivammathur/setup-php@v2
30+
uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 # v2
3131
with:
3232
php-version: 'latest'
3333
ini-values: zend.assertions=1, error_reporting=-1, display_errors=On
@@ -38,7 +38,7 @@ jobs:
3838

3939
- name: Install Composer dependencies & cache dependencies
4040
if: steps.check_composer_file.outputs.files_exists == 'true'
41-
uses: ramsey/composer-install@v3
41+
uses: ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520 # v3
4242
env:
4343
COMPOSER_ROOT_VERSION: dev-${{ github.event.repository.default_branch }}
4444
with:

.github/workflows/issue-triage.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ name: Issue and PR Triage
1313
required: false
1414
type: string
1515

16+
permissions:
17+
issues: write
18+
pull-requests: write
19+
actions: write
20+
contents: read
21+
models: read
22+
1623
jobs:
1724
issue-triage:
1825
uses: wp-cli/.github/.github/workflows/reusable-issue-triage.yml@main

.github/workflows/regenerate-readme.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
- "features/**"
1111
- "README.md"
1212

13+
permissions:
14+
contents: write
15+
pull-requests: write
16+
1317
jobs:
1418
regenerate-readme:
1519
uses: wp-cli/.github/.github/workflows/reusable-regenerate-readme.yml@main

.github/workflows/welcome-new-contributors.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
- main
88
- master
99

10+
permissions:
11+
pull-requests: write
12+
1013
jobs:
1114
welcome:
1215
uses: wp-cli/.github/.github/workflows/reusable-welcome-new-contributors.yml@main

.typos.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[default]
2+
extend-ignore-re = [
3+
"(?Rm)^.*(#|//)\\s*spellchecker:disable-line$",
4+
"(?s)(#|//)\\s*spellchecker:off.*?\\n\\s*(#|//)\\s*spellchecker:on",
5+
"(#|//)\\s*spellchecker:ignore-next-line\\n.*"
6+
]

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,8 @@ Transforms an existing single-site installation into a multisite installation.
239239
wp core multisite-convert [--title=<network-title>] [--base=<url-path>] [--subdomains] [--skip-config]
240240
~~~
241241

242+
**Alias:** `install-network`
243+
242244
Creates the multisite database tables, and adds the multisite constants
243245
to wp-config.php.
244246

@@ -344,6 +346,8 @@ Updates WordPress to a newer version.
344346
wp core update [<zip>] [--minor] [--version=<version>] [--force] [--locale=<locale>] [--format=<format>] [--insecure]
345347
~~~
346348

349+
**Alias:** `upgrade`
350+
347351
Defaults to updating WordPress to the latest version.
348352

349353
If you see "Error: Another update is currently in progress.", you may

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
],
1414
"require": {
1515
"composer/semver": "^1.4 || ^2 || ^3",
16-
"wp-cli/wp-cli": "^2.12"
16+
"wp-cli/wp-cli": "^2.13"
1717
},
1818
"require-dev": {
1919
"wp-cli/checksum-command": "^1 || ^2",

features/core-check-update.feature

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,19 @@ Feature: Check for more recent versions
7070
"""
7171
---
7272
"""
73+
74+
Scenario: Check update shows warning when version check API fails
75+
Given a WP install
76+
And that HTTP requests to https://api.wordpress.org/core/version-check/1.7/ will respond with:
77+
"""
78+
HTTP/1.1 500 Internal Server Error
79+
Content-Type: text/plain
80+
81+
<Error body>
82+
"""
83+
84+
When I try `wp core check-update --force-check`
85+
Then STDERR should contain:
86+
"""
87+
Warning: Failed to check for updates
88+
"""

features/core-update.feature

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ Feature: Update WordPress core
167167
When I run `wp core update`
168168
Then STDOUT should contain:
169169
"""
170-
WordPress is up to date
170+
WordPress is up to date at version
171171
"""
172172
And STDOUT should not contain:
173173
"""
@@ -419,3 +419,57 @@ Feature: Update WordPress core
419419
"""
420420
</div>
421421
"""
422+
423+
@require-php-7.0 @require-wp-6.1
424+
Scenario: Attempting to downgrade without --force shows helpful message
425+
Given a WP install
426+
427+
When I run `wp core version`
428+
Then save STDOUT as {WP_CURRENT_VERSION}
429+
430+
When I try `wp core update --version=6.0`
431+
Then STDOUT should contain:
432+
"""
433+
WordPress is up to date at version
434+
"""
435+
And STDOUT should contain:
436+
"""
437+
is older than the current version
438+
"""
439+
And STDOUT should contain:
440+
"""
441+
Use --force to update anyway
442+
"""
443+
And STDOUT should not contain:
444+
"""
445+
Success:
446+
"""
447+
And the return code should be 0
448+
449+
When I run `wp core update --version=6.0 --force`
450+
Then STDOUT should contain:
451+
"""
452+
Updating to version 6.0
453+
"""
454+
And STDOUT should contain:
455+
"""
456+
Success: WordPress updated successfully.
457+
"""
458+
459+
Scenario: Show helpful tip when update is locked
460+
Given a WP install
461+
462+
When I run `wp option update core_updater.lock 100000000000000`
463+
And I try `wp core update --version=trunk`
464+
Then STDERR should contain:
465+
"""
466+
Another update is currently in progress. You may need to run `wp option delete core_updater.lock` after verifying another update isn't actually running.
467+
"""
468+
And the return code should be 1
469+
470+
# Clean up the lock
471+
When I run `wp option delete core_updater.lock`
472+
Then STDOUT should contain:
473+
"""
474+
Success:
475+
"""

0 commit comments

Comments
 (0)