From a6736eba4fd830be31819cfc7223b5dcafd8f5e1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 4 Oct 2023 08:55:54 -0600 Subject: [PATCH 1/4] chore(deps): Bump preact in /search/search-dev-tools (#4913) Bumps [preact](https://github.com/preactjs/preact) from 10.18.0 to 10.18.1. - [Release notes](https://github.com/preactjs/preact/releases) - [Commits](https://github.com/preactjs/preact/compare/10.18.0...10.18.1) --- updated-dependencies: - dependency-name: preact dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- search/search-dev-tools/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/search/search-dev-tools/package-lock.json b/search/search-dev-tools/package-lock.json index aad5c30758..763a88ade8 100644 --- a/search/search-dev-tools/package-lock.json +++ b/search/search-dev-tools/package-lock.json @@ -9620,9 +9620,9 @@ "dev": true }, "node_modules/preact": { - "version": "10.18.0", - "resolved": "https://registry.npmjs.org/preact/-/preact-10.18.0.tgz", - "integrity": "sha512-O4dGFmErPd3RNVDvXmCbOW6hetnve6vYtjx5qf51mCUmBS96s66MrNQkEII5UThDGoNF7953ptA+aNupiDxVeg==", + "version": "10.18.1", + "resolved": "https://registry.npmjs.org/preact/-/preact-10.18.1.tgz", + "integrity": "sha512-mKUD7RRkQQM6s7Rkmi7IFkoEHjuFqRQUaXamO61E6Nn7vqF/bo7EZCmSyrUnp2UWHw0O7XjZ2eeXis+m7tf4lg==", "funding": { "type": "opencollective", "url": "https://opencollective.com/preact" From 54cff49a7bee7b4aadbf9722ef0697b7ea7f1e52 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 4 Oct 2023 08:56:37 -0600 Subject: [PATCH 2/4] chore(deps): Bump react-select from 5.7.5 to 5.7.7 (#4912) * Add the governance plugin (#4907) * Add the VIP Governance plugin to the integrations * Update the config used for seeing if the governance plugin is loaded or not * Add a test for the new vip-governance integration * Leave only the single test that actually tests some functionality * Add a test for the Block Data API as well * Shift the import lines to be in the right order * Add in a test to see if the isloaded method works correctly for both the integrations * Add a code coverage ignore block to the registrations * Remove the extra false loaded check * Switch the isLoad check to not define any constant * Initial rollout safeguard * Search: Increase character search length to 510 characters (#4911) * Search: Increase character search length to 510 characters * Adjust test Adjust test * CANTINA-958: Add better filtering in `wp vip two-factor report` CLI command (#4910) * CANTINA-958: Add better filtering in `wp vip two-factor report` CLI command x * Update wp-cli/vip-two-factor.php Co-authored-by: Gary Jones * Update wp-cli/vip-two-factor.php Co-authored-by: Gary Jones --------- Co-authored-by: Gary Jones * chore(deps): Bump preact in /search/search-dev-tools (#4913) Bumps [preact](https://github.com/preactjs/preact) from 10.18.0 to 10.18.1. - [Release notes](https://github.com/preactjs/preact/releases) - [Commits](https://github.com/preactjs/preact/compare/10.18.0...10.18.1) --- updated-dependencies: - dependency-name: preact dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): Bump react-select from 5.7.5 to 5.7.7 Bumps [react-select](https://github.com/JedWatson/react-select) from 5.7.5 to 5.7.7. - [Release notes](https://github.com/JedWatson/react-select/releases) - [Changelog](https://github.com/JedWatson/react-select/blob/master/docs/CHANGELOG.md) - [Commits](https://github.com/JedWatson/react-select/compare/react-select@5.7.5...react-select@5.7.7) --- updated-dependencies: - dependency-name: react-select dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --------- Signed-off-by: dependabot[bot] Co-authored-by: Gopal Krishnan Co-authored-by: Rebecca Hum <16962021+rebeccahum@users.noreply.github.com> Co-authored-by: Gary Jones Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 125a472440..ab8b8b9f42 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20471,9 +20471,9 @@ } }, "node_modules/react-select": { - "version": "5.7.5", - "resolved": "https://registry.npmjs.org/react-select/-/react-select-5.7.5.tgz", - "integrity": "sha512-jgYZa2xgKP0DVn5GZk7tZwbRx7kaVz1VqU41S8z1KWmshRDhlrpKS0w80aS1RaK5bVIXpttgSou7XCjWw1ncKA==", + "version": "5.7.7", + "resolved": "https://registry.npmjs.org/react-select/-/react-select-5.7.7.tgz", + "integrity": "sha512-HhashZZJDRlfF/AKj0a0Lnfs3sRdw/46VJIRd8IbB9/Ovr74+ZIwkAdSBjSPXsFMG+u72c5xShqwLSKIJllzqw==", "dependencies": { "@babel/runtime": "^7.12.0", "@emotion/cache": "^11.4.0", From 280f1c366db56306f83c42d5ee857bf7977d80de Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 4 Oct 2023 08:57:20 -0600 Subject: [PATCH 3/4] chore(deps-dev): Bump postcss in /search/search-dev-tools (#4917) Bumps [postcss](https://github.com/postcss/postcss) from 8.4.29 to 8.4.31. - [Release notes](https://github.com/postcss/postcss/releases) - [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md) - [Commits](https://github.com/postcss/postcss/compare/8.4.29...8.4.31) --- updated-dependencies: - dependency-name: postcss dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- search/search-dev-tools/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/search/search-dev-tools/package-lock.json b/search/search-dev-tools/package-lock.json index 763a88ade8..0d1ba2fa84 100644 --- a/search/search-dev-tools/package-lock.json +++ b/search/search-dev-tools/package-lock.json @@ -9052,9 +9052,9 @@ } }, "node_modules/postcss": { - "version": "8.4.29", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.29.tgz", - "integrity": "sha512-cbI+jaqIeu/VGqXEarWkRCCffhjgXc0qjBtXpqJhTBohMUjUQnbBr0xqX3vEKudc4iviTewcJo5ajcec5+wdJw==", + "version": "8.4.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", + "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", "dev": true, "funding": [ { From a6adfed701bfff720983b5f29235f7cf0cc20ac2 Mon Sep 17 00:00:00 2001 From: Luis Henrique Mulinari Date: Thu, 5 Oct 2023 14:59:09 -0300 Subject: [PATCH 4/4] Add potential multi-dataset logger (#4920) * Add potential multi dataset logger * Sanitize fields * Use esc_url_raw since sanitize_url is deprecated * Update prometheus-collectors/class-potential-multi-dataset-queries-collector.php Co-authored-by: Mohammad Jangda * Check if log2logstash is defined before calling it --------- Co-authored-by: Mohammad Jangda --- ...ential-multi-dataset-queries-collector.php | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/prometheus-collectors/class-potential-multi-dataset-queries-collector.php b/prometheus-collectors/class-potential-multi-dataset-queries-collector.php index 5ce2bc172d..dee8e78bac 100644 --- a/prometheus-collectors/class-potential-multi-dataset-queries-collector.php +++ b/prometheus-collectors/class-potential-multi-dataset-queries-collector.php @@ -4,6 +4,7 @@ use Prometheus\Counter; use Prometheus\RegistryInterface; +use function Automattic\VIP\Logstash\log2logstash; class Potential_Multi_Dataset_Queries_Collector implements CollectorInterface { private Counter $potential_multi_dataset_queries_collector; @@ -49,6 +50,27 @@ public function sql_query_log( $query ): void { $blog_ids_count >= 3 ? '3+' : (string) $blog_ids_count, ] ); + + if ( ! function_exists( '\Automattic\VIP\Logstash\log2logstash' ) ) { + return; + } + + $backtrace = function_exists( 'wp_debug_backtrace_summary' ) ? wp_debug_backtrace_summary( null, 4, false ) : []; // phpcs:ignore + \Automattic\VIP\Logstash\log2logstash( + [ + 'severity' => 'debug', + 'feature' => 'potential_multi_dataset_queries', + 'message' => 'Potential multi dataset query detected', + 'extra' => [ + 'uri' => isset( $_SERVER['REQUEST_URI'] ) ? esc_url_raw( $_SERVER['REQUEST_URI'] ) : '', + 'http_method' => isset( $_SERVER['REQUEST_METHOD'] ) ? sanitize_text_field( $_SERVER['REQUEST_METHOD'] ) : '', + 'backtrace' => $backtrace, + 'last_global_table' => $last_global_table, + 'last_blog_table' => $last_blog_table, + 'blog_ids_count' => $blog_ids_count, + ], + ] + ); } }