Skip to content

chore(release): pull main into develop post release v1.126.2#5048

Open
devops-github-rudderstack wants to merge 4 commits intodevelopfrom
main
Open

chore(release): pull main into develop post release v1.126.2#5048
devops-github-rudderstack wants to merge 4 commits intodevelopfrom
main

Conversation

@devops-github-rudderstack
Copy link
Contributor

👑 An automated PR

web-flow and others added 4 commits March 10, 2026 10:52
👑 *An automated PR*

---------

Co-authored-by: Sudip Paul <67197965+ItsSudip@users.noreply.github.com>
Co-authored-by: GitHub Actions <noreply@github.com>
👑 *An automated PR*

---------

Co-authored-by: Sudip Paul <67197965+ItsSudip@users.noreply.github.com>
Co-authored-by: GitHub Actions <noreply@github.com>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 16, 2026

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized key(s) in object: 'auto_resolve_threads'
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Summary by CodeRabbit

  • Bug Fixes

    • Enhanced error logging for Facebook Lead Ads API failures with detailed status information.
    • Improved property access safety in Mixpanel integration to prevent null reference errors.
  • Improvements

    • Refined email field handling in Iterable and Shopify integrations for better user identification.
    • Strengthened email validation in checkout flows to ensure proper user context propagation.
  • Tests

    • Expanded error-handling test coverage for API responses across multiple integrations.
    • Added validation tests for email extraction from checkout and event data.

Walkthrough

The changes introduce improved error handling and logging across multiple integration sources, with emphasis on email field validation and extraction. Updates include enhanced HTTP response handling with structured logging for failures, email presence verification in required fields, and email data propagation from checkout events. Additional test coverage validates error scenarios and email extraction flows.

Changes

Cohort / File(s) Summary
Facebook Lead Ads Hydration
src/sources/facebook_lead_ads_native/hydrate.ts, src/sources/facebook_lead_ads_native/hydrate.test.ts
Replaces direct OK status check with generic HTTP success check using isHttpStatusSuccess(). Adds structured logging via JsonSchemaGenerator for non-OK responses. Introduces 4 new test cases verifying error handling for various error object shapes (missing property, empty object, string, null) with assertion of rejection message and logger calls.
Shopify Web Pixel Email Handling
src/sources/shopify/webpixelTransformations/pixelUtils.js, src/sources/shopify/webpixelTransformations/pixelTransform.test.js
Introduces setCheckoutEmail() helper function to extract and set email from inputEvent.data.checkout.email into context.traits.email. Integrates this function into both checkoutEventBuilder and checkoutStepEventBuilder. Adds 3 new tests validating email extraction for checkout_completed events and proper absence of email for non-checkout scenarios.
Iterable Email Validation
src/sources/iterable/transform.js
Adds required-field check for event.dataFields.email in checkForRequiredFields(). Updates userId generation logic to derive from message.context.traits.email instead of event.email when userId is missing.
Mixpanel Optional Chaining
src/v0/destinations/mp/transform.js
Applies optional chaining operator to safely access message.context?.traits when computing segregatedTraits. Adds conditional guard ensuring segregatedTraits.contextTraits assignment only occurs if message.context is present.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested reviewers

  • achettyiitr
  • saikumarrs
🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is minimal and generic (":crown: An automated PR"), missing all required template sections including what changes were introduced, related Linear task, objectives, and developer/reviewer checklists. Populate the description template with specific details: summarize the integrated changes, reference the Linear task, explain release integration objectives, and complete the developer and reviewer checklists.
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: a release-related PR that integrates the main branch back into develop following a release version bump.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch main
📝 Coding Plan
  • Generate coding plan for human review comments

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

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can use TruffleHog to scan for secrets in your code with verification capabilities.

Add a TruffleHog config file (e.g. trufflehog-config.yml, trufflehog.yml) to your project to customize detectors and scanning behavior. The tool runs only when a config file is present.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (3)
src/sources/facebook_lead_ads_native/hydrate.test.ts (1)

