Repository navigation
chore: remove error logger from mailchimp - #4444
Conversation
Summary by CodeRabbit
WalkthroughThe update modifies the logging behavior in the Mailchimp email existence check utility. The log statement no longer includes the error message from the HTTP response and instead outputs a fixed message when an email does not exist. Changes
Suggested reviewers
Suggestion: ✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/v0/destinations/mailchimp/utils.js (2)
177-177: Fix grammar in log message.The log message contains a grammatical error. "Email does not exists" should be "Email does not exist".
- logger.info(`[Mailchimp] :: Email does not exists.`); + logger.info(`[Mailchimp] :: Email does not exist.`);
176-179: Consider improving error handling logic.The current implementation assumes all HTTP failures indicate that the email doesn't exist, which may not be accurate. HTTP failures could occur due to network issues, authentication problems, rate limiting, or other API errors unrelated to email existence.
Consider differentiating between different types of HTTP errors to provide more accurate feedback and potentially retry-able vs non-retry-able errors.
if (!httpResponse.success) { - logger.info(`[Mailchimp] :: Email does not exist.`); + const statusCode = httpResponse.response?.status || 'unknown'; + if (statusCode === 404) { + logger.info(`[Mailchimp] :: Email does not exist.`); + } else { + logger.warn(`[Mailchimp] :: Failed to check email existence. Status: ${statusCode}`); + } return userStatus; }
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/v0/destinations/mailchimp/utils.js(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.js`: Focus on ESLint errors (max 3) and warnings (max 5).
**/*.js: Focus on ESLint errors (max 3) and warnings (max 5).
⚙️ Source: CodeRabbit Configuration File
List of files the instruction was applied to:
src/v0/destinations/mailchimp/utils.js
🧠 Learnings (2)
📓 Common learnings
Learnt from: utsabc
PR: rudderlabs/rudder-transformer#2852
File: src/v0/destinations/sfmc/transform.js:0-0
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The user has indicated that a previously mentioned grammatical error in an error message has been addressed.
Learnt from: utsabc
PR: rudderlabs/rudder-transformer#2852
File: src/v0/destinations/sfmc/transform.js:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The user has indicated that a previously mentioned grammatical error in an error message has been addressed.
Learnt from: utsabc
PR: rudderlabs/rudder-transformer#2852
File: src/v0/destinations/sfmc/transform.js:0-0
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The error message "Creating or updating contacts is disabled" has been updated to be more descriptive, including guidance on how to enable the feature if necessary.
Learnt from: utsabc
PR: rudderlabs/rudder-transformer#2852
File: src/v0/destinations/sfmc/transform.js:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The error message "Creating or updating contacts is disabled" has been updated to be more descriptive, including guidance on how to enable the feature if necessary.
src/v0/destinations/mailchimp/utils.js (4)
Learnt from: krishna2020
PR: rudderlabs/rudder-transformer#4178
File: src/sources/shopify/transform.js:37-45
Timestamp: 2025-03-21T12:32:28.443Z
Learning: The getBodyFromV2SpecPayload function in Shopify source transformation throws an error if request is not defined, making additional null checks in getEventFromV2Request function unnecessary.
Learnt from: krishna2020
PR: rudderlabs/rudder-transformer#4178
File: src/sources/shopify/transform.js:37-45
Timestamp: 2025-03-21T12:32:28.443Z
Learning: The getBodyFromV2SpecPayload function in the Shopify source throws an error if request is not defined, making additional null checks in getEventFromV2Request function unnecessary.
Learnt from: utsabc
PR: rudderlabs/rudder-transformer#2852
File: src/v0/destinations/sfmc/transform.js:0-0
Timestamp: 2024-07-27T07:02:57.329Z
Learning: The user has indicated that a previously mentioned grammatical error in an error message has been addressed.
Learnt from: utsabc
PR: rudderlabs/rudder-transformer#2852
File: src/v0/destinations/sfmc/transform.js:0-0
Timestamp: 2024-10-08T15:52:59.819Z
Learning: The user has indicated that a previously mentioned grammatical error in an error message has been addressed.
⏰ Context from checks skipped due to timeout of 90000ms (9)
- GitHub Check: Check PR Title
- GitHub Check: Build Transformer Docker Image - PR / Build Transformer Docker Image AMD64
- GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image AMD64
- GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image ARM64
- GitHub Check: Code Coverage
- GitHub Check: test_and_publish
- GitHub Check: UT Tests
- GitHub Check: Analyze (go)
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (1)
src/v0/destinations/mailchimp/utils.js (1)
176-179: Verify alignment with PR objectives.The PR objectives mention that "Instead of logging the error silently, the error response is now thrown as an error, making it visible to the customer." However, the current implementation still logs the message and returns a default status rather than throwing an error.
Please confirm if this change aligns with the intended behavior described in the PR objectives.
|
Allure Test reports for this run are available at:
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #4444 +/- ##
========================================
Coverage 91.14% 91.14%
========================================
Files 638 638
Lines 33484 33483 -1
Branches 7903 7909 +6
========================================
Hits 30519 30519
+ Misses 2726 2695 -31
- Partials 239 269 +30 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|



What are the changes introduced in this PR?
We are updating the error log to print the error response of the lookup on Mailchimp that might contain the email address used for the lookup. We are throwing an error with the response so it should be visible by the customer.
What is the related Linear task?
Resolves INT-3782
Please explain the objectives of your changes below
Put down any required details on the broader aspect of your changes. If there are any dependent changes, mandatorily mention them here
Any changes to existing capabilities/behaviour, mention the reason & what are the changes ?
N/A
Any new dependencies introduced with this change?
N/A
Any new generic utility introduced or modified. Please explain the changes.
N/A
Any technical or performance related pointers to consider with the change?
N/A
@coderabbitai review
Developer checklist
My code follows the style guidelines of this project
No breaking changes are being introduced.
All related docs linked with the PR?
All changes manually tested?
Any documentation changes needed with this change?
Is the PR limited to 10 file changes?
Is the PR limited to one linear task?
Are relevant unit and component test-cases added in new readability format?
Reviewer checklist
Is the type of change in the PR title appropriate as per the changes?
Verified that there are no credentials or confidential data exposed with the changes.