Skip to content

Commit aeb24b2

Browse files
authored
Merge pull request #395 from wpengine/chore-github-action-fixes-sept-2025
chore: Fixes for Github Actions for code quality and tests.
2 parents ec52235 + 1c3ab56 commit aeb24b2

File tree

10 files changed

+583
-1012
lines changed

10 files changed

+583
-1012
lines changed

.github/workflows/code-quality.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ jobs:
2222
runs-on: ubuntu-latest
2323
name: Detect plugins has php code quality configuration
2424
outputs:
25-
plugins: ${{ steps.detect.outputs.plugins }}
26-
has-plugins: ${{ steps.detect.outputs.has-plugins }}
25+
plugins: ${{ steps.detect-plugin-slug.outputs.plugins }}
26+
has-plugins: ${{ steps.detect-plugin-slug.outputs.has-plugins }}
2727
php-version: ${{ steps.detect-php-version.outputs.php-version }}
2828
steps:
2929
- name: Checkout

plugins/wpgraphql-logging/bin/install-test-env.sh

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ install_db() {
4444
# create database
4545
echo -e "$(status_message "Creating the database (if it does not exist)...")"
4646

47-
RESULT=$(mysql -u $WORDPRESS_DB_USER --password="$WORDPRESS_DB_PASSWORD" --skip-column-names -e "SHOW DATABASES LIKE '$WORDPRESS_DB_NAME'"$EXTRA)
48-
if [ "$RESULT" != $WORDPRESS_DB_NAME ]; then
49-
mysqladmin create $WORDPRESS_DB_NAME --user="$WORDPRESS_DB_USER" --password="$WORDPRESS_DB_PASSWORD"$EXTRA
50-
fi
47+
RESULT=$(mysql --no-defaults --ssl=false -u $WORDPRESS_DB_USER --password="$WORDPRESS_DB_PASSWORD" --skip-column-names -e "SHOW DATABASES LIKE '$WORDPRESS_DB_NAME'"$EXTRA)
48+
if [ "$RESULT" != $WORDPRESS_DB_NAME ]; then
49+
mysqladmin --no-defaults --ssl=false create $WORDPRESS_DB_NAME --user="$WORDPRESS_DB_USER" --password="$WORDPRESS_DB_PASSWORD"$EXTRA
50+
fi
5151
}
5252

5353
download() {
@@ -117,7 +117,6 @@ configure_wordpress() {
117117
SITE_TITLE=${WORDPRESS_SITE_TITLE:-"WPGraphQL Logging Tests"}
118118

119119
wp core install --title="$SITE_TITLE" --admin_user="$WORDPRESS_ADMIN_USER" --admin_password="$WORDPRESS_ADMIN_PASSWORD" --admin_email="$WORDPRESS_ADMIN_EMAIL" --skip-email --url="$WORDPRESS_URL" --allow-root
120-
121120
echo -e "$(status_message "Running WordPress version: $(wp core version --allow-root) at $(wp option get home --allow-root)")"
122121
}
123122

@@ -196,15 +195,6 @@ post_setup() {
196195
wp config set WP_AUTO_UPDATE_CORE false --raw --type=constant --quiet --allow-root
197196
wp config set AUTOMATIC_UPDATER_DISABLED true --raw --type=constant --quiet --allow-root
198197

199-
# Export the db for codeception to use
200-
SQLDUMP="$WORDPRESS_ROOT_DIR/wp-content/plugins/$PLUGIN_SLUG/tests/_data/dump.sql"
201-
mkdir -p "$(dirname "$SQLDUMP")"
202-
if [ ! -f "$SQLDUMP" ]; then
203-
echo -e "$(status_message "Exporting test database dump...")"
204-
205-
wp db export "$SQLDUMP" --allow-root
206-
fi
207-
208198
echo -e "$(status_message "Installed plugins")"
209199
wp plugin list --allow-root
210200
}

plugins/wpgraphql-logging/src/Admin/Settings/Fields/Tab/Basic_Configuration_Tab.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -150,21 +150,21 @@ public function get_fields(): array {
150150

151151

152152
$fields[ self::EVENT_LOG_SELECTION ] = new Select_Field(
153-
self::EVENT_LOG_SELECTION,
154-
$this->get_name(),
155-
__( 'Log Points', 'wpgraphql-logging' ),
156-
[
157-
Events::PRE_REQUEST => __( 'Pre Request', 'wpgraphql-logging' ),
158-
Events::BEFORE_GRAPHQL_EXECUTION => __( 'Before Query Execution', 'wpgraphql-logging' ),
159-
Events::BEFORE_RESPONSE_RETURNED => __( 'Before Response Returned', 'wpgraphql-logging' ),
160-
Events::REQUEST_DATA => __( 'Request Data', 'wpgraphql-logging' ),
161-
Events::REQUEST_RESULTS => __( 'Request Results', 'wpgraphql-logging' ),
162-
Events::RESPONSE_HEADERS_TO_SEND => __( 'Response Headers', 'wpgraphql-logging' ),
163-
],
164-
'',
165-
__( 'Select which points in the request lifecycle to log. By default, all points are logged.', 'wpgraphql-logging' ),
166-
true
167-
);
153+
self::EVENT_LOG_SELECTION,
154+
$this->get_name(),
155+
__( 'Log Points', 'wpgraphql-logging' ),
156+
[
157+
Events::PRE_REQUEST => __( 'Pre Request', 'wpgraphql-logging' ),
158+
Events::BEFORE_GRAPHQL_EXECUTION => __( 'Before Query Execution', 'wpgraphql-logging' ),
159+
Events::BEFORE_RESPONSE_RETURNED => __( 'Before Response Returned', 'wpgraphql-logging' ),
160+
Events::REQUEST_DATA => __( 'Request Data', 'wpgraphql-logging' ),
161+
Events::REQUEST_RESULTS => __( 'Request Results', 'wpgraphql-logging' ),
162+
Events::RESPONSE_HEADERS_TO_SEND => __( 'Response Headers', 'wpgraphql-logging' ),
163+
],
164+
'',
165+
__( 'Select which points in the request lifecycle to log. By default, all points are logged.', 'wpgraphql-logging' ),
166+
true
167+
);
168168

169169
return apply_filters( 'wpgraphql_logging_basic_configuration_fields', $fields );
170170
}

