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

Check for gathering data state in Search Console and Analytics before showing User Input notification. #7198

Merged
merged 25 commits into from
Jul 11, 2023

Conversation

tofumatt
Copy link
Collaborator

@tofumatt tofumatt commented Jun 23, 2023

Summary

Please note that @techanvil has picked up the implementation here, and as mentioned in this comment, the original change that Matt wrote needed to be redone anyway due to changes in develop. Therefore, please assign to @techanvil to address any code review feedback.

Addresses issue:

Relevant technical choices

PR Author Checklist

  • My code is tested and passes existing unit tests.
  • My code has an appropriate set of unit tests which all pass.
  • My code is backward-compatible with WordPress 5.2 and PHP 5.6.
  • My code follows the WordPress coding standards.
  • My code has proper inline documentation.
  • I have added a QA Brief on the issue linked above.
  • I have signed the Contributor License Agreement (see https://cla.developers.google.com/).

Do not alter or remove anything below. The following sections will be managed by moderators only.

Code Reviewer Checklist

  • Run the code.
  • Ensure the acceptance criteria are satisfied.
  • Reassess the implementation with the IB.
  • Ensure no unrelated changes are included.
  • Ensure CI checks pass.
  • Check Storybook where applicable.
  • Ensure there is a QA Brief.

Merge Reviewer Checklist

  • Ensure the PR has the correct target branch.
  • Double-check that the PR is okay to be merged.
  • Ensure the corresponding issue has a ZenHub release assigned.
  • Add a changelog message to the issue.

@github-actions
Copy link

github-actions bot commented Jun 23, 2023

Build files for 4bc8ad5 have been deleted.

@github-actions
Copy link

github-actions bot commented Jun 23, 2023

Size Change: +866 B (0%)

Total Size: 1.39 MB

Filename Size Change
./dist/assets/js/googlesitekit-activation-********************.js 24.1 kB +3 B (0%)
./dist/assets/js/googlesitekit-ad-blocking-recovery-********************.js 52.1 kB +35 B (0%)
./dist/assets/js/googlesitekit-adminbar-********************.js 33 kB +14 B (0%)
./dist/assets/js/googlesitekit-api-********************.js 9.88 kB +1 B (0%)
./dist/assets/js/googlesitekit-components-gm2-********************.js 5.34 kB +2 B (0%)
./dist/assets/js/googlesitekit-components-gm3-********************.js 9.99 kB +1 B (0%)
./dist/assets/js/googlesitekit-data-********************.js 2.17 kB -5 B (0%)
./dist/assets/js/googlesitekit-datastore-forms-********************.js 9.29 kB -1 B (0%)
./dist/assets/js/googlesitekit-datastore-location-********************.js 2.09 kB -2 B (0%)
./dist/assets/js/googlesitekit-datastore-site-********************.js 16.5 kB +1 B (0%)
./dist/assets/js/googlesitekit-datastore-ui-********************.js 9.4 kB +1 B (0%)
./dist/assets/js/googlesitekit-datastore-user-********************.js 23.3 kB +4 B (0%)
./dist/assets/js/googlesitekit-entity-dashboard-********************.js 66.4 kB +13 B (0%)
./dist/assets/js/googlesitekit-main-dashboard-********************.js 80.1 kB +7 B (0%)
./dist/assets/js/googlesitekit-modules-adsense-********************.js 105 kB +4 B (0%)
./dist/assets/js/googlesitekit-modules-analytics-4-********************.js 58.9 kB +512 B (+1%)
./dist/assets/js/googlesitekit-modules-analytics-********************.js 88.2 kB -25 B (0%)
./dist/assets/js/googlesitekit-modules-********************.js 21.6 kB -2 B (0%)
./dist/assets/js/googlesitekit-modules-optimize-********************.js 20.6 kB +9 B (0%)
./dist/assets/js/googlesitekit-modules-search-console-********************.js 53.5 kB -11 B (0%)
./dist/assets/js/googlesitekit-modules-tagmanager-********************.js 32.4 kB -10 B (0%)
./dist/assets/js/googlesitekit-settings-********************.js 49.5 kB +17 B (0%)
./dist/assets/js/googlesitekit-splash-********************.js 67.1 kB +69 B (0%)
./dist/assets/js/googlesitekit-user-input-********************.js 42 kB +18 B (0%)
./dist/assets/js/googlesitekit-vendor-********************.js 312 kB +13 B (0%)
./dist/assets/js/googlesitekit-widgets-********************.js 20.4 kB +179 B (+1%)
./dist/assets/js/googlesitekit-wp-dashboard-********************.js 62.9 kB +18 B (0%)
./dist/assets/js/runtime-********************.js 1.3 kB +1 B (0%)
ℹ️ View Unchanged
Filename Size
./dist/assets/css/googlesitekit-admin-css-********************.min.css 50.4 kB
./dist/assets/css/googlesitekit-adminbar-css-********************.min.css 11.2 kB
./dist/assets/css/googlesitekit-wp-dashboard-css-********************.min.css 7.55 kB
./dist/assets/js/30-********************.js 2.8 kB
./dist/assets/js/31-********************.js 2.28 kB
./dist/assets/js/32-********************.js 3.72 kB
./dist/assets/js/33-********************.js 929 B
./dist/assets/js/34-********************.js 888 B
./dist/assets/js/35-********************.js 3.12 kB
./dist/assets/js/analytics-advanced-tracking-********************.js 769 B
./dist/assets/js/googlesitekit-i18n-********************.js 3.92 kB
./dist/assets/js/googlesitekit-modules-pagespeed-insights-********************.js 21.4 kB
./dist/assets/js/googlesitekit-polyfills-********************.js 378 B

compressed-size-action

Copy link
Collaborator

@techanvil techanvil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, nice one @tofumatt!

Copy link
Collaborator

@techanvil techanvil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tofumatt, apologies as I hit approve and then noticed that the E2E tests are failing on a user input test. Please can you take a look?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note, UserInputSettings has been removed and the specified change needs to be applied to KeyMetricsSetupCTAWidget instead. See this PR and related comment for more details.

@@ -49,6 +50,18 @@ export function fetchMockSaveSettings() {
);
}

