Automattic / wc-calypso-bridge

20 stars 4 forks source link

Cleaning up the Bridge, Pt II #885

Open xristos3490 opened 1 year ago

xristos3490 commented 1 year ago

Description

This epic aims to organize the work for cleaning up obsolete bits and pieces in the Bridge and help us better manage our features and tweaks into multiple site plans.

The workstream will span into three phases:

  1. Cleaning up the "store-on-wpcom" project
  2. Cleaning up the "ecommerce" project
  3. Implementing a plans-router controller for feature gating

Phase 1: Cleaning up the "store-on-wpcom" project

Given that this codebase is currently running live, it would be best to take a step back and carefully assess this cleanup in small parts.

Removals that are already taken care of elsewhere and were clearly obsolete

Here's the list of the cleanup RPs:

Relatively straightforward removals

Here's the list of the cleanup RPs:

Features to consider adding to all plans

Two features only run on Business sites, and adding them to all plans seems reasonable.

1. Cleaning up the MailChimp queues and abandoned carts in the DB

Ref code: https://github.com/Automattic/wc-calypso-bridge/blob/master/store-on-wpcom/inc/wc-calypso-bridge-mailchimp-deactivate-hook.php This fix cleans up MailChimp queue tables after the plugin gets deactivated.

It is a defensive action to reduce DB bloat--It may make sense to keep it. Thoughts?

2. Handling the DB auto-update feature

Ref code: https://github.com/Automattic/wc-calypso-bridge/blob/master/store-on-wpcom/inc/wc-calypso-bridge-enable-auto-update-db.php We enable DB auto updates on Business sites. There is no similar filter for Ecommerce sites. Should we keep this feature and allow it for all plans?

Removals that require attention

These five features seemed to be the only ones that looked interesting. Please note that all are currently running on Business sites with WooCommerce installed.

Here's the list of features for discussion:

1. Existing REST API routes

Ref code: https://github.com/Automattic/wc-calypso-bridge/tree/master/store-on-wpcom/api We expose the following REST endpoints:

Is this removal safe? Is there a chance of using any of them elsewhere?

2. Fixing the REST API payment gateways' defaults

There are a few fixes for the default values of the payment gateways' settings. It seems like an obsolete feature related to the "store-on-wpcom" project. Thoughts? My best guess is that these aim to fix a pristine DB state to, e.g., return enabled=>'no' instead of enabled=>'', to help with JS application states. Note that there are no similar fixes in the Ecommerce plan currently. Should we remove it? Ref code #1 for BACS, Ref code #2 for Cheques, Ref code #3 for Paypal

3. Handling the __createdvia meta for products

Ref code: https://github.com/Automattic/wc-calypso-bridge/blob/master/store-on-wpcom/inc/wc-calypso-bridge-products.php This feature adds the _created_via tracking meta in the product creation flow, but it only handles the calypso value ref when the URL contains the &_via_calypso param. Note that WC core only uses the _created_via meta on Orders. Should we remove this?

4. Handling Jetpack sync in WC-related REST requests

Ref code: https://github.com/Automattic/wc-calypso-bridge/blob/master/store-on-wpcom/inc/wc-calypso-bridge-jetpack-hotfixes.php Another feature that runs on Business sites. It disables jetpack sync during rest requests to avoid lengthly (> 5 seconds) response times during the shutdown action for things like product creation.

5. Handling Jetpack's publicize feature in products

Ref code: https://github.com/Automattic/wc-calypso-bridge/blob/master/store-on-wpcom/inc/wc-calypso-bridge-disable-publicize.php This fix aims to disable the Publicize tool for products. What's the status of this tool? Is it deprecated/renamed? Should we consider handling the product exclusion here in all plans? Note: Publicize is now called “auto-sharing” and is a feature of Jetpack Social.

Phase 2: Cleaning up the "ecommerce" project

TBA

Phase 3: Implementing a plans-router controller for feature gating

TBA

manospsyx commented 1 year ago

@xristos3490 did you mean to close this?

warrendholmes commented 1 year ago

@xristos3490 Is this work happening?

xristos3490 commented 1 year ago

@warrendholmes The "ecommerce" part is done. The cleaning of "store-on-wpcom" it's on hold due to the risk we identified during the process. I've written a comment here pdqkbG-2ft-p2#comment-1325