Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Staging release: v20231010.1 #4933

Merged
merged 12 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion http-concat
Submodule http-concat updated 1 files
+1 −1 concat-utils.php
5 changes: 0 additions & 5 deletions integrations/block-data-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,4 @@ public function load(): void {
}
} );
}

/**
* Configure `Block Data API` for VIP Platform.
*/
public function configure(): void {}
}
8 changes: 5 additions & 3 deletions integrations/integration.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,13 @@ abstract public function load(): void;

/**
* Configure the integration for VIP platform.
*
*
* If we want to implement functionality only if the integration is enabled via VIP
* then we will use this function.
*
*
* By default, the implementation of this function will be empty.
*
* @private
*/
abstract public function configure(): void;
public function configure(): void {}
}
5 changes: 0 additions & 5 deletions integrations/vip-governance.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,4 @@ public function load(): void {
}
} );
}

/**
* Configure `VIP Governance` for VIP Platform.
*/
public function configure(): void {}
}
42 changes: 21 additions & 21 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
],
]
);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ public function output() {
echo '</tfoot>';
$this->output_after_section();
}

$this->after_non_tabular_output();
}

$this->after_non_tabular_output();
}

/**
Expand Down
18 changes: 9 additions & 9 deletions search/search-dev-tools/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/integrations/test-vip-block-data-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function test__load_call_returns_inactive_because_no_block_data_api_plugi
$this->assertFalse( $block_data_api_integration->is_active() );
}

public function test__if_is_loaded_gives_back_true_when_loaded(): void {
public function test__if_is_loaded_gives_back_false_when_not_loaded(): void {
$block_data_api_integration = new BlockDataApiIntegration( $this->slug );

$this->assertFalse( $block_data_api_integration->is_loaded() );
Expand Down
2 changes: 1 addition & 1 deletion tests/integrations/test-vip-governance.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function test__load_call_returns_inactive_because_no_governance_plugin_lo
$this->assertFalse( $vip_governance_integration->is_active() );
}

public function test__if_is_loaded_gives_back_true_when_loaded(): void {
public function test__if_is_loaded_gives_back_false_when_not_loaded(): void {
$vip_governance_integration = new VipGovernanceIntegration( $this->slug );

$this->assertFalse( $vip_governance_integration->is_loaded() );
Expand Down
2 changes: 1 addition & 1 deletion vip-helpers/vip-permastructs.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function wpcom_vip_load_category_base( $new_category_base ) {
// For empty category base, remove the '/category/' from the base, but include the parent category if it's a child
if ( '' === $new_category_base ) {
add_filter( 'category_link', function ( $link, $term_id ) {
return '/' . get_category_parents( $term_id, false, '/', true );
return home_url( '/' . get_category_parents( $term_id, false, '/', true ) );
}, 9, 2 );
}
}
Expand Down
12 changes: 3 additions & 9 deletions vip-integrations.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,21 @@

namespace Automattic\VIP\Integrations;

// @codeCoverageIgnoreStart -- the actual code here is tested individually in the unit tests.
defined( 'ABSPATH' ) || die();

// @codeCoverageIgnoreStart - the actual code here is tested individually in the unit tests.

require_once __DIR__ . '/integrations/integration.php';
require_once __DIR__ . '/integrations/integrations.php';
require_once __DIR__ . '/integrations/enums.php';
require_once __DIR__ . '/integrations/integration-vip-config.php';
require_once __DIR__ . '/integrations/block-data-api.php';
require_once __DIR__ . '/integrations/parsely.php';
require_once __DIR__ . '/integrations/vip-governance.php';

// Register VIP integrations here.
IntegrationsSingleton::instance()->register( new BlockDataApiIntegration( 'block-data-api' ) );
IntegrationsSingleton::instance()->register( new ParselyIntegration( 'parsely' ) );

// ToDo: Remove this after the initial deployment of the VIP Governance integration.
if ( file_exists( __DIR__ . '/integrations/vip-governance.php' ) ) {
require_once __DIR__ . '/integrations/vip-governance.php';
IntegrationsSingleton::instance()->register( new VipGovernanceIntegration( 'vip-governance' ) );
}

IntegrationsSingleton::instance()->register( new VipGovernanceIntegration( 'vip-governance' ) );
// @codeCoverageIgnoreEnd

/**
Expand Down
Loading