Skip to content

feat: use account information on zoho - #4361

Merged
ItsSudip merged 9 commits into
developfrom
feat/supportAccountInZohoDev
Jun 5, 2025
Merged

ItsSudip merged 9 commits into
developfrom
feat/supportAccountInZohoDev

Conversation

@ItsSudip

@ItsSudip ItsSudip commented May 29, 2025 •

Copy link
Copy Markdown
Member

What are the changes introduced in this PR?

Description

This PR adds support for account-level region configuration in Zoho and Zoho Dev destinations through the deliveryAccount mechanism. The implementation allows region settings to be specified at the account level, providing more flexibility in multi-region deployments.

Key Changes:

Core Implementation:

Enhanced Region Resolution:

Modified the getRegion() function in src/cdk/v2/destinations/zoho/utils.js to prioritize destination.deliveryAccount.options.region over destination.Config.region

  • Dynamic Endpoint Generation: Updated endpoint URL construction to use the account-level region when available, ensuring API calls are routed to the correct Zoho data center (US, EU, IN, etc.)
  • Backward Compatibility: Maintained fallback to existing Config.region when deliveryAccount region is not specified
  • Test Coverage:
  • New Test Suite: Added comprehensive test cases in test/integrations/destinations/zoho/router/account.ts to validate account-level region functionality
  • Integration Tests: Created test scenarios demonstrating EU region configuration through deliveryAccount.options.region
  • Router Test Integration: Updated router test data structure to include account-specific test cases

Files Modified:

  • src/cdk/v2/destinations/zoho/utils.js - Enhanced region resolution logic
  • test/integrations/destinations/zoho/router/account.ts - New account test cases
  • test/integrations/destinations/zoho/router/data.ts - Updated to include account tests
    Multiple test configuration files updated for comprehensive coverage

Technical Details:

The implementation follows a hierarchical approach for region determination:

