Skip to content

chore: braze feature env cleanup - #4581

Merged
vinayteki95 merged 1 commit into
developfrom
chore.braze-env-clean-up
Aug 26, 2025
Merged

vinayteki95 merged 1 commit into
developfrom
chore.braze-env-clean-up

Conversation

@vinayteki95

Copy link
Copy Markdown
Contributor

What are the changes introduced in this PR?

Braze alias identity batching feature was behind an ENV based feature flag. This PR cleans up that ENV now that the feature is stable.

What is the related Linear task?

Resolves INT-3922

Please explain the objectives of your changes below

Post feature release feature flag clean up.

Any changes to existing capabilities/behaviour, mention the reason & what are the changes ?

No

Any new dependencies introduced with this change?

No

Any new generic utility introduced or modified. Please explain the changes.

No

Any technical or performance related pointers to consider with the change?

No

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

@vinayteki95
vinayteki95 requested a review from a team as a code owner August 21, 2025 11:17
@coderabbitai

coderabbitai Bot commented Aug 21, 2025 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Refactor
    • Streamlined Braze identify handling by always batching identify calls for consistent behavior and potential performance gains.
  • Chores
    • Removed the legacy configuration option that toggled identify batching.

Impact:

  • Identify events sent to Braze are now consistently batched in the router flow.
  • If you previously relied on disabling batching, note that batching is now always enabled.
  • No changes to other Braze settings or endpoints.

Walkthrough

Removed the environment toggle for Braze identify-resolution batching. Deleted shouldBatchBrazeIdentifyResolution from config and its import/use in transform. The router now always passes identifyCallsArray to simpleProcessRouterDestFunc.

Changes

Cohort / File(s) Summary
Braze identify-resolution batching removal
src/v0/destinations/braze/config.js, src/v0/destinations/braze/transform.js
Removed shouldBatchBrazeIdentifyResolution export and usage; simplified router to always include identifyCallsArray in simpleProcessRouterDestFunc options. Other config constants unchanged.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Router as Braze Router
  participant SPF as simpleProcessRouterDestFunc

  rect rgb(240,240,255)
  note over Router: Before (conditional batching)
  Router->>Router: Read env BRAZE_BATCH_IDENTIFY_RESOLUTION
  alt env === 'true'
    Router->>SPF: call(..., { identifyCallsArray })
  else env !== 'true'
    Router->>SPF: call(..., { identifyCallsArray: undefined })
  end
  end

  rect rgb(240,255,240)
  note over Router: After (unconditional batching)
  Router->>SPF: call(..., { identifyCallsArray })
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

DO NOT MERGE

Suggested reviewers

  • sivashanmukh
  • koladilip

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore.braze-env-clean-up

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.
    • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

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.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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.

@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/braze/transform.js (2)

567-569: Consider graceful degradation if batched identify fails

Right now, a failure in processBatchedIdentify will bubble up and can fail the entire router batch post-transformation. If that’s the desired behavior, ignore this. Otherwise, consider catching and logging to avoid dropping already-processed event responses, especially during transient Braze outages.

You could wrap this block:

-  if (identifyCallsArray && identifyCallsArray.length > 0) {
-    await processBatchedIdentify(identifyCallsArray, destination.ID);
-  }
+  if (identifyCallsArray && identifyCallsArray.length > 0) {
+    try {
+      await processBatchedIdentify(identifyCallsArray, destination.ID);
+    } catch (err) {
+      logger.error('Braze batched identify failed', err);
+      // Optionally: emit a metric or enrich reqMetadata; decide whether to rethrow based on policy.
+    }
+  }

571-573: Nit: fix variable name typo (readability)

Minor spelling fix to improve readability.

-  const allTransfomredEvents = lodash.flatMap(output);
-  return processBatch(allTransfomredEvents);
+  const allTransformedEvents = lodash.flatMap(output);
+  return processBatch(allTransformedEvents);
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between ef4f64f and fa88c92.

📒 Files selected for processing (2)
  • src/v0/destinations/braze/config.js (0 hunks)
  • src/v0/destinations/braze/transform.js (1 hunks)
💤 Files with no reviewable changes (1)
  • src/v0/destinations/braze/config.js
🧰 Additional context used
📓 Path-based instructions (1)
**/*.js

⚙️ CodeRabbit configuration file

Focus on ESLint errors (max 3) and warnings (max 5).

Files:

  • src/v0/destinations/braze/transform.js
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
  • GitHub Check: Build Transformer Docker Image - PR / Build Transformer Docker Image AMD64
  • GitHub Check: Build Transformer Docker Image - PR / Build Transformer Docker Image ARM64
  • GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image ARM64
  • GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image AMD64
  • GitHub Check: Code Coverage
  • GitHub Check: UT Tests
  • GitHub Check: test_and_publish
  • GitHub Check: Analyze (go)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (1)
src/v0/destinations/braze/transform.js (1)

554-562: Review OK: identifyCallsArray routing validated

  • Verified that the deprecated flag shouldBatchBrazeIdentifyResolution has been fully removed—no references remain.
  • Confirmed both simpleProcessRouterDestSync (src/v0/util/index.js:1849) and simpleProcessRouterDest (src/v0/util/index.js:1820) accept a processParams argument and forward it to the provided singleTfFunc.
  • Confirmed process() (src/v0/destinations/braze/transform.js:450) correctly reads identifyCallsArray from processParams (used at line 503) and that batched identity calls are handled after awaiting all router responses.
  • Passing the shared identifyCallsArray across asynchronously awaited router invocations is safe under Node’s single-threaded execution model.

Approving these changes—no further action needed.

@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

Allure Test reports for this run are available at:

@codecov

codecov Bot commented Aug 21, 2025 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.81%. Comparing base (dd1f23e) to head (fa88c92).
⚠️ Report is 8 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4581      +/-   ##
===========================================
- Coverage    91.81%   91.81%   -0.01%     
===========================================
  Files          642      642              
  Lines        33930    33928       -2     
  Branches      8031     8040       +9     
===========================================
- Hits         31152    31150       -2     
  Misses        2548     2548              
  Partials       230      230              

☔ 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

@vinayteki95
vinayteki95 merged commit cc893c3 into develop Aug 26, 2025
@vinayteki95
vinayteki95 deleted the chore.braze-env-clean-up branch August 26, 2025 04:59
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.

4 participants