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

fix: handle missing Mailchimp API key #1636

Merged
merged 1 commit into from
Sep 3, 2024
Merged

Conversation

adekbadek
Copy link
Member

All Submissions:

Changes proposed in this Pull Request:

Fixes an issue with fetching MC data while an API key is not set.

How to test the changes in this Pull Request:

  1. On trunk,
  2. Remove the newspack_mailchimp_api_key option
  3. Run wp eval "\Newspack_Newsletters_Mailchimp_Cached_Data::fetch_segments( '<mc-list-id>' );"* - observe a PHP Fatal is logged
  4. Switch to this branch, trigger the command again, observe no error logged

* you can find a valid MC list id by looking up a post_type=newspack_nl_list post's _remote_id post meta

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@adekbadek adekbadek requested a review from a team as a code owner August 30, 2024 09:11
Copy link

codecov bot commented Aug 30, 2024

Codecov Report

Attention: Patch coverage is 33.33333% with 20 lines in your changes missing coverage. Please review.

Project coverage is 20.79%. Comparing base (4f206ff) to head (d53837b).
Report is 5 commits behind head on trunk.

Files with missing lines Patch % Lines
...ass-newspack-newsletters-mailchimp-cached-data.php 31.03% 20 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##              trunk    #1636      +/-   ##
============================================
+ Coverage     20.72%   20.79%   +0.07%     
- Complexity     2378     2386       +8     
============================================
  Files            46       46              
  Lines          8927     8948      +21     
============================================
+ Hits           1850     1861      +11     
- Misses         7077     7087      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions github-actions bot added [Status] Approved Ready to merge and removed [Status] Needs Review labels Sep 2, 2024
@adekbadek adekbadek merged commit 83a0d6f into trunk Sep 3, 2024
10 checks passed
@adekbadek adekbadek deleted the fix/mc-api-no-api-key branch September 3, 2024 08:53
@matticbot
Copy link
Contributor

🎉 This PR is included in version 3.2.0-alpha.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@matticbot
Copy link
Contributor

🎉 This PR is included in version 3.2.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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