plugins/wpgraphql-logging/src/Events/Events.php

Lines changed: 65 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -8,75 +8,75 @@
88
* List of available events that users can subscribe to with the EventManager.
99
*/
1010
final class Events {
11-
/**
12-
* WPGraphQL action: do_graphql_request.
13-
*
14-
* Before the request is processed.
15-
*
16-
* @var string
17-
*/
18-
public const PRE_REQUEST = 'do_graphql_request';
11+
/**
12+
* WPGraphQL action: do_graphql_request.
13+
*
14+
* Before the request is processed.
15+
*
16+
* @var string
17+
*/
18+
public const PRE_REQUEST = 'do_graphql_request';
1919

20-
/**
21-
* WPGraphQL action: graphql_before_execute.
22-
*
23-
* @var string
24-
*/
25-
public const BEFORE_GRAPHQL_EXECUTION = 'graphql_before_execute';
20+
/**
21+
* WPGraphQL action: graphql_before_execute.
22+
*
23+
* @var string
24+
*/
25+
public const BEFORE_GRAPHQL_EXECUTION = 'graphql_before_execute';
2626

27-
/**
28-
* WPGraphQL action: graphql_return_response
29-
*
30-
* Before the response is returned to the client.
31-
*
32-
* @var string
33-
*/
34-
public const BEFORE_RESPONSE_RETURNED = 'graphql_return_response';
27+
/**
28+
* WPGraphQL action: graphql_return_response
29+
*
30+
* Before the response is returned to the client.
31+
*
32+
* @var string
33+
*/
34+
public const BEFORE_RESPONSE_RETURNED = 'graphql_return_response';
3535

36-
/**
37-
* WPGraphQL filter: graphql_request_data.
38-
*
39-
* Allows the request data to be filtered. Ideal for capturing the
40-
* full payload before processing.
41-
*
42-
* @var string
43-
*/
44-
public const REQUEST_DATA = 'graphql_request_data';
36+
/**
37+
* WPGraphQL filter: graphql_request_data.
38+
*
39+
* Allows the request data to be filtered. Ideal for capturing the
40+
* full payload before processing.
41+
*
42+
* @var string
43+
*/
44+
public const REQUEST_DATA = 'graphql_request_data';
4545

46-
/**
47-
* WPGraphQL filter: graphql_response_headers_to_send.
48-
*
49-
* Filters the headers to send in the GraphQL response.
50-
*
51-
* @var string
52-
*/
53-
public const RESPONSE_HEADERS_TO_SEND = 'graphql_response_headers_to_send';
46+
/**
47+
* WPGraphQL filter: graphql_response_headers_to_send.
48+
*
49+
* Filters the headers to send in the GraphQL response.
50+
*
51+
* @var string
52+
*/
53+
public const RESPONSE_HEADERS_TO_SEND = 'graphql_response_headers_to_send';
5454

55-
/**
56-
* WPGraphQL filter: graphql_request_results.
57-
*
58-
* Filters the final results of the GraphQL execution.
59-
*
60-
* @var string
61-
*/
62-
public const REQUEST_RESULTS = 'graphql_request_results';
55+
/**
56+
* WPGraphQL filter: graphql_request_results.
57+
*
58+
* Filters the final results of the GraphQL execution.
59+
*
60+
* @var string
61+
*/
62+
public const REQUEST_RESULTS = 'graphql_request_results';
6363

64-
/**
65-
* WPGraphQL filter: graphql_debug_enabled.
66-
*
67-
* Determines if GraphQL Debug is enabled. Useful for toggling logging.
68-
*
69-
* @var string
70-
*/
71-
public const DEBUG_ENABLED = 'graphql_debug_enabled';
64+
/**
65+
* WPGraphQL filter: graphql_debug_enabled.
66+
*
67+
* Determines if GraphQL Debug is enabled. Useful for toggling logging.
68+
*
69+
* @var string
70+
*/
71+
public const DEBUG_ENABLED = 'graphql_debug_enabled';
7272

73-
/**
74-
* WPGraphQL filter: graphql_app_context_config.
75-
*
76-
* Filters the config for the AppContext. Useful for storing temporary
77-
* data for the duration of a request.
78-
*
79-
* @var string
80-
*/
81-
public const APP_CONTEXT_CONFIG = 'graphql_app_context_config';
82-
}
73+
/**
74+
* WPGraphQL filter: graphql_app_context_config.
75+
*
76+
* Filters the config for the AppContext. Useful for storing temporary
77+
* data for the duration of a request.
78+
*
79+
* @var string
80+
*/
81+
public const APP_CONTEXT_CONFIG = 'graphql_app_context_config';
82+
}

0 commit comments

Comments
 (0)