This ensures that:

  • Account-level region settings take precedence
  • Existing destination configuration remains functional
  • API endpoints are correctly constructed for the specified region (e.g., https://www.zohoapis.eu/crm/v6/ for EU region)
  • Benefits:
  • Improved Flexibility: Account-level configuration allows for more granular control
  • Zero Breaking Changes: Existing configurations continue to work without modification
  • Enhanced Testing: Comprehensive test coverage ensures reliability across different region configurations

Validation:

  • All existing tests pass without modification
  • New test cases validate EU region functionality through account configuration
  • Router tests confirm proper endpoint generation for account-level regions

Linear Ticket

Resoves INT-3745

Security

  • The code changed/added as part of this pull request won't create any security issues with how the software is being used.

What is the related Linear task?

Resolves INT-3701

Please explain the objectives of your changes below

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

N/A

Any new dependencies introduced with this change?

We have introduced the account dependancy but that is along with backward compatibility.

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 review from a team and sivashanmukh as code owners May 29, 2025 12:11
@ItsSudip
ItsSudip requested review from a team, chandumlg and krishna2020 May 29, 2025 12:11
@coderabbitai

coderabbitai Bot commented May 29, 2025 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features
    • Added support for a new Zoho development feature flag.
    • Enhanced handling and mapping for Zoho and Zoho development destinations.
  • Bug Fixes
    • Improved region detection and validation for Zoho destinations, including robust error handling for missing region information.
  • Refactor
    • Streamlined internal configuration and account handling for destinations, improving consistency in how account and region data are accessed.
  • Tests
    • Expanded test coverage for region extraction and error scenarios in Zoho destination utilities.
  • Chores
    • Updated type definitions to support additional account-related fields for destinations.

Summary by CodeRabbit

  • New Features
    • Added support for a new feature flag enabling Zoho Dev integration.
    • Introduced handling for delivery and deletion accounts within destination configurations.
  • Enhancements
    • Improved region extraction logic for Zoho destinations, supporting both legacy and account-based configurations.
    • Enhanced mapping logic for destination names to ensure correct resolution for Zoho and Zoho Dev.
  • Bug Fixes
    • Updated validation and transformation workflows to use the new region extraction utility, improving reliability.
  • Tests
    • Expanded test coverage for region extraction, including error handling and edge cases.

Walkthrough

This change introduces a mapping for destination names (notably mapping zoho_dev to zoho) and updates function signatures and utilities in the Zoho integration to use a unified destination object rather than separate config objects. It adds a getRegion utility, updates relevant workflows and tests, and expands type definitions for destinations and accounts.

Changes

File(s) Change Summary
src/cdk/v2/destinations/zoho/rtWorkflow.yaml Updated workflow to use getRegion utility for region extraction and validation.
src/cdk/v2/destinations/zoho/transformRecordV2.js Refactored function signatures and calls to use destination instead of Config; updated searchRecordIdV2 usage.
src/cdk/v2/destinations/zoho/utils.js Added getRegion utility; updated deduceModuleInfoV2 and searchRecordIdV2 to use destination; exported getRegion.
src/cdk/v2/destinations/zoho/utils.test.js Updated tests for new function signatures; added comprehensive tests for getRegion.
src/cdk/v2/utils.ts Modified getRootPathForDestination to use DestHandleMapForCDKV2 mapping for destination name resolution.
src/constants/destinationCanonicalNames.js Added and exported DestHandleMapForCDKV2 with zoho_dev to zoho mapping.
src/features.ts Added ZOHO_DEV feature flag to routerTransform in configuration.
src/services/destination/nativeIntegration.ts Updated deliver method to resolve destination type via DestHandleMapForCDKV2 before handler lookup.
src/types/controlPlaneConfig.ts Extended Destination type with generics and new fields for delivery/delete accounts; introduced related types.

Sequence Diagram(s)

sequenceDiagram
    participant Workflow
    participant Utils
    participant ZohoTransform
    participant ZohoUtils

    Workflow->>Utils: getRegion(destination)
    Utils-->>Workflow: region

    ZohoTransform->>ZohoUtils: searchRecordIdV2({identifiers, metadata, destination, destConfig})
    ZohoUtils->>Utils: getRegion(destination)
    Utils-->>ZohoUtils: region
    ZohoUtils-->>ZohoTransform: recordId

    ZohoTransform->>ZohoUtils: deduceModuleInfoV2(destination, destConfig)
    ZohoUtils->>Utils: getRegion(destination)
    Utils-->>ZohoUtils: region
    ZohoUtils-->>ZohoTransform: moduleInfo
Loading

Possibly related PRs

  • rudderlabs/rudder-transformer#4291: Modifies the Destination type to add account-related generics and fields, directly overlapping with this PR's type changes.
  • rudderlabs/rudder-transformer#4355: Reintroduces and expands the use of the getRegion utility and updates Zoho destination code to use unified destination objects, closely related to this PR's refactoring.

Suggested reviewers

  • sivashanmukh
  • krishna2020
  • yashasvibajpai
  • manish339k

Suggestions for improvement:

  • Ensure all downstream consumers of destination and related types are updated to prevent type mismatches or runtime errors.
  • Consider adding integration or end-to-end tests to validate the new destination name mapping logic and the feature flag ZOHO_DEV.
  • Document the getRegion utility function clearly, specifying its behavior for legacy and account-based configurations, to aid future maintainers.
  • Review error handling paths related to PlatformError thrown by getRegion to confirm consistent upstream handling.

📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between c39a2da and 20a07e4.

📒 Files selected for processing (1)
  • src/cdk/v2/destinations/zoho/utils.js (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/cdk/v2/destinations/zoho/utils.js
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: Code Coverage
  • GitHub Check: test_and_publish
  • GitHub Check: UT Tests
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (go)
✨ 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.

@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

Allure Test reports for this run are available at:

@codecov

codecov Bot commented May 29, 2025 •

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.13%. Comparing base (7fc5e4e) to head (20a07e4).
Report is 4 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #4361   +/-   ##
========================================
  Coverage    91.13%   91.13%           
========================================
  Files          638      638           
  Lines        33464    33476   +12     
  Branches      7894     7897    +3     
========================================
+ Hits         30497    30509   +12     
  Misses        2728     2728           
  Partials       239      239           

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

@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

Allure Test reports for this run are available at:

1 similar comment
@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

Allure Test reports for this run are available at:

@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

Allure Test reports for this run are available at:

Comment thread src/types/controlPlaneConfig.ts Resolved
Comment thread src/cdk/v2/destinations/zoho/utils.js Resolved
@ItsSudip ItsSudip self-assigned this Jun 3, 2025
@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

Allure Test reports for this run are available at:

@ItsSudip
ItsSudip changed the base branch from main to hotfix/5thJune2025 June 4, 2025 05:10
@ItsSudip
ItsSudip force-pushed the feat/supportAccountInZohoDev branch from 803e939 to 92f4595 Compare June 4, 2025 05:10
@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

Allure Test reports for this run are available at:

Comment thread src/types/controlPlaneConfig.ts Resolved
@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

Allure Test reports for this run are available at:

utsabc
utsabc previously approved these changes Jun 4, 2025
Comment thread src/cdk/v2/destinations/zoho/utils.js Resolved
Comment thread src/types/controlPlaneConfig.ts Resolved
Comment thread src/types/controlPlaneConfig.ts Resolved
@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

Allure Test reports for this run are available at:

@ItsSudip
ItsSudip changed the base branch from hotfix/5thJune2025 to develop June 5, 2025 05:45
@ItsSudip
ItsSudip dismissed utsabc’s stale review June 5, 2025 05:45

The base branch was changed.

@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/cdk/v2/destinations/zoho/utils.js (1)

15-23: Apply optional chaining suggestion and approve the region resolution logic.

The getRegion function correctly implements the hierarchical approach to region determination. However, the static analysis tool correctly identifies an opportunity for optional chaining.

Apply this diff to use optional chaining:

-  if (destination.deliveryAccount && destination.deliveryAccount.accountDefinition) {
+  if (destination.deliveryAccount?.accountDefinition) {
🧰 Tools
🪛 Biome (1.9.4)

[error] 16-16: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

src/cdk/v2/destinations/zoho/utils.test.js (1)

517-671: Comprehensive test coverage for getRegion function with minor enhancement opportunity.

The test suite thoroughly covers the hierarchical region determination logic, including edge cases like missing account definitions, null/undefined values, and error scenarios. The error testing properly validates both error types and status codes.

Consider adding a test case for when deliveryAccount.accountDefinition exists but is null to ensure complete edge case coverage:

+    {
+      name: 'should return region from Config when delivery account exists but account definition is null',
+      input: {
+        deliveryAccount: {
+          accountDefinition: null,
+          options: {
+            region: 'EU',
+          },
+        },
+        Config: {
+          region: 'US',
+        },
+      },
+      expected: 'US',
+    },
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between dcfb3cd and c39a2da.

⛔ Files ignored due to path filters (7)
  • test/integrations/destinations/zoho/dataDelivery/data.ts is excluded by !**/test/**
  • test/integrations/destinations/zoho/dataDelivery/zoho_dev.ts is excluded by !**/test/**
  • test/integrations/destinations/zoho/router/account.ts is excluded by !**/test/**
  • test/integrations/destinations/zoho/router/data.ts is excluded by !**/test/**
  • test/integrations/destinations/zoho_dev/dataDelivery/data.ts is excluded by !**/test/**
  • test/integrations/destinations/zoho_dev/network.ts is excluded by !**/test/**
  • test/integrations/destinations/zoho_dev/router/data.ts is excluded by !**/test/**
📒 Files selected for processing (9)
  • src/cdk/v2/destinations/zoho/rtWorkflow.yaml (2 hunks)
  • src/cdk/v2/destinations/zoho/transformRecordV2.js (5 hunks)
  • src/cdk/v2/destinations/zoho/utils.js (4 hunks)
  • src/cdk/v2/destinations/zoho/utils.test.js (9 hunks)
  • src/cdk/v2/utils.ts (2 hunks)
  • src/constants/destinationCanonicalNames.js (2 hunks)
  • src/features.ts (1 hunks)
  • src/services/destination/nativeIntegration.ts (2 hunks)
  • src/types/controlPlaneConfig.ts (2 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).

  • src/constants/destinationCanonicalNames.js
  • src/cdk/v2/destinations/zoho/utils.test.js
  • src/cdk/v2/destinations/zoho/utils.js
  • src/cdk/v2/destinations/zoho/transformRecordV2.js
🧬 Code Graph Analysis (2)
src/cdk/v2/utils.ts (1)
src/constants/destinationCanonicalNames.js (1)
  • DestHandleMapForCDKV2 (7-9)
src/services/destination/nativeIntegration.ts (1)
src/constants/destinationCanonicalNames.js (1)
  • DestHandleMapForCDKV2 (7-9)
🪛 Biome (1.9.4)
src/cdk/v2/destinations/zoho/utils.js

[error] 16-16: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

⏰ Context from checks skipped due to timeout of 90000ms (9)
  • GitHub Check: Build Transformer Docker Image - PR / Build Transformer Docker Image ARM64
  • 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: UT Tests
  • GitHub Check: test_and_publish
  • GitHub Check: Analyze (go)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (14)
src/constants/destinationCanonicalNames.js (2)

7-9: Well-structured mapping implementation.

The new DestHandleMapForCDKV2 object follows the established pattern and correctly maps zoho_dev to zoho. The separation from the existing DestHandlerMap is appropriate given the networking handler considerations mentioned in the past review comments.


197-197: Export statement correctly updated.

The module exports are properly updated to include the new DestHandleMapForCDKV2 object alongside the existing exports.

src/features.ts (1)

89-89: Feature flag correctly implemented.

The ZOHO_DEV feature flag is properly added to the routerTransform configuration, following the established pattern and maintaining alphabetical ordering near the existing ZOHO flag.

src/cdk/v2/destinations/zoho/rtWorkflow.yaml (2)

6-7: Binding correctly added for region utility.

The getRegion binding is properly imported from the utils module, enabling centralized region extraction logic in the workflow.


16-17: Validation logic properly updated to use centralized region extraction.

The workflow now uses the getRegion utility function instead of directly accessing config.region, which aligns with the PR objective of supporting account-level region configuration while maintaining backward compatibility.

src/cdk/v2/utils.ts (2)

8-8: Import correctly added for destination mapping.

The DestHandleMapForCDKV2 import is properly added to support destination name mapping functionality.


41-43: Destination mapping logic correctly implemented.

The mapping logic properly resolves destination names using DestHandleMapForCDKV2 with appropriate fallback to the original destName when no mapping exists. This enables zoho_dev to correctly resolve to the zoho directory structure while maintaining backward compatibility.

src/services/destination/nativeIntegration.ts (1)

190-192: LGTM: Clean implementation of destination mapping logic.

The mapping implementation correctly uses the canonical name mapping with proper fallback to the original destination type, maintaining backward compatibility.

src/cdk/v2/destinations/zoho/utils.js (1)

25-36:

Details

✅ Verification successful

Verify function signature consistency across the codebase.

The function signatures have been updated to accept destination instead of Config, which aligns with the account-level configuration support. Ensure all callers have been updated accordingly.

Also applies to: 193-207


🏁 Script executed:

#!/bin/bash
# Description: Verify all calls to deduceModuleInfoV2 and searchRecordIdV2 use the new signatures

# Search for function calls to verify they match the new signatures
rg -A 3 "deduceModuleInfoV2\(" --type js
rg -A 3 "searchRecordIdV2\(" --type js

Length of output: 1682


Signature consistency verified for deduceModuleInfoV2 and searchRecordIdV2

All calls now use the updated destination parameter instead of Config:

  • In src/cdk/v2/destinations/zoho/transformRecordV2.js
  • In src/cdk/v2/destinations/zoho/utils.test.js

No further changes required.

src/cdk/v2/destinations/zoho/transformRecordV2.js (1)

208-221: Approve parameter updates for account-level configuration support.

The parameter changes from Config to destination are necessary to support the new account-level region configuration feature. The function calls have been correctly updated to match the new signatures.

Also applies to: 245-252, 341-344

src/types/controlPlaneConfig.ts (1)

11-28: Well-structured type definitions for account support.

The new type definitions provide comprehensive support for account-level configuration with appropriate generics and optional fields. The Account type properly handles the various scenarios discussed in previous reviews regarding optional secrets and options.

Also applies to: 30-47

src/cdk/v2/destinations/zoho/utils.test.js (3)

2-2: Import additions look good.

The addition of PlatformError and getRegion imports aligns with the new functionality being tested and follows proper import practices.

Also applies to: 10-10


279-284: Function signature refactoring improves maintainability.

The change from multiple parameters to a single object parameter with named properties is a good practice that improves readability and reduces parameter order dependencies. The test cases properly reflect the new API design.

Also applies to: 337-342


353-357: Parameter order correction aligns with function signature changes.

The updates to pass destination and destConfig parameters in the correct order match the refactored function signature. This ensures consistency across the codebase.

Also applies to: 368-372, 383-387, 398-402, 414-414

@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

Allure Test reports for this run are available at:

@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

Allure Test reports for this run are available at:

@sonarqubecloud

sonarqubecloud Bot commented Jun 5, 2025

Copy link
Copy Markdown

@koladilip
koladilip self-requested a review June 5, 2025 07:36
@ItsSudip
ItsSudip merged commit 752e1e1 into develop Jun 5, 2025
@ItsSudip
ItsSudip deleted the feat/supportAccountInZohoDev branch June 5, 2025 09:16
koladilip added a commit that referenced this pull request Jun 30, 2025
* fix: handle empty oauth secret for multiple destination (#4295)

* fix: handle empty oauth secret for multiple destination

* fix: test

* fix: add validation for other field

* chore: add missing test

* chore: add more test

* chore: change test

* chore: misc

* feat: implement hasDynamicConfig flag support (#4321)

* feat: implement hasDynamicConfig flag support in routerTransform flow

This implements support for the hasDynamicConfig flag in the routerTransform flow to fix
the issue where events with dynamic configuration were being mixed up during transformation.
The implementation includes:

1. Added a new hasDynamicConfig flag to the Destination type in controlPlaneConfig.ts to indicate
 whether a destination's configuration contains dynamic config patterns
2. Modified the dynamicConfigParser.ts to respect the hasDynamicConfig flag:
   - Skip processing when hasDynamicConfig is explicitly false
   - Process events when hasDynamicConfig is true or undefined (for backward compatibility)
3. Enhanced groupRouterTransformEvents function in src/v0/util/index.js to:
   - Group events by destination config when hasDynamicConfig is true or undefined
   - Use fast-json-stable-stringify to ensure consistent grouping of configs with different key orders
   - Maintain backward compatibility with older server versions where the flag might not be present
4. Added comprehensive test cases for:
   - Testing behavior with hasDynamicConfig=false
   - Testing behavior with hasDynamicConfig=true
   - Testing backward compatibility with hasDynamicConfig=undefined
   - Testing mixed hasDynamicConfig flags in a batch
   - Testing configs with different key orders

This implementation resolves INT-3633 by ensuring that events with dynamic configuration are properly
 grouped and processed in the routerTransform flow, preventing event mix-up issues.

Dependencies:
- Added fast-json-stable-stringify package to ensure consistent JSON string representation regardless of key order

* fix: add hasDynamicConfig flag support in routerTransform flow

* test: add hasDynamicConfig flag to test files

fix tests

* refactor: optimize dynamicConfigParser to avoid deep cloning entire event

* fix: restore unset functionality in dynamic config parser

- Add unset-value import to properly remove extracted fields from events
- Restore unset() call after extracting dynamic config values to prevent downstream issues
- Change from shallow to deep cloning to avoid modifying original events during unset operations
- Add comprehensive test to verify unset functionality works correctly
- Add shouldGroupByDestinationConfig method to JavaScript dynamic config module
- Update groupRouterTransformEvents to use shouldGroupByDestinationConfig function
- Add environment variable tests for USE_HAS_DYNAMIC_CONFIG_FLAG in router grouping logic

This ensures that fields used in dynamic config templates (e.g., {{ message.traits.appId || 'default' }})
are properly removed from events after extraction, preventing potential conflicts in destination processing.

* refactor: optimize dynamic config parser and consolidate utilities

- Move utility functions from dynamicConfig.js to utils.js for better organization
- Optimize DynamicConfigParser with pre-compiled regex patterns and efficient loops
- Replace deep cloning with selective cloning for better performance
- Remove standalone dynamicConfig.js and dynamicConfig.test.js files
- Update imports and references across affected modules

* fix: ensure consistent ordering in batch processing for google adwords offline conversions (#4359)

- Add sorting by jobId to removeDuplicateMetadata function
- Sort final batch results by minimum jobId for consistent ordering
- Re-enable router output assertion for google_adwords_offline_conversions tests
- Update test data ordering to match new consistent batch processing behavior
- Fix unit test expectations to match new sorted metadata order

* chore: add concurrent requests and memory fencing middlewares (#4358)

* chore: migrate tiktok_ads to new test (#4342)

* chore: migrate tiktok_ads to new test

* chore: review comments

* chore: review comments

* chore: review comments

* chore: review comments

* chore: rebase

* chore: introduce deep freeze to compaction middlewares (#4365)

* feat: implement rudder-test destination with migrated tests (#4352)

- Add rudder-test destination for platform testing and development
- Implement TypeScript destination with router-only transformation
- Support Record v2 events with echo response pattern
- Add context-based test behavior control via testBehavior field
- Migrate tests to new format using migration script
- Optimize tests with generateMetadata utility and common destination
- Enable Zod validation and enhanced Allure reporting
- Add npm script 'rudder-tests' for convenient test execution
- Update README.md with comprehensive destination documentation

The rudder-test destination provides a controlled testing environment
without external dependencies, ideal for platform feature testing,
development workflows, and CI/CD reliability.

refactor: reduce code duplication in rudder_test destination

- Extract common validation and request building logic to utils.ts
- Add processor transformation function alongside existing router function
- Create comprehensive component tests for both processor and router
- Implement shared utilities for message validation, request config building, and test behavior handling
- Maintain different error handling patterns for processor (throws) vs router (returns error objects)
- Add 6 test cases covering success scenarios, error responses, and validation failures

refactor: improve type safety in rudder_test utils

- Replace 'any' types with specific Metadata and RudderTestDestination types
- Import proper types from '../../../types' for better type safety
- Enhance IntelliSense support and compile-time error detection
- Address coderabbitai bot feedback on PR #4352

feat: enhance rudder_test destination with comprehensive dynamic config testing

- Modified rudder_test destination to actually use resolved dynamic config values
- Added endpoint and apiKey resolution from destination config in utils.ts
- Updated transform.ts to pass destination config to utility functions
- Enhanced type definitions to support RudderTestConfig interface

- Added multi-event test cases for both processor and router
- Tests validate multiple events with different dynamic config values resolve correctly
- Added mixed destination ID scenarios (different hasDynamicConfig flags)
- Added compaction tests with multiple events and dynamic config
- All 20 tests now pass and actually validate dynamic config resolution

These tests will surface thread safety issues and shared state problems
in dynamic config processing by testing scenarios where multiple events
have different template variable values that must resolve independently.

docs: update rudder_test destination documentation with dynamic config features

- Added dynamic config resolution capabilities to feature list
- Updated implementation details to reflect both processor and router support
- Added comprehensive test coverage information (20 test cases)
- Included dynamic config examples with template syntax
- Added multi-event testing and thread safety testing use cases
- Updated key files list to include utils.ts and enhanced type definitions
- Corrected architecture description from router-only to dual implementation

* chore: sfmc ai generated docs (#4328)

* chore: sfmc ai generated docs

* chore: sfmc api section in docs

* chore: separate out transformer logic from main doc

* chore: vdm-v2 related faulty docs fix

* Revert "Revert "Merge branch 'develop' into main""

This reverts commit af6e580.

* fix: klaviyo error logging

* chore: optimize usage of deepFreeze in compaction middlewares (#4374)

* chore: use batch processing in transformations (#4363)

* feat: use account information on zoho (#4361)

* chore: new way of creating release

* fix: deep freeze in compaction middleware

- Add test behaviors in rudder_test transform to mutate and replace destination config
- Add router and processor component tests for both property mutation and config
  reference replacement in compacted payload flow
- Assert correct error handling and status codes when mutation is attempted on frozen config
- Ensures immutability of config is enforced and covered in both flows
- Remove unneccessary clonedeep in router transform flow by fixing code

* chore: add safe batch processing to avoid blocking in highly batched destinations

* chore: add batching in mp and source transformations

* fix(marketo): remove auth key from logs

* feat: testing tool (#4391)

* feat: testing tool

* chore: changes

* chore: code structure

* fix: eslint

* chore: review comments

* chore: review comment

* feat: add server request creation flow

* chore: bluecore add internal doc and migrate test (#4353)

* fix: blucore optin event mapping

* fix: review comments

* chore: add subscription event

* chore: add subscription event

* fix: reviews comments

* chore: blucore add internal doc and migrate test

* chore: misc

* chore: misc

* fix: readme

* chore: update docs

* fix(bluecore): address PR #4353 reviewer feedback and API documentation corrections

✅ Complete reviewer feedback resolution:
- Removed all 16 'NEEDS REVIEW' placeholders with concrete information
- Removed AI-generated optimization recommendations section
- Simplified repetitive business logic content by creating detailed businesslogic.md
- Updated documentation structure to follow rs-ai repository standards

🔧 API Documentation Corrections:
- Corrected API type from 'Transactional API' to 'Events API' throughout documentation
- Updated endpoint information to reflect actual implementation: https://api.bluecore.app/api/track/mobile/v1
- Fixed authentication method documentation (namespace token in payload vs Bearer header)
- Updated rate limiting information to reflect Events API (removed incorrect Transactional API limits)
- Updated References section with official Events API documentation link

📚 Documentation Structure Improvements:
- Created comprehensive businesslogic.md with detailed field mappings and transformation flows
- Streamlined main README by removing repetitive sections and adding cross-references
- Consolidated error handling, testing, and performance sections
- Updated RETL documentation for consistency

🔍 Code Analysis Verification:
- Verified endpoint match between code implementation and documentation
- Confirmed authentication method matches actual implementation
- Validated all API references against official Bluecore Events API documentation

Files modified:
- src/cdk/v2/destinations/bluecore/README.md (extensive updates)
- src/cdk/v2/destinations/bluecore/docs/businesslogic.md (created)
- src/cdk/v2/destinations/bluecore/docs/retl.md (updated)

The documentation now accurately reflects the actual Bluecore Events API implementation
and provides reliable information for users integrating with Bluecore through RudderStack.

* chore: docs

* chore: review comments

* fix: review comments

* fix: review comments

* fix: review comments

* chore: improve release check reliability

* fix: ensure the testing tool is cross-platform compatible (#4401)

* fix: make testing tool compatible with cross plateform

* fix: review comments

* fix: review comments

* chore: update klaviyo version to 2024-10-15, remove config restricted changes (#4387)

* chore: criteo audience api version upgrade (#4382)

* chore: criteo audience api version upgrade

* chore: add destination integration doc

* chore: resolving comments

* chore: groupEventsByType function optimization (#4398)

* fix: rt event ordering for hs (#4397)

* fix: router output ordering for tiktok_ads

* fix: test

* fix: test

* fix: test

* fix: rt event ordering for hs

* test: configure batch processing defaults for component tests

* fix: test folder structure for destinations (#4414)

* feat: update workflow to raise pr for dedicated transformer from operator (#4413)

* feat: update workflow to raise pr for dedicated transformer from operator

* Update .github/workflows/prepare-for-prod-dt-deploy.yml

Co-authored-by: Krishna Chaitanya <[email protected]>

* chore: revert rollback changes

---------

Co-authored-by: Sudip Paul <[email protected]>
Co-authored-by: Krishna Chaitanya <[email protected]>

* chore: remove broken workflow to updating dedicated deployment (#4418)

chore: remove broken updating dedicated deployment workflow

Co-authored-by: Sudip Paul <[email protected]>

* chore: update node version to 20.19.2 (#4416)

* chore(mailchimp): add router test with inputs contains different destnations (#4419)

* chore(mailchimp): add router test with inputs contains different destinations

* chore: misc

* chore(release): 1.103.0

* fix: enhance config object in ga4 v2 instead of mutating it (#4436)

* fix: enhance config object in ga4v2 instead of mutation

* chore: update changelog

---------

Co-authored-by: Utsab Chowdhury <[email protected]>
Co-authored-by: Mahesh Kutty <[email protected]>
Co-authored-by: Dilip Kola <[email protected]>
Co-authored-by: Aris Tzoumas <[email protected]>
Co-authored-by: Vinay Teki <[email protected]>
Co-authored-by: Sudip Paul <[email protected]>
Co-authored-by: Dilip Kola <[email protected]>
Co-authored-by: Yashasvi Bajpai <[email protected]>
Co-authored-by: Manish Kumar <[email protected]>
Co-authored-by: Sudip Paul <[email protected]>
Co-authored-by: Krishna Chaitanya <[email protected]>
Co-authored-by: GitHub Actions <[email protected]>
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