Skip to content

Commit a0a6f07

Browse files
authored
Merge branch 'main' into claude/export-batch-queries
2 parents d7ebb20 + 1fc05f3 commit a0a6f07

5 files changed

Lines changed: 92 additions & 37 deletions

File tree

‎.github/actionlint.yml‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,12 @@ paths:
1111
# catching genuine typos in permission names.
1212
# See https://docs.github.com/en/copilot/how-tos/copilot-cli/use-copilot-cli-in-actions
1313
- 'unknown permission scope "copilot-requests"'
14+
# Steps can run in parallel through the `background`, `wait`, `wait-all`,
15+
# `cancel` and `parallel` keywords, but actionlint does not know them yet:
16+
# it rejects `background` as an unexpected key, and a `wait-all` or
17+
# `parallel` step as one that has neither `run` nor `uses`. Drop these
18+
# entries once actionlint supports the keywords. Until then, a step that is
19+
# genuinely missing both `run` and `uses` is no longer reported.
20+
# See https://docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsparallel
21+
- 'unexpected key "background" for step'
22+
- 'step must run script with "run" section or run action with "uses" section'

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

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,30 @@ jobs:
3939
id: check_composer_file
4040
run: echo "files_exists=$(test -f composer.json && echo true || echo false)" >> "$GITHUB_OUTPUT"
4141

42+
# Without a database the Behat runner silently falls back to SQLite, so the
43+
# agent's test runs are not the ones CI will do. Mirrors the setup in
44+
# reusable-functional.yml.
45+
- name: Check existence of behat.yml file
46+
id: check_behat_file
47+
run: echo "files_exists=$(test -f behat.yml && echo true || echo false)" >> "$GITHUB_OUTPUT"
48+
49+
# Downloading and starting the database server is the slowest part of the
50+
# setup and it is independent of PHP and Composer, so it runs in the
51+
# background and is waited for right before the test database is prepared.
52+
- name: Setup MySQL Server
53+
if: steps.check_behat_file.outputs.files_exists == 'true'
54+
background: true
55+
uses: shogo82148/actions-setup-mysql@13a38f2af408e58a0c80168fc620a63a15357339 # v1
56+
with:
57+
mysql-version: '8.0' # Standard MySQL version for these tests
58+
auto-start: true
59+
root-password: ${{ env.WP_CLI_TEST_DBROOTPASS }}
60+
user: ${{ env.WP_CLI_TEST_DBUSER }}
61+
password: ${{ env.WP_CLI_TEST_DBPASS }}
62+
4263
- name: Set up PHP environment
4364
if: steps.check_composer_file.outputs.files_exists == 'true'
44-
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2
65+
uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # v2
4566
with:
4667
php-version: 'latest'
4768
ini-values: zend.assertions=1, error_reporting=-1, display_errors=On
@@ -56,22 +77,8 @@ jobs:
5677
env:
5778
COMPOSER_ROOT_VERSION: dev-${{ github.event.repository.default_branch }}
5879

59-
# Without a database the Behat runner silently falls back to SQLite, so the
60-
# agent's test runs are not the ones CI will do. Mirrors the setup in
61-
# reusable-functional.yml.
62-
- name: Check existence of behat.yml file
63-
id: check_behat_file
64-
run: echo "files_exists=$(test -f behat.yml && echo true || echo false)" >> "$GITHUB_OUTPUT"
65-
66-
- name: Setup MySQL Server
67-
if: steps.check_behat_file.outputs.files_exists == 'true'
68-
uses: shogo82148/actions-setup-mysql@083ec148d28e62f2b24b8f4541693dfe1d50488d # v1
69-
with:
70-
mysql-version: '8.0' # Standard MySQL version for these tests
71-
auto-start: true
72-
root-password: ${{ env.WP_CLI_TEST_DBROOTPASS }}
73-
user: ${{ env.WP_CLI_TEST_DBUSER }}
74-
password: ${{ env.WP_CLI_TEST_DBPASS }}
80+
- name: Wait for the MySQL server
81+
wait-all:
7582

