Skip to content

Commit 7b7d785

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/wp-cli-pr-6365-landing-slkyfp
2 parents 1c5d092 + db43a80 commit 7b7d785

4 files changed

Lines changed: 36 additions & 26 deletions

File tree

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

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ jobs:
4646
id: check_behat_file
4747
run: echo "files_exists=$(test -f behat.yml && echo true || echo false)" >> "$GITHUB_OUTPUT"
4848

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.
49+
# Not run in the background: Copilot code review builds its workflow from
50+
# these steps and failed validation while they used `background` and
51+
# `wait-all`. Also, the action unpacks its binaries with the system `tar`,
52+
# which fails to load libpcre2 while setup-php upgrades it with apt.
5253
- name: Setup MySQL Server
5354
if: steps.check_behat_file.outputs.files_exists == 'true'
54-
background: true
5555
uses: shogo82148/actions-setup-mysql@13a38f2af408e58a0c80168fc620a63a15357339 # v1
5656
with:
5757
mysql-version: '8.0' # Standard MySQL version for these tests
@@ -77,9 +77,6 @@ jobs:
7777
env:
7878
COMPOSER_ROOT_VERSION: dev-${{ github.event.repository.default_branch }}
7979

80-
- name: Wait for the MySQL server
81-
wait-all:
82-
8380
- name: Remove system MySQL binary
8481
if: steps.check_behat_file.outputs.files_exists == 'true'
8582
run: sudo rm -f /usr/bin/mysql /usr/bin/mysqldump
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Milestone Merged Pull Requests
3+
4+
'on':
5+
pull_request_target:
6+
types: [closed]
7+
branches:
8+
- main
9+
- master
10+
11+
permissions:
12+
issues: write
13+
pull-requests: write
14+
15+
jobs:
16+
milestone:
17+
uses: wp-cli/.github/.github/workflows/reusable-milestone-merged-prs.yml@main

‎phpcs.xml.dist‎

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,8 @@
105105

106106
<!-- These are stand-alone files that are copied into the test run directory and
107107
executed by the child WP-CLI process, not loaded as part of this package.
108-
They declare a class once per supported Requests major version, and their
109-
method signatures are dictated by the transport interface they implement,
108+
Their method signatures are dictated by the transport interface they implement,
110109
so unused parameters cannot be dropped. -->
111-
<rule ref="Generic.Files.OneObjectStructurePerFile">
112-
<exclude-pattern>*/src/Context/templates/*</exclude-pattern>
113-
</rule>
114-
<rule ref="Generic.Classes.DuplicateClassName">
115-
<exclude-pattern>*/src/Context/templates/*</exclude-pattern>
116-
</rule>
117110
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter">
118111
<exclude-pattern>*/src/Context/templates/*</exclude-pattern>
119112
</rule>

‎src/Context/templates/mock-requests.php‎

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,23 @@ public static function test( $capabilities = array() ) {
4646
}
4747
}
4848

49-
if ( interface_exists( '\WpOrg\Requests\Transport' ) ) {
50-
class WP_CLI_Tests_Mock_Requests_Transport implements \WpOrg\Requests\Transport {
51-
use WP_CLI_Tests_Mock_Requests_Trait;
52-
}
53-
} else {
54-
class WP_CLI_Tests_Mock_Requests_Transport implements \Requests_Transport {
55-
use WP_CLI_Tests_Mock_Requests_Trait;
56-
}
57-
}
58-
5949
WP_CLI::add_hook(
6050
'http_request_options',
6151
static function ( $options ) {
62-
$options['transport'] = new WP_CLI_Tests_Mock_Requests_Transport();
52+
if ( class_exists( '\WP_CLI\RequestsLibrary' ) && method_exists( '\WP_CLI\RequestsLibrary', 'register_autoloader' ) ) {
53+
\WP_CLI\RequestsLibrary::register_autoloader();
54+
}
55+
56+
if ( interface_exists( '\WpOrg\Requests\Transport' ) ) {
57+
$options['transport'] = new class() implements \WpOrg\Requests\Transport {
58+
use WP_CLI_Tests_Mock_Requests_Trait;
59+
};
60+
} else {
61+
$options['transport'] = new class() implements \Requests_Transport {
62+
use WP_CLI_Tests_Mock_Requests_Trait;
63+
};
64+
}
65+
6366
return $options;
6467
}
6568
);

0 commit comments

Comments
 (0)