Skip to content

Pressable Sync: Mark Pressable sites as syncable #1212

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

Open
wants to merge 6 commits into
base: trunk
Choose a base branch
from

Conversation

ivan-ottinger
Copy link
Contributor

@ivan-ottinger ivan-ottinger commented Apr 15, 2025

Related issues

  • Resolves STU-343-linear-issue

Proposed Changes

  • get hosting_provider_guess value from the me/sites/ endpoint (behind the pressableSyncEnabled feature flag)
  • mark all Pressable sites as syncable
  • refactor logic that marks site as syncable
Before After
Markup on 2025-04-16 at 17:47:30 Markup on 2025-04-16 at 17:46:16

Note

The presence of the Production badge is a matter of discussion: STU-320-linear-issue#comment-de01edcd. Regardless, we can tackle it in a separate PR.

Note

Once this PR is merged, I am planning to follow up with #1229 where I would like to clean up site sync states.

Testing Instructions

  1. Create a couple of test Pressable sites on https://pressable.com and connect them to your WordPress.com account which you are using in Studio as well.
  2. Check out the PR branch and build the app with STUDIO_PRESSABLE_SYNC=true npm start.
  3. Head over to the Sync tab on any local Studio site and click on the Connect site button.
  4. Search for your Pressable sites. It should be possible to connect any of them to your local Studio site.
  5. If you build the app with npm start only, it shouldn't be possible to connect those same Pressable sites. Everything else should work normally.

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

@ivan-ottinger ivan-ottinger self-assigned this Apr 15, 2025
@ivan-ottinger ivan-ottinger changed the title Pressable Sync: Add hosting provider check for Pressable sites in wpcom site fetching logic Pressable Sync: Mark Pressable sites as syncable Apr 16, 2025
@ivan-ottinger ivan-ottinger marked this pull request as ready for review April 16, 2025 15:48
@ivan-ottinger ivan-ottinger requested a review from a team April 16, 2025 15:51
Copy link
Contributor

@epeicher epeicher left a comment

Choose a reason for hiding this comment

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

I have reviewed it, and it works as advertised. I can find and connect my Pressable sites that have a Jetpack connection. Changes LGTM! :shipit:

List connections Click connect
CleanShot 2025-04-16 at 18 32 35@2x CleanShot 2025-04-16 at 18 44 49@2x

A couple of notes that seem unrelated to this change is that if I close and open Studio again, the pressable sites gets disconnected and I need to Reconnect again:

Close and open Studio
CleanShot 2025-04-16 at 18 46 37@2x

If I try to either Push or Pull, I get an error:

Error with Push and Pull
CleanShot 2025-04-16 at 18 41 23@2x

The issues mentioned are not related to making the Pressable sites as syncables, that is why I think this PR can progress

@epeicher
Copy link
Contributor

Quick comment to add that running Studio with npm start (i.e. without the feature flag) does not allow to sync pressable sites as expected ✅
CleanShot 2025-04-16 at 18 51 38@2x

@ivan-ottinger
Copy link
Contributor Author

Thank you for your review, @epeicher.

A couple of notes that seem unrelated to this change is that if I close and open Studio again, the pressable sites gets disconnected and I need to Reconnect again:

That's actually a very good catch! I considered fixing this in a separate PR, but it was quite related to the logic introduced in this PR so I applied the change in 840c206 (together with moving the feature flag to the actual API request).


If I try to either Push or Pull, I get an error:

The issues mentioned are not related to making the Pressable sites as syncables, that is why I think this PR can progress

Yes, I agree, we can take a look at it as a part of the Push / Pull tasks we have in Linear. 🙂

@ivan-ottinger ivan-ottinger requested a review from epeicher April 17, 2025 12:21
@ivan-ottinger
Copy link
Contributor Author

Once this PR is merged, I am planning to follow up with #1229 where I would like to clean up site sync states.

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.

2 participants