jetpack icon indicating copy to clipboard operation
jetpack copied to clipboard

Social | Update initial state logic to use the new endpoints

Open manzoorwanijk opened this issue 1 year ago • 9 comments

Currently, the initial state for connections management UI uses the old endpoint for connection test results which we need to update.

Proposed changes:

  • Change the connection test results endpoint from /jetpack/v4/publicize/connection-test-results to jetpack/v4/publicize/connections based on the feature flag.
  • Fix the shared prop not populated in the editor initial state.
  • Updated the initial state fields for WPCOM endpoint

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

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

Testing instructions:

  • Ensure that feature flag is ON - define( 'JETPACK_SOCIAL_USE_ADMIN_UI_V1', true );
  • Test the following for both Jetpack and Social plugin and for the editor
    • Goto connections management UI
    • In the network tab, confirm that the connection test results request calls the new endpoint - jetpack/v4/publicize/connections?test_connections=1
    • For editor, confirm that shared connections are shown as such before the connection test results request finishes. This was not the case in trunk
    • Confirm that this works as expected in WPCOM editor

manzoorwanijk avatar May 24 '24 10:05 manzoorwanijk

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WordPress.com Simple site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin, and enable the update/social/use-new-endpoint-for-connection-test-results branch.

  • To test on Simple, run the following command on your sandbox:

    bin/jetpack-downloader test jetpack update/social/use-new-endpoint-for-connection-test-results
    

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

github-actions[bot] avatar May 24 '24 10:05 github-actions[bot]

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.


Jetpack plugin:

The Jetpack plugin has different release cadences depending on the platform:

  • WordPress.com Simple releases happen daily.
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly. The next release is scheduled for June 4, 2024 (scheduled code freeze on June 3, 2024).

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


Social plugin:

  • Next scheduled release: June 4, 2024.
  • Scheduled code freeze: May 27, 2024.

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

github-actions[bot] avatar May 24 '24 10:05 github-actions[bot]

I know this is not a big PR, but I think it's better to break this down into separate PRs and keep things specific.

The changes in the projects/plugins/social/src/class-jetpack-social.php can be a PR of its own and post-field-connections change can be a PR of its own.

I say that because in case we have to revert this, we wouldn't want to revert the whole thing, given that post-fields-connections lives in multiple places and we should be careful whenever we tweak it.

spsiddarthan avatar May 24 '24 10:05 spsiddarthan

I know this is not a big PR, but I think it's better to break this down into separate PRs and keep things specific.

The changes in the projects/plugins/social/src/class-jetpack-social.php can be a PR of its own and post-field-connections change can be a PR of its own.

I say that because in case we have to revert this, we wouldn't want to revert the whole thing, given that post-fields-connections lives in multiple places and we should be careful whenever we tweak it.

It's all about initial state. I think it's better to make this change together.

manzoorwanijk avatar May 24 '24 11:05 manzoorwanijk

It's all about initial state. I think it's better to make this change together.

I think we should proceed with caution, I feel this is a risky change to be bundled together. How are we using the new endpoint in the post-field-connections change?

I recommend breaking this down and also in general, get into the habit of making small specific PRs.

spsiddarthan avatar May 24 '24 11:05 spsiddarthan

@spsiddarthan thank you for your inputs. I have extracted WPCOM related changes to #37532

manzoorwanijk avatar May 24 '24 11:05 manzoorwanijk

Thank you so much for breaking it down, I appreciate it. 🙌

I had a few thoughts, don't hate me please:

  • I think the connection results bit can be merged right away, if we can have the PR with that as the only change.

  • Should we also make the publicize package connections-field change in https://github.com/Automattic/jetpack/pull/37532/files or will that be a PR of its own? The post field connections change may not be a Friday evening merge, particularly if things get deployed to WPCOM.

spsiddarthan avatar May 24 '24 11:05 spsiddarthan

I had a few thoughts, don't hate me please:

  • I think the connection results bit can be merged right away, if we can have the PR with that as the only change.
  • Should we also make the publicize package change in https://github.com/Automattic/jetpack/pull/37532/files or will that be a PR of its own? The post field connections change may not be a Friday evening merge, particularly if things get deployed to WPCOM.

Connection test results change is what you see in publicize and social initial state. JS changes are pretty much optional here.

manzoorwanijk avatar May 24 '24 11:05 manzoorwanijk

Connection test results change is what you see in publicize and social initial state.

Thanks, for some reason in my head, I kept the editor changes separate from the admin page ones, but what you're fixing is the initial state for both things. Makes sense.

spsiddarthan avatar May 24 '24 11:05 spsiddarthan

These work well. If you have tested this for sanity on simple and atomic, go for it. The initial state is different based on the feature flag/blog sticker, no?

Tested just now. All good.

manzoorwanijk avatar May 27 '24 05:05 manzoorwanijk