7683
- name: Remove system MySQL binary
7784
if: steps.check_behat_file.outputs.files_exists == 'true'

‎AGENTS.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
This package is part of WP-CLI, the official command line interface for WordPress. For a detailed explanation of the project structure and development workflow, please refer to the main @README.md file.
44

5+
If the repository contains an @AGENTS.local.md file, read it as well. It holds instructions specific to this repository and takes precedence over this file where the two disagree.
6+
57
## Best Practices for Code Contributions
68

79
When contributing to this package, please adhere to the following guidelines:

‎composer.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"wp-cli/extension-command": "^1.2 || ^2 || ^3",
2222
"wp-cli/import-command": "^1 || ^2 || ^3",
2323
"wp-cli/media-command": "^1 || ^2 || ^3",
24-
"wp-cli/wp-cli-tests": "^5"
24+
"wp-cli/wp-cli-tests": "^5.4.0"
2525
},
2626
"config": {
2727
"process-timeout": 7200,

‎features/export.feature‎

Lines changed: 56 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,10 @@ Feature: Export content.
314314
Scenario: Export posts from a given category
315315
Given a WP install
316316
And I run `wp site empty --yes`
317-
And I run `wp plugin install wordpress-importer --activate`
317+
And these installed and active plugins:
318+
"""
319+
wordpress-importer
320+
"""
318321

319322
When I run `wp term create category Apple --porcelain`
320323
Then STDOUT should be a number
@@ -396,7 +399,10 @@ Feature: Export content.
396399
Scenario: Export posts from a given author
397400
Given a WP install
398401
And I run `wp site empty --yes`
399-
And I run `wp plugin install wordpress-importer --activate`
402+
And these installed and active plugins:
403+
"""
404+
wordpress-importer
405+
"""
400406

401407
When I run `wp user create john john.doe@example.com --porcelain`
402408
Then STDOUT should be a number
@@ -478,7 +484,10 @@ Feature: Export content.
478484
@require-wp-5.2
479485
Scenario: Export posts should include user information
480486
Given a WP install
481-
And I run `wp plugin install wordpress-importer --activate`
487+
And these installed and active plugins:
488+
"""
489+
wordpress-importer
490+
"""
482491
And I run `wp user create user user@user.com --role=editor --display_name="Test User"`
483492
And I run `wp post generate --post_type=post --count=10 --post_author=user`
484493

@@ -551,7 +560,10 @@ Feature: Export content.
551560
And I run `wp site empty --yes`
552561
And I run `wp post create --post_title="Some page" --post_type=page`
553562
And I run `wp post generate --post_type=post --count=10`
554-
And I run `wp plugin install wordpress-importer --activate`
563+
And these installed and active plugins:
564+
"""
565+
wordpress-importer
566+
"""
555567

556568
When I run `wp post list --post_type=any --format=count`
557569
Then STDOUT should be:
@@ -670,7 +682,10 @@ Feature: Export content.
670682
Scenario: Export a site and skip the comments
671683
Given a WP install
672684
And I run `wp comment generate --post_id=1 --count=2`
673-
And I run `wp plugin install wordpress-importer --activate`
685+
And these installed and active plugins:
686+
"""
687+
wordpress-importer
688+
"""
674689

675690
When I run `wp comment list --format=count`
676691
Then STDOUT should contain:
@@ -851,7 +866,10 @@ Feature: Export content.
851866
Scenario: Export a site to stdout
852867
Given a WP install
853868
And I run `wp comment generate --post_id=1 --count=1`
854-
And I run `wp plugin install wordpress-importer --activate`
869+
And these installed and active plugins:
870+
"""
871+
wordpress-importer
872+
"""
855873

856874
When I run `wp export --stdout > export.xml`
857875
Then STDOUT should be empty
@@ -904,7 +922,10 @@ Feature: Export content.
904922
@require-wp-5.2
905923
Scenario: Export individual post with attachments
906924
Given a WP install
907-
And I run `wp plugin install wordpress-importer --activate`
925+
And these installed and active plugins:
926+
"""
927+
wordpress-importer
928+
"""
908929
And I run `wp site empty --yes`
909930

910931
When I run `wp post generate --count=10`
@@ -1012,7 +1033,10 @@ Feature: Export content.
10121033
}
10131034
add_action( 'init', 'wp_cli_region_taxonomy' );
10141035
"""
1015-
And I run `wp plugin install wordpress-importer --activate`
1036+
And these installed and active plugins:
1037+
"""
1038+
wordpress-importer
1039+
"""
10161040
And I run `wp site empty --yes`
10171041

10181042
When I run `wp term create category News --description="A news article" --porcelain`
@@ -1165,9 +1189,14 @@ Feature: Export content.
11651189
@require-wp-5.2
11661190
Scenario: Export posts should not include oembed_cache posts user information
11671191
Given a WP install
1168-
And I run `wp plugin install wordpress-importer --activate`
1169-
And I run `wp user create user user@user.com --role=editor --display_name="Test User"`
1170-
And I run `wp user create oembed_cache_user oembed_cache@user.com --role=editor --display_name="Oembed User"`
1192+
And these installed and active plugins:
1193+
"""
1194+
wordpress-importer
1195+
"""
1196+
And these setup commands:
1197+
| command |
1198+
| wp user create user user@user.com --role=editor --display_name="Test User" |
1199+
| wp user create oembed_cache_user oembed_cache@user.com --role=editor --display_name="Oembed User" |
11711200
And I run `wp post generate --post_type=post --count=10 --post_author=user`
11721201
And I run `wp post generate --post_type=oembed_cache --count=1 --post_author=oembed_cache_user`
11731202

@@ -1197,12 +1226,14 @@ Feature: Export content.
11971226
@require-wp-5.2
11981227
Scenario: Allow export to proceed when orphaned terms are found
11991228
Given a WP install
1200-
And I run `wp term create category orphan --parent=1`
1201-
And I run `wp term create category parent`
1202-
And I run `wp term create category child --parent=3`
1203-
And I run `wp term create post_tag atag`
1204-
And I run `wp term create post_tag btag`
1205-
And I run `wp term create post_tag ctag`
1229+
And these setup commands:
1230+
| command |
1231+
| wp term create category orphan --parent=1 |
1232+
| wp term create category parent |
1233+
| wp term create category child --parent=3 |
1234+
| wp term create post_tag atag |
1235+
| wp term create post_tag btag |
1236+
| wp term create post_tag ctag |
12061237
And I run `wp db query "DELETE FROM wp_terms WHERE term_id = 1"`
12071238

12081239
When I run `wp export --allow_orphan_terms`
@@ -1217,7 +1248,10 @@ Feature: Export content.
12171248
"""
12181249

12191250
When I run `wp site empty --yes`
1220-
And I run `wp plugin install wordpress-importer --activate`
1251+
And these installed and active plugins:
1252+
"""
1253+
wordpress-importer
1254+
"""
12211255
And I run `wp import {EXPORT_FILE} --authors=skip`
12221256
Then STDOUT should contain:
12231257
"""
@@ -1292,7 +1326,10 @@ Feature: Export content.
12921326
@require-wp-5.2
12931327
Scenario: Export posts with future status
12941328
Given a WP install
1295-
And I run `wp plugin install wordpress-importer --activate`
1329+
And these installed and active plugins:
1330+
"""
1331+
wordpress-importer
1332+
"""
12961333
And I run `wp site empty --yes`
12971334

12981335
When I run `wp post create --post_title='Future Post 1' --post_status=future --post_date='2050-01-01 12:00:00' --porcelain`

0 commit comments

Comments
 (0)