woocommerce / google-listings-and-ads

Sync your store with Google to list products for free, run paid ads, and track performance straight from your store dashboard.
https://woo.com/products/google-listings-and-ads/
GNU General Public License v3.0
44 stars 21 forks source link

[API Pull] Enable notifications by default #2448

Closed puntope closed 1 month ago

puntope commented 1 month ago

Changes proposed in this Pull Request:

This is a follow-up from this conversation p1719565119808809-slack-C02BB3F30TG

The PR enables Notifications feature by default

Detailed test instructions:

  1. Checkout this PR
  2. Complete setup
  3. Grant access to Data fetch in Settings
  4. Go to the connection test page
  5. Send a notification and verify it works
  6. Add this filter add_filter( 'woocommerce_gla_notifications_enabled', '__return_false' );
  7. Send a notification and verify it fails

Additional details:

Changelog entry

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 45.45455% with 6 lines in your changes missing coverage. Please review.

Project coverage is 64.4%. Comparing base (dc34f56) to head (d47c264). Report is 1 commits behind head on feature/google-api-project.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/woocommerce/google-listings-and-ads/pull/2448/graphs/tree.svg?width=650&height=150&src=pr&token=UROWUPF1LX&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=woocommerce)](https://app.codecov.io/gh/woocommerce/google-listings-and-ads/pull/2448?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=woocommerce) ```diff @@ Coverage Diff @@ ## feature/google-api-project #2448 +/- ## ============================================================== - Coverage 64.7% 64.4% -0.3% - Complexity 4550 4551 +1 ============================================================== Files 473 795 +322 Lines 17747 22796 +5049 Branches 0 1219 +1219 ============================================================== + Hits 11483 14688 +3205 - Misses 6264 7941 +1677 - Partials 0 167 +167 ``` | [Flag](https://app.codecov.io/gh/woocommerce/google-listings-and-ads/pull/2448/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=woocommerce) | Coverage Δ | | |---|---|---| | [js-unit-tests](https://app.codecov.io/gh/woocommerce/google-listings-and-ads/pull/2448/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=woocommerce) | `63.5% <ø> (?)` | | | [php-unit-tests](https://app.codecov.io/gh/woocommerce/google-listings-and-ads/pull/2448/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=woocommerce) | `64.7% <45.5%> (-<0.1%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=woocommerce#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/woocommerce/google-listings-and-ads/pull/2448?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=woocommerce) | Coverage Δ | | |---|---|---| | [src/API/WP/NotificationsService.php](https://app.codecov.io/gh/woocommerce/google-listings-and-ads/pull/2448?src=pr&el=tree&filepath=src%2FAPI%2FWP%2FNotificationsService.php&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=woocommerce#diff-c3JjL0FQSS9XUC9Ob3RpZmljYXRpb25zU2VydmljZS5waHA=) | `95.1% <100.0%> (ø)` | | | [src/MerchantCenter/AccountService.php](https://app.codecov.io/gh/woocommerce/google-listings-and-ads/pull/2448?src=pr&el=tree&filepath=src%2FMerchantCenter%2FAccountService.php&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=woocommerce#diff-c3JjL01lcmNoYW50Q2VudGVyL0FjY291bnRTZXJ2aWNlLnBocA==) | `98.3% <100.0%> (+<0.1%)` | :arrow_up: | | [src/ConnectionTest.php](https://app.codecov.io/gh/woocommerce/google-listings-and-ads/pull/2448?src=pr&el=tree&filepath=src%2FConnectionTest.php&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=woocommerce#diff-c3JjL0Nvbm5lY3Rpb25UZXN0LnBocA==) | `0.0% <0.0%> (ø)` | | ... and [322 files with indirect coverage changes](https://app.codecov.io/gh/woocommerce/google-listings-and-ads/pull/2448/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=woocommerce)
puntope commented 1 month ago

Hi @jorgemd24 I tweaked the code based on your comments. I also added some info in the Connection Test. Can we have a new look?