export function fetchMockSaveDataAvailable() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is added to prevent warnings in stories about POSTing to the data-available endpoint once the gathering data state has been determined.

Copy link
Collaborator

@nfmohit nfmohit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the brilliant work here, @tofumatt & @techanvil! 👍

@techanvil Regarding the tests and stories, I've left a couple of very nitpicky comments/questions which once addressed, this should be good to go.

Thank you!

Comment on lines +130 to +135
body: JSON.stringify(
getAnalytics4MockResponse(
// Some of the keys are nested paths e.g. `metrics[0][name]`, so we need to convert the search params to a multi-dimensional object.
getMultiDimensionalObjectFromParams( paramsObject )
)
),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🏆 👍

@nfmohit nfmohit requested a review from techanvil July 10, 2023 14:26
} );

it( 'does render the CTA when SC and GA4 are both connected', async () => {
global._googlesitekitUserData.isUserInputCompleted = false;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is no longer needed, just setting the flag via the action below now works.

Comment on lines +61 to +64
invariant(
isGatheringData !== true,
"Analytics 4 gathering data's `true` state relies on the current authentication and selected property state so is unreliable to set from a helper, and therefore unsupported."
);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🏆 👍

Copy link
Collaborator

@nfmohit nfmohit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the brilliant work here, LGTM, thanks! 👍

Copy link
Collaborator Author

@tofumatt tofumatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good—reviewing since the PR was re-done by Tom 🙂

@tofumatt tofumatt merged commit 032ff37 into develop Jul 11, 2023
@tofumatt tofumatt deleted the fix/6607 branch July 11, 2023 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants