Repository navigation
feat: implement rudder-test destination with migrated tests - #4352
Conversation
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including You can disable this status message by setting the Summary by CodeRabbit
WalkthroughThis change introduces a new "rudder_test" destination module with configuration, type definitions, transformation logic, and utility functions. The implementation supports test behaviors for simulating response codes and errors, processes both single and batched events, and structures responses accordingly. All components are modularized for clarity and reuse. Changes
Sequence Diagram(s)sequenceDiagram
participant Source as Event Source
participant Transform as transform.ts
participant Utils as utils.ts
participant Config as config.ts
Source->>Transform: processRouterDest(events, metadata)
alt events is empty
Transform-->>Source: []
else For each event
Transform->>Utils: validateMessageType(event)
Transform->>Utils: hasTestBehaviorError(event)
alt Test behavior error present
Transform->>Utils: buildTestBehaviorErrorResponse(event, metadata, destination)
Utils-->>Transform: Error response
Transform-->>Source: Error response
else
Transform->>Utils: buildRequestConfig(event, destination)
Utils-->>Transform: Request config
Transform-->>Source: Success response with request config
end
end
Suggested reviewers
Suggestions for improvement:
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: 1
🧹 Nitpick comments (2)
src/v0/destinations/rudder_test/transform.ts (2)
27-43: Test behavior implementation provides flexible error simulation.The test behavior logic allows controlled error responses for testing scenarios. The error response structure includes proper metadata and standardized stat tags for monitoring.
Consider extracting the stat tags to a constant for consistency:
+const ERROR_STAT_TAGS = { + destType: 'rudder_test', + errorCategory: 'dataValidation', + errorType: 'instrumentation', + feature: 'router', + implementation: 'native', + module: 'destination', +}; - statTags: { - destType: 'rudder_test', - errorCategory: 'dataValidation', - errorType: 'instrumentation', - feature: 'router', - implementation: 'native', - module: 'destination', - }, + statTags: ERROR_STAT_TAGS,
62-66: Consider optimizing empty object structures.The response body includes several empty objects (JSON_ARRAY, XML, FORM) that may not be necessary for this test destination. Consider omitting unused fields to reduce payload size.
body: { JSON: { action: event.message.action, fields: event.message.fields || {}, identifiers: event.message.identifiers || {}, recordId: event.message.recordId, timestamp: event.message.timestamp || new Date().toISOString(), }, - JSON_ARRAY: {}, - XML: {}, - FORM: {}, },
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between f3636e9 and 561005173bd78f9341b6babde70d96d5667dd063.
⛔ Files ignored due to path filters (11)
Add event request retry headers in SDKs 1b2f2b415dd08068bd5acbc9e14572c0.mdis excluded by!**/*.mdINTEGRATION_TEST_PLAN.mdis excluded by!**/*.mdREADME.mdis excluded by!**/*.mdRUDDER_TEST_DESTINATION_PLAN.mdis excluded by!**/*.mdpackage.jsonis excluded by!**/*.jsontest/integrations/component.test.tsis excluded by!**/test/**test/integrations/destinations/customerio_audience/router/data.tsis excluded by!**/test/**test/integrations/destinations/rudder_test/common.tsis excluded by!**/test/**test/integrations/destinations/rudder_test/router/data.tsis excluded by!**/test/**test/integrations/ensureMessageId.tsis excluded by!**/test/**updated_pr_description.mdis excluded by!**/*.md
📒 Files selected for processing (4)
src/types/rudderEvents.ts(1 hunks)src/v0/destinations/rudder_test/config.ts(1 hunks)src/v0/destinations/rudder_test/transform.ts(1 hunks)src/v0/destinations/rudder_test/type.ts(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
src/v0/destinations/rudder_test/type.ts (4)
src/types/rudderEvents.ts (2)
RudderRecordV2(80-80)Metadata(121-121)src/types/controlPlaneConfig.ts (1)
Destination(29-46)src/types/destinationTransformation.ts (2)
RouterTransformationRequestData(89-100)ProcessorTransformationOutput(66-76)src/v0/destinations/intercom_v2/config.js (1)
RecordAction(9-13)
src/v0/destinations/rudder_test/transform.ts (3)
src/v0/destinations/rudder_test/type.ts (1)
RudderTestRouterRequest(26-31)src/v0/destinations/rudder_test/config.ts (1)
BASE_ENDPOINT(1-1)src/v0/util/index.js (1)
handleRtTfSingleEventError(1778-1795)
⏰ Context from checks skipped due to timeout of 90000ms (9)
- 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: Build Transformer Docker Image - PR / Build Transformer Docker Image ARM64
- GitHub Check: Build Transformer Docker Image - PR / Build Transformer Docker Image AMD64
- GitHub Check: Code Coverage
- GitHub Check: test_and_publish
- GitHub Check: UT Tests
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Analyze (go)
🔇 Additional comments (12)
src/v0/destinations/rudder_test/config.ts (1)
1-1: Configuration looks good and follows minimalist design.The BASE_ENDPOINT configuration is appropriately set for a test destination. The URL structure follows REST conventions and the test domain is suitable for development/testing purposes.
src/v0/destinations/rudder_test/transform.ts (4)
6-11: Good defensive programming with input validation.The function properly handles edge cases by returning an empty array when no inputs are provided, which prevents unnecessary processing and potential errors.
17-21: Message type validation is appropriate for the destination's scope.The validation ensures only 'record' type messages are processed, which aligns with the destination's intended purpose. The error message is clear and informative.
46-72: Response construction follows proper batched request format.The success response structure correctly implements the expected batched request format with appropriate headers, endpoint, and body structure. The timestamp defaulting logic ensures consistent data.
73-76: Proper error handling delegation.The catch block appropriately delegates to the existing error handling utility, maintaining consistency with the broader codebase's error handling patterns.
src/v0/destinations/rudder_test/type.ts (7)
1-8: Well-organized imports with proper type dependencies.The imports are logically grouped and include all necessary types from the broader type system. The import structure supports the type definitions below.
11-14: TestBehavior interface provides clear test control.The interface design is simple and focused, allowing users to specify status codes and optional error messages for testing scenarios. This aligns well with the transformation logic.
17-21: Message type extension follows proper TypeScript patterns.The type correctly extends
RudderRecordV2while preserving the existing context structure and adding the optionaltestBehaviorfield. The intersection type approach is appropriate here.
23-23: Destination type correctly represents minimal configuration.Using
Record<string, never>for the configuration type accurately represents that this destination requires no configuration parameters, which aligns with its test-focused design.
26-31: Router request type properly parameterized.The
RouterTransformationRequestDatais correctly parameterized with the custom message and destination types, withundefinedfor connection reflecting the stateless nature of this test destination.
34-40: Response payload interface accurately models echo behavior.The interface correctly represents the data structure that will be echoed back, including all necessary fields from the record event. The types align with the transformation logic implementation.
43-47: Response type extension maintains compatibility.The type properly extends the existing
ProcessorTransformationOutputwhile adding the specific JSON body structure for this destination's responses.
d353d4c to
75a543c
Compare
|
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 #4352 +/- ##
===========================================
+ Coverage 91.12% 91.13% +0.01%
===========================================
Files 636 638 +2
Lines 33400 33449 +49
Branches 7896 7889 -7
===========================================
+ Hits 30435 30483 +48
- Misses 2696 2727 +31
+ Partials 269 239 -30 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ba69e2b to
cce9063
Compare
|
Allure Test reports for this run are available at:
|
1 similar comment
|
Allure Test reports for this run are available at:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (4)
src/v0/destinations/rudder_test/utils.ts (4)
14-21: Consider making timestamp generation more explicit.The payload building logic is solid, but the fallback timestamp generation could be more explicit about timezone handling.
Consider this improvement for better timestamp handling:
- timestamp: message.timestamp || new Date().toISOString(), + timestamp: message.timestamp || new Date().toISOString(),Alternatively, you might want to document the timezone behavior or consider using a consistent UTC timestamp format.
23-38: Remove unused request body formats to reduce noise.The request configuration structure includes unused body formats that add unnecessary complexity.
Consider removing unused body format placeholders:
body: { JSON: buildJsonPayload(message), - JSON_ARRAY: {}, - XML: {}, - FORM: {}, },This will make the configuration cleaner and more focused on the actual requirements.
43-47: Refactor boolean conversion for better readability.The double negation pattern works but could be more explicit for better code readability.
Consider this more explicit approach:
- return !!(testBehavior?.statusCode && testBehavior.statusCode !== 200); + return Boolean(testBehavior?.statusCode && testBehavior.statusCode !== 200);This makes the boolean conversion intent more explicit.
49-56: Extract common test behavior validation logic.There's duplication between this function and
hasTestBehaviorErrorthat could be reduced.Consider extracting the common validation logic:
+const isErrorStatusCode = (statusCode?: number): boolean => + Boolean(statusCode && statusCode !== 200); + export const checkTestBehaviorAndThrow = (message: RudderTestMessage): void => { const testBehavior = getTestBehavior(message); - if (testBehavior?.statusCode && testBehavior.statusCode !== 200) { + if (isErrorStatusCode(testBehavior?.statusCode)) { throw new InstrumentationError(testBehavior.errorMessage || 'Test error'); } };Then update
hasTestBehaviorErrorto use the same helper function.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between cce90635f7eff9bcc1475dc789b7ad105e5edeb0 and 8a149b1e629bdf42a3eb28800677afeae0551327.
⛔ Files ignored due to path filters (4)
package.jsonis excluded by!**/*.jsontest/integrations/component.test.tsis excluded by!**/test/**test/integrations/destinations/rudder_test/processor/data.tsis excluded by!**/test/**test/integrations/destinations/rudder_test/router/data.tsis excluded by!**/test/**
📒 Files selected for processing (2)
src/v0/destinations/rudder_test/transform.ts(1 hunks)src/v0/destinations/rudder_test/utils.ts(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- src/v0/destinations/rudder_test/transform.ts
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/v0/destinations/rudder_test/utils.ts (1)
src/v0/destinations/rudder_test/type.ts (1)
RudderTestMessage(17-21)
⏰ 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 (go)
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (3)
src/v0/destinations/rudder_test/utils.ts (3)
1-3: Clean imports and well-structured module setup.The imports are properly organized and follow TypeScript best practices. Good use of local imports for configuration and types.
5-12: Validate message type function implementation is correct.The validation logic is straightforward and appropriately throws an InstrumentationError for unsupported message types. The error message is descriptive and helpful for debugging.
40-41: Simple and effective getter function.Clean implementation using optional chaining. This pattern is consistent and safe.
|
Allure Test reports for this run are available at:
|
|
Allure Test reports for this run are available at:
|
c0d49e0 to
97e46c2
Compare
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/middlewares/routerTransformCompactedPayloadV1.ts (1)
27-27: Excellent security practice with proper placement.Applying
deepFreezeto the destination config is a solid security measure that prevents downstream mutations. The placement after destination validation but before connection processing is appropriate.Consider documenting this behavior change if destinations previously relied on config mutability, though the immutability should be the expected standard.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between c0d49e027cb738541bc0fcfc434cda1070faf03e and 97e46c2e3789c0694e825f80e692ef15f33ee90e.
⛔ Files ignored due to path filters (7)
README.mdis excluded by!**/*.mdpackage-lock.jsonis excluded by!**/package-lock.json,!**/*.jsonpackage.jsonis excluded by!**/*.jsontest/integrations/component.test.tsis excluded by!**/test/**test/integrations/destinations/rudder_test/common.tsis excluded by!**/test/**test/integrations/destinations/rudder_test/processor/data.tsis excluded by!**/test/**test/integrations/destinations/rudder_test/router/data.tsis excluded by!**/test/**
📒 Files selected for processing (7)
src/middlewares/destTransformCompactedPayloadV1.ts(2 hunks)src/middlewares/routerTransformCompactedPayloadV1.ts(2 hunks)src/util/dynamicConfigParser.ts(2 hunks)src/v0/destinations/rudder_test/config.ts(1 hunks)src/v0/destinations/rudder_test/transform.ts(1 hunks)src/v0/destinations/rudder_test/type.ts(1 hunks)src/v0/destinations/rudder_test/utils.ts(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
- src/v0/destinations/rudder_test/config.ts
- src/v0/destinations/rudder_test/transform.ts
- src/v0/destinations/rudder_test/utils.ts
- src/v0/destinations/rudder_test/type.ts
⏰ Context from checks skipped due to timeout of 90000ms (9)
- 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: Build Transformer Docker Image - PR / Build Transformer Docker Image AMD64
- GitHub Check: Build 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 (javascript-typescript)
- GitHub Check: Analyze (go)
🔇 Additional comments (6)
src/middlewares/routerTransformCompactedPayloadV1.ts (1)
2-2: Good addition of deepFreeze import for config immutability.The import change correctly adds the
deepFreezeutility to support config immutability enforcement.src/middlewares/destTransformCompactedPayloadV1.ts (2)
2-2: Consistent import addition for config immutability.The deepFreeze import aligns with the same change in the router middleware, maintaining consistency across the codebase.
23-23: Proper immutability enforcement with good placement.The deepFreeze application is correctly placed after destination validation and maintains consistency with the router middleware implementation. This ensures destination configs are immutable throughout the processing pipeline.
src/util/dynamicConfigParser.ts (3)
14-15: Well-designed regex pattern for path validation.The PATH_VALIDATION_REGEX correctly validates dot-notation paths with appropriate constraints:
- Starts with letter or underscore
- Allows word characters in path segments
- Supports dot-separated segments
This provides good security by preventing injection of invalid path patterns while supporting legitimate use cases like
event.context.traits.email.
45-45: Proper integration of path validation.The regex validation is correctly integrated into the template parsing logic, providing an additional security layer to ensure only valid dot-notation paths are processed.
158-158:Details
✅ Verification successful
Good modernization to native structuredClone.
Replacing lodash's
cloneDeepwith nativestructuredCloneis a performance improvement and reduces dependencies. However, ensure compatibility requirements are met sincestructuredClonerequires Node.js 17+ or modern browsers.Please verify that the runtime environment supports
structuredClone:
🏁 Script executed:
#!/bin/bash # Check Node.js version requirements and structuredClone availability echo "Checking Node.js version and structuredClone support..." # Check if package.json specifies Node.js version requirements if [ -f "package.json" ]; then echo "=== package.json engines ===" jq '.engines' package.json 2>/dev/null || echo "No engines specified" fi # Check if there are any Node.js version files if [ -f ".nvmrc" ]; then echo "=== .nvmrc content ===" cat .nvmrc fi if [ -f ".node-version" ]; then echo "=== .node-version content ===" cat .node-version fi # Check for any documentation about Node.js requirements echo "=== Searching for Node.js version documentation ===" fd -t f "README|CONTRIBUTING|CHANGELOG" | head -5 | xargs rg -i "node.*version|node.*require" 2>/dev/null || echo "No explicit Node.js version documentation found"Length of output: 1152
structuredClone compatibility confirmed
The project’s .nvmrc pins Node.js to v20.18.3 (≥17.0), so native structuredClone is fully supported.
Approving the replacement ofcloneDeepwithstructuredClone.
|
Allure Test reports for this run are available at:
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/v0/destinations/rudder_test/type.ts (1)
40-47: Consider using a more specific type instead ofanyfor fields.The interface structure is good for echoing back record data, but the
fieldsproperty usesanywhich reduces type safety.Consider replacing
anywith a more specific type:- fields: Record<string, any>; + fields: Record<string, unknown>;Or even better, if the fields structure is known:
- fields: Record<string, any>; + fields: Record<string, string | number | boolean | null>;This maintains flexibility while providing better type safety and preventing potential runtime issues.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between 97e46c2e3789c0694e825f80e692ef15f33ee90e and 400c2bfc62f95d6bc3743ff154acd52d1d07417e.
⛔ Files ignored due to path filters (4)
test/integrations/destinations/rudder_test/common.tsis excluded by!**/test/**test/integrations/destinations/rudder_test/processor/data.tsis excluded by!**/test/**test/integrations/destinations/rudder_test/router/data.tsis excluded by!**/test/**test/integrations/testTypes.tsis excluded by!**/test/**
📒 Files selected for processing (3)
src/v0/destinations/rudder_test/transform.ts(1 hunks)src/v0/destinations/rudder_test/type.ts(1 hunks)src/v0/destinations/rudder_test/utils.ts(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- src/v0/destinations/rudder_test/transform.ts
- src/v0/destinations/rudder_test/utils.ts
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/v0/destinations/rudder_test/type.ts (4)
src/types/rudderEvents.ts (2)
RudderRecordV2(80-80)Metadata(121-121)src/types/controlPlaneConfig.ts (1)
Destination(11-23)src/types/destinationTransformation.ts (2)
RouterTransformationRequestData(89-100)ProcessorTransformationOutput(66-76)src/v0/destinations/intercom_v2/config.js (1)
RecordAction(9-13)
⏰ Context from checks skipped due to timeout of 90000ms (8)
- GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image AMD64
- 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: Code Coverage
- GitHub Check: UT Tests
- GitHub Check: test_and_publish
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Analyze (go)
🔇 Additional comments (6)
src/v0/destinations/rudder_test/type.ts (6)
1-8: LGTM: Clean and well-organized imports.The import statements are well-structured and all imported types are utilized within the file. The relative path imports are correct for the file structure.
10-14: LGTM: Simple and effective test behavior interface.The
TestBehaviorinterface provides a clean way to control test responses with a required status code and optional error message, which aligns well with the testing objectives mentioned in the PR.
16-21: LGTM: Proper type extension for test context.The
RudderTestMessagetype correctly extendsRudderRecordV2while adding the optionaltestBehaviorto the context. The intersection type usage and optional chaining structure are implemented correctly.
23-28: LGTM: Flexible configuration interface.The
RudderTestConfiginterface appropriately makes all fields optional, which is suitable for a test destination that should work with minimal configuration.
30-38: LGTM: Proper generic type usage.Both
RudderTestDestinationandRudderTestRouterRequesttypes correctly utilize generics and follow the established patterns in the codebase. The explicit documentation about not needing a connection is helpful.
49-54: LGTM: Consistent response type structure.The
RudderTestResponsetype properly extendsProcessorTransformationOutputand follows the established pattern for response body structure with the optional JSON payload.
400c2bf to
bc8752d
Compare
|
Allure Test reports for this run are available at:
|
f6d7aa7 to
a8841db
Compare
|
Allure Test reports for this run are available at:
|
a8841db to
c441452
Compare
- 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
c441452 to
c6c2958
Compare
|
Allure Test reports for this run are available at:
|
|
Allure Test reports for this run are available at:
|
|
* 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]>



Summary
This PR implements a new
rudder-testdestination designed for platform testing and development, along with migrated tests following the new test format.What's New
🎯 Rudder Test Destination
context.testBehavior🧪 Test Implementation
generateMetadatautility🛠️ Developer Experience
npm run test:ts:component:rudder_testfor convenient test executionKey Features
Context-Based Test Control
Use Cases
Files Added
Destination Implementation
src/v0/destinations/rudder_test/transform.ts- Main transformation logicsrc/v0/destinations/rudder_test/type.ts- TypeScript type definitionssrc/v0/destinations/rudder_test/config.ts- Basic configurationTest Infrastructure
test/integrations/destinations/rudder_test/common.ts- Shared test utilitiestest/integrations/destinations/rudder_test/router/data.ts- Router test casesDocumentation
RUDDER_TEST_DESTINATION_PLAN.md- Implementation plan and architectureINTEGRATION_TEST_PLAN.md- Testing strategy and validationREADME.mdwith comprehensive destination documentationFiles Modified
package.json- Addedrudder-testsnpm scripttest/integrations/component.test.ts- Added toINTEGRATIONS_WITH_UPDATED_TEST_STRUCTURETesting
✅ All tests pass (2/2 router tests)
✅ Zod validation enabled
✅ Enhanced Allure reporting active
✅ Pre-commit hooks pass (TypeScript + JavaScript tests + linting)
✅ Test migration completed successfully
Usage
Implementation Highlights
statTagsBenefits
This destination provides a controlled, predictable environment for testing RudderStack's transformation pipeline and serves as an excellent reference for destination development.
Resolves INT-3620
Pull Request opened by Augment Code with guidance from the PR author