Skip to content

chore: remove error logger from mailchimp - #4444

Merged
ItsSudip merged 1 commit into
developfrom
chore/updateMailchimpErrorLog
Jul 1, 2025
Merged

ItsSudip merged 1 commit into
developfrom
chore/updateMailchimpErrorLog

Conversation

@ItsSudip

@ItsSudip ItsSudip commented Jun 30, 2025 •

Copy link
Copy Markdown
Member

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.

@ItsSudip
ItsSudip requested a review from a team as a code owner June 30, 2025 11:47
@coderabbitai

coderabbitai Bot commented Jun 30, 2025 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Bug Fixes
    • Improved logging for Mailchimp email existence checks by removing detailed error messages from log outputs.

Walkthrough

The 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

File(s) Change Summary
src/v0/destinations/mailchimp/utils.js Updated log statement to remove error message details from HTTP response logs.

Suggested reviewers

  • sivashanmukh

Suggestion:
Consider retaining some context from the error (such as an error code) if it aids debugging, while still avoiding sensitive or verbose details in logs.

✨ Finishing Touches
  • 📝 Generate Docstrings

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Comment thread src/v0/destinations/mailchimp/utils.js Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between fa8e0c4 and 78f6846.

📒 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.

@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

Allure Test reports for this run are available at:

@codecov

codecov Bot commented Jun 30, 2025 •

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.14%. Comparing base (bca73c4) to head (78f6846).
Report is 6 commits behind head on develop.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sonarqubecloud

Copy link
Copy Markdown

@ItsSudip ItsSudip changed the title chore: remove errior logger from mailchimp chore: remove error logger from mailchimp Jul 1, 2025
@ItsSudip
ItsSudip merged commit dff3702 into develop Jul 1, 2025
@ItsSudip
ItsSudip deleted the chore/updateMailchimpErrorLog branch July 1, 2025 05:03
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.

6 participants