-
Notifications
You must be signed in to change notification settings - Fork 339
Infrastructure/11740 playwright email reporting #12330
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
base: develop
Are you sure you want to change the base?
Changes from 21 commits
6ed84eb
49d77ca
9c82fa8
f5c626d
fc2f995
dd644fa
1c6f3e1
5ddbe53
810e8b4
c6ce9c6
af5e61c
4953064
ac42166
0b10193
26f8d77
11a84cb
9b5ab2b
582a1f9
3ea71af
abace2b
90c4041
1a2e820
f40bd07
998c3ee
7233d75
25c319a
2e0659b
e90497b
d5f350e
0dac238
2df9be9
55748e0
bc7882e
0947297
24f2fbb
76e11b2
5bed304
7c05388
cb7ffe8
c6245c3
446fc7b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,7 +41,6 @@ | |
|
|
||
| // Ensure every notice after the first notice has a margin | ||
| // so the notices don't render with no gap. | ||
| // | ||
|
||
| // See: https://github.com/google/site-kit-wp/issues/12279 | ||
| .googlesitekit-notice-container:nth-of-type(n + 2) { | ||
| margin-top: $grid-gap-phone; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -63,6 +63,16 @@ public static function create_client( array $args ) { | |
|
|
||
| $http_client = $client->getHttpClient(); | ||
| $http_client_config = self::get_http_client_config( $http_client->getConfig() ); | ||
|
|
||
| /** | ||
| * Filters the Guzzle HTTP client configuration used for Google API requests. | ||
| * | ||
| * @since n.e.x.t | ||
| * | ||
| * @param array $http_client_config Guzzle HTTP client configuration array. | ||
| */ | ||
| $http_client_config = apply_filters( 'googlesitekit_http_client_config', $http_client_config ); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd rather not add a filter just for use in E2E, but I'm not sure there is another way. Alternatively, we could conditionally only apply it in tests/e2e – WDYT?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unfortunately, i can't find another way how to do it.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After thinking about this some more, I think we can overload the access token value which we're already controlling with a filter in tests to use a plain
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice idea, updated.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, it turned out if we do it this way, auto-authorization stops working. I had to revert it to the previous approach with the filter. I think we can create a ticket to address this challenge separately. |
||
|
|
||
| // In Guzzle 6+, the HTTP client is immutable, so only a new instance can be set. | ||
| $client->setHttpClient( new Client( $http_client_config ) ); | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,7 @@ | |
| use DateTimeImmutable; | ||
| use Google\Site_Kit\Core\Util\BC_Functions; | ||
| use Google\Site_Kit\Core\User\Email_Reporting_Settings; | ||
| use Google\Site_Kit\Core\Util\Date; | ||
|
|
||
| /** | ||
| * Handles initiator cron callbacks for email reporting. | ||
|
|
@@ -61,14 +62,20 @@ public function __construct( Email_Reporting_Scheduler $scheduler, Subscribed_Us | |
| */ | ||
| public function handle_callback_action( $frequency, $scheduled_timestamp = null ) { | ||
| $timestamp = (int) $scheduled_timestamp; | ||
|
|
||
| if ( $timestamp <= 0 ) { | ||
| $timestamp = time(); | ||
| $timestamp = Date::now(); | ||
| } | ||
|
|
||
| $this->scheduler->schedule_next_initiator( $frequency, $timestamp ); | ||
|
|
||
| $batch_id = wp_generate_uuid4(); | ||
| /** | ||
| * Filter the unique ID to use for the current batch of emails. | ||
| * | ||
| * @since n.e.x.t | ||
| * | ||
| * @param string $batch_id The batch ID. | ||
| */ | ||
| $batch_id = apply_filters( 'googlesitekit_email_reporting_batch_id', wp_generate_uuid4() ); | ||
|
||
| $user_ids = $this->subscribed_users_query->for_frequency( $frequency ); | ||
|
|
||
| $reference_dates = self::build_reference_dates( $frequency, $timestamp ); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.