399-516: Excellent test coverage for the errorResponseHandler edge cases.

The four test scenarios comprehensively cover the conditions where errorResponseHandler returns without throwing:

  1. Response with no error property
  2. Empty object body
  3. String body (non-JSON structure)
  4. Explicit null error

Each test correctly validates both the rejection behavior and the structured logging with schema output. This ensures the defensive error handling in hydrate.ts is properly exercised.

One minor suggestion: the suite name could be more specific to clarify the conditions under which the handler doesn't throw.

💡 Optional: More descriptive suite name
-  describe('errorResponseHandler does not throw', () => {
+  describe('non-OK responses without valid error structure', () => {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/sources/facebook_lead_ads_native/hydrate.test.ts` around lines 399 - 516,
The describe block name "errorResponseHandler does not throw" is vague—rename it
to a more specific suite title that reflects the conditions being tested (e.g.,
"errorResponseHandler: non-OK responses without valid error field should log
schema and throw") and update any individual it() names if needed for clarity;
locate the describe wrapping the tests referencing hydrate and
errorResponseHandler in hydrate.test.ts and change the string literal only (no
behavior changes) so the suite clearly documents that these tests cover non-OK
Facebook responses with missing/invalid error payloads.
src/sources/facebook_lead_ads_native/hydrate.ts (1)

113-118: Solid defensive error handling for the edge case where errorResponseHandler returns without throwing.

The logging and throw correctly handle scenarios where Facebook returns non-OK responses without a proper error structure (e.g., missing error property, empty body, null error). Per the errorResponseHandler implementation in networkHandler.js, it returns early when !response.error is truthy.

One consideration: using JsonSchemaGenerator.generate(processedResponse) logs the structural schema rather than actual values—good for avoiding PII exposure, but may limit debugging visibility. A brief inline comment explaining this privacy-conscious choice would be helpful for future maintainers.

💡 Optional: Add clarifying comment
+  // Log schema (not actual values) to avoid exposing potentially sensitive data
   logger.error(`[facebook_lead_ads_native] Non-OK response from Facebook API`, {
     status: processedResponse.status,
     response: JSON.stringify(JsonSchemaGenerator.generate(processedResponse)),
   });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/sources/facebook_lead_ads_native/hydrate.ts` around lines 113 - 118, Add
a short inline comment above the logger.error call in hydrate.ts explaining that
JsonSchemaGenerator.generate(processedResponse) is used intentionally to log the
response schema (not raw values) to avoid logging PII while still providing
structure for debugging; reference the involved symbols logger.error,
JsonSchemaGenerator.generate, processedResponse and note that this is defensive
handling for the edge-case where errorResponseHandler returns without throwing.
src/sources/iterable/transform.js (1)

57-61: Correct alignment with mapping contract.

Using message.context.traits.email instead of event.email properly reflects the mapping consolidation where both email and dataFields.email resolve to context.traits.email. This ensures consistent userId generation regardless of the source field.

One edge case to note: checkForRequiredFields allows events with only userId (no email fields). In this scenario, message.context.traits.email would be undefined, causing md5(undefined) to produce a deterministic but likely unintended hash. While this edge case is theoretically possible based on the validation logic and exists in the prior implementation as well, current test coverage does not demonstrate userId-only scenarios. Consider adding a defensive check if such events are expected in production.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/sources/iterable/transform.js` around lines 57 - 61, The current code
sets message.userId = md5(message.context.traits.email) unconditionally, which
can produce an unintended hash when context.traits.email is undefined; update
the logic in src/sources/iterable/transform.js so you only call md5 when
message.context?.traits?.email is defined (i.e., check that message.context and
message.context.traits.email exist) and otherwise leave message.userId alone (or
explicitly do not generate a userId), referencing the symbols message.userId,
md5, message.context.traits.email and the validation path checkForRequiredFields
to locate the fix.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/sources/facebook_lead_ads_native/hydrate.test.ts`:
- Around line 399-516: The describe block name "errorResponseHandler does not
throw" is vague—rename it to a more specific suite title that reflects the
conditions being tested (e.g., "errorResponseHandler: non-OK responses without
valid error field should log schema and throw") and update any individual it()
names if needed for clarity; locate the describe wrapping the tests referencing
hydrate and errorResponseHandler in hydrate.test.ts and change the string
literal only (no behavior changes) so the suite clearly documents that these
tests cover non-OK Facebook responses with missing/invalid error payloads.

In `@src/sources/facebook_lead_ads_native/hydrate.ts`:
- Around line 113-118: Add a short inline comment above the logger.error call in
hydrate.ts explaining that JsonSchemaGenerator.generate(processedResponse) is
used intentionally to log the response schema (not raw values) to avoid logging
PII while still providing structure for debugging; reference the involved
symbols logger.error, JsonSchemaGenerator.generate, processedResponse and note
that this is defensive handling for the edge-case where errorResponseHandler
returns without throwing.

In `@src/sources/iterable/transform.js`:
- Around line 57-61: The current code sets message.userId =
md5(message.context.traits.email) unconditionally, which can produce an
unintended hash when context.traits.email is undefined; update the logic in
src/sources/iterable/transform.js so you only call md5 when
message.context?.traits?.email is defined (i.e., check that message.context and
message.context.traits.email exist) and otherwise leave message.userId alone (or
explicitly do not generate a userId), referencing the symbols message.userId,
md5, message.context.traits.email and the validation path checkForRequiredFields
to locate the fix.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e7ad3a58-b939-4afb-8789-69e087fe0092

📥 Commits

Reviewing files that changed from the base of the PR and between 93bb199 and 53697a9.

⛔ Files ignored due to path filters (10)
  • CHANGELOG.md is excluded by !**/*.md
  • go/webhook/testcases/testdata/testcases/iterable/test_1_0.json is excluded by !**/*.json
  • go/webhook/testcases/testdata/testcases/iterable/test_30_0.json is excluded by !**/*.json
  • package-lock.json is excluded by !**/package-lock.json, !**/*.json
  • package.json is excluded by !**/*.json
  • src/sources/iterable/mapping.json is excluded by !**/*.json
  • test/integrations/destinations/mp/processor/data.ts is excluded by !**/test/**
  • test/integrations/sources/iterable/data.ts is excluded by !**/test/**
  • test/integrations/sources/shopify/pixelMappingTests/CheckoutStepsTests.ts is excluded by !**/test/**
  • test/integrations/sources/shopify/pixelTestScenarios/CheckoutStepsTests.ts is excluded by !**/test/**
📒 Files selected for processing (6)
  • src/sources/facebook_lead_ads_native/hydrate.test.ts
  • src/sources/facebook_lead_ads_native/hydrate.ts
  • src/sources/iterable/transform.js
  • src/sources/shopify/webpixelTransformations/pixelTransform.test.js
  • src/sources/shopify/webpixelTransformations/pixelUtils.js
  • src/v0/destinations/mp/transform.js

@codecov
Copy link

codecov bot commented Mar 16, 2026

Codecov Report

❌ Patch coverage is 98.95288% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.27%. Comparing base (97370a2) to head (53697a9).
⚠️ Report is 26 commits behind head on develop.

Files with missing lines Patch % Lines
src/v0/destinations/fb_custom_audience/util.ts 97.05% 1 Missing ⚠️
src/v0/destinations/salesforce/utils.js 96.42% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #5048      +/-   ##
===========================================
- Coverage    92.30%   92.27%   -0.03%     
===========================================
  Files          663      656       -7     
  Lines        36490    35915     -575     
  Branches      8622     8469     -153     
===========================================
- Hits         33681    33142     -539     
+ Misses        2592     2535      -57     
- Partials       217      238      +21     

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

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.

3 participants