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

Sync User Profile Data with WPCOM on Admin Interface Change #37975

Closed
wants to merge 5 commits into from

Conversation

DustyReagan
Copy link
Member

@DustyReagan DustyReagan commented Jun 20, 2024

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

Copy link
Contributor

github-actions bot commented Jun 20, 2024

Thank you for your PR!

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

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Team Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ 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 🤖


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 github-actions bot added the [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! label Jun 20, 2024
@DustyReagan DustyReagan self-assigned this Jun 20, 2024
@DustyReagan DustyReagan changed the title Add/sync user profile Sync User Profile Data with WPCOM on Admin Interface Change Jun 20, 2024
@DustyReagan DustyReagan requested review from a team June 21, 2024 23:13
@DustyReagan DustyReagan added [Status] Needs Team Review and removed [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! labels Jun 21, 2024
@DustyReagan DustyReagan force-pushed the add/sync-user-profile branch from 02e186b to bb69f5e Compare June 24, 2024 21:53
okmttdhr
okmttdhr previously approved these changes Jun 25, 2024
Copy link
Member

@okmttdhr okmttdhr left a comment

Choose a reason for hiding this comment

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

Worked well on my end.
I would like @fushar to have a chance to review this PR as well.

@fushar fushar force-pushed the add/sync-user-profile branch from ec61729 to 6374f4f Compare June 25, 2024 06:44
@fushar
Copy link
Contributor

fushar commented Jun 25, 2024

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

@fushar
Copy link
Contributor

fushar commented Jun 25, 2024

@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) 🙏

@okmttdhr
Copy link
Member

okmttdhr commented Jun 25, 2024

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
Copy link
Member

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

Copy link
Member

@okmttdhr okmttdhr left a comment

Choose a reason for hiding this comment

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

I'm approving this PR to unblock it, as my tests went well :)

@DustyReagan
Copy link
Member Author

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
Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants