jetpack icon indicating copy to clipboard operation
jetpack copied to clipboard

Sync User Profile Data with WPCOM on Admin Interface Change

Open DustyReagan opened this issue 1 year ago • 6 comments

Fixes https://github.com/Automattic/dotcom-forge/issues/7758

Proposed changes:

  • Syncs Atomic site's user profile data with WPCOM when the site admin interface changes from wp-admin to Default.

Other information:

  • [ ] Have you written new tests for your changes, if applicable?
  • [ ] Have you checked the E2E test CI results, and verified that your changes do not break them?
  • [ ] Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

Jetpack product discussion

No.

Does this pull request change what data or activity we track or use?

Testing instructions:

  • Load the /me/profile endpoint on your sandbox with D152947-code
  • Apply this PR to wpcomsh on your Atomic test site
  • Point your Atomic test site to the API on your sandbox by SSHing into your Atomic site and adding define( 'JETPACK__SANDBOX_DOMAIN', '<your_sandbox>' ); to your wp-config.php.
  • Make your site Classic and head to /wp-admin/profile.php
  • Customize these profile options and save them. Observe that your profile options only apply to your Atomic site.
  • Head to /wp-admin/options-general.php and change your interface to Default and then back to Classic. Switching from Classic to Default triggers the sync callback, makes the API call, and resets the Atomic data.
  • Go back to /wp-admin/profile.php and observe that all of the profile options have been reset to match the values on wpcom /me

DustyReagan avatar Jun 20 '24 23:06 DustyReagan

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • :white_check_mark: Include a description of your PR changes.
  • :white_check_mark: Add a "[Status]" label (In Progress, Needs Team Review, ...).
  • :white_check_mark: Add testing instructions.
  • :white_check_mark: Specify whether this PR includes any changes to data or privacy.
  • :white_check_mark: Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation :robot:


The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available.


Once your PR is ready for review, check one last time that all required checks appearing at the bottom of this PR are passing or skipped. Then, add the "[Status] Needs Team Review" label and ask someone from your team review the code. Once reviewed, it can then be merged. If you need an extra review from someone familiar with the codebase, you can update the labels from "[Status] Needs Team Review" to "[Status] Needs Review", and in that case Jetpack Approvers will do a final review of your PR.


Wpcomsh plugin:

  • Next scheduled release: July 2, 2024.
  • Scheduled code freeze: June 24, 2024.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

github-actions[bot] avatar Jun 20 '24 23:06 github-actions[bot]

I'm not sure why my last commit does not work... @okmttdhr do you have bandwidth to help investigate? 😭

fushar avatar Jun 25 '24 07:06 fushar

@okmttdhr I've exhausted everything and still can't make it work. If you also cannot, I think we can ask @DustyReagan to revert it (and return $new_value inside the filter) 🙏

fushar avatar Jun 25 '24 08:06 fushar

I observed the following on my end, and I believe this is expected behavior, am I correct? @fushar

  • With Classic interface, customize profile data on https://wordpress.com/me
  • Observe the updated profile data are not yet synced to /wp-admin/profile.php
  • Change Classic -> Default interface (sync should happen)
  • Change Default -> Classic interface
  • Observe the updated profile data are synced to /wp-admin/profile.php

I confirmed classic-sync-profile.php is latest on my rsynced WoA site.

okmttdhr avatar Jun 25 '24 08:06 okmttdhr

Another try with the admin color

  • With Classic interface, change the admin color to Blue on https://wordpress.com/me
  • Observe it is not reflected in /wp-admin/profile.php (Sunrise)
  • Change Classic -> Default interface
  • Observe the admin color is Blue
  • Change Default -> Classic interface
  • Observe the admin color is Blue

okmttdhr avatar Jun 25 '24 08:06 okmttdhr

Thanks for the reviews, @fushar and @okmttdhr! I'm sitting on this for the moment in case we decide not to sync with Calypso. p1719408055175869-slack-C06DN6QQVAQ

DustyReagan avatar Jun 26 '24 22:06 DustyReagan

I'm closing this PR because I feel it's unlikely we'll continue this route.

DustyReagan avatar Jul 03 '24 22:07 DustyReagan