Repository navigation
feat: onboarding new destination loops (#3976) - #4235
Conversation
Summary by CodeRabbit
Summary by CodeRabbit
WalkthroughThe pull request introduces a new YAML configuration file that defines workflow event processing through a series of bindings and steps. It establishes input validation and conditional processing for both identify and track events. The configuration includes steps to ensure required fields are present, differentiate event types, prepare context, construct payloads, and build the final response with API request details. Changes
Sequence Diagram(s)sequenceDiagram
participant E as Event Source
participant V as Validator
participant C as Context Preparer
participant P as Payload Builder
participant R as Response Builder
E->>V: validateInput()
alt Identify Event
V->>V: validateIdentifyEvent()
V->>C: prepareContext()
C->>P: identifyPayload()
else Track Event
V->>V: validateTrackEvent()
V->>C: prepareContext()
C->>P: trackPayload()
end
P->>P: cleanPayload()
P->>R: buildResponse()
R->>E: Return API request details
Possibly related PRs
Suggested reviewers
Suggestions for improvements: 📜 Recent review detailsConfiguration used: .coderabbit.yaml ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (9)
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:
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
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #4235 +/- ##
========================================
Coverage 91.21% 91.21%
========================================
Files 632 632
Lines 33053 33053
Branches 7827 7830 +3
========================================
Hits 30150 30150
- Misses 2658 2688 +30
+ Partials 245 215 -30 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Allure Test reports for this run are available at:
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (3)
src/cdk/v2/destinations/loops/procWorkflow.yaml (3)
1-10: Binding Declarations: Clear and OrganizedThe new bindings for
EventType,removeUndefinedAndNullValues, anddefaultRequestConfigare clearly defined and well-structured. Consider adding brief inline comments describing the purpose of each binding if they are likely to need further clarification in the future.
16-22: Input Validation: Comprehensive Checks with a Minor Formatting NoteThe
validateInputstep robustly asserts the presence of.message.typeand checks that its value is one of the supported event types. Additionally, it verifies that the API key is provided in the destination configuration.
Note: There is a trailing spaces issue on line 19 as flagged by YAMLlint. Removing these extra spaces will improve code cleanliness.🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 19-19: trailing spaces
(trailing-spaces)
70-80: Build Response: Comprehensive Configuration with a Minor Formatting ReminderThe
buildResponsestep constructs the final API request by using the default request configuration and setting the JSON body, endpoint, headers (including authorization), and HTTP method.
Note: YAMLlint reports that the file is missing a newline at the end (line 80). Please add a newline to meet formatting standards.🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 80-80: no new line character at the end of file
(new-line-at-end-of-file)
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between bad8a67 and 88fde0a5cf8bf72e1e92c6c12c006cc8483160ea.
⛔ Files ignored due to path filters (2)
test/integrations/destinations/loops/maskedSecrets.tsis excluded by!**/test/**test/integrations/destinations/loops/processor/data.tsis excluded by!**/test/**
📒 Files selected for processing (1)
src/cdk/v2/destinations/loops/procWorkflow.yaml(1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
src/cdk/v2/destinations/loops/procWorkflow.yaml
[error] 19-19: trailing spaces
(trailing-spaces)
[error] 80-80: no new line character at the end of file
(new-line-at-end-of-file)
🔇 Additional comments (7)
src/cdk/v2/destinations/loops/procWorkflow.yaml (7)
11-15: Message Type Step: Simple and EffectiveThis step converts
.message.typeto lowercase, ensuring consistency in event processing. The implementation is straightforward and meets the requirement.
23-28: Validate Identify Event: Clear AssertionsThis step ensures that an email is present for identify events by extracting it through a generic path, then asserting its existence. The assertion message is clear and informative.
29-36: Validate Track Event: Robust Event CheckThe
validateTrackEventstep verifies that either an email or a userId is present and that an event is defined for track events. This ensures the necessary event attributes are validated before processing.
37-41: Prepare Context: Simple and StraightforwardSetting the context with
.message.type(in lowercase) and initializing an empty payload is a logical preparatory step for subsequent processing.
42-52: Identify Payload Construction: Solid ImplementationThis step builds the payload for identify events by setting the appropriate endpoint, merging traits from the message, and assigning
userIdand$.getGenericPaths("traits")) reliably returns an object to avoid unexpected issues.
53-65: Track Payload Construction: Complete and ClearFor track events, this step constructs the payload by merging traits, assigning user details, and specifying the event name and properties. The use of conditions and payload assignments is clear and aligns with expected API requirements.
66-69: Clean Payload: Effective Data SanitizationUsing the
removeUndefinedAndNullValuesfunction is a good practice to ensure that only well-defined values are included in the payload. This helps maintain data integrity in the API call.
|
Allure Test reports for this run are available at:
|
|
Allure Test reports for this run are available at:
|
Add loops test to this new structure list
https://github.com/rudderlabs/rudder-transformer/blob/develop/test/integrations/component.test.ts#L58
* feat: identify and track for loops * feat: test for mailing lists * Update src/cdk/v2/destinations/loops/procWorkflow.yaml Co-authored-by: Yashasvi Bajpai <[email protected]> * fix: added response step; updated tests * fix: better way to get email and userId * feat: some changes * feat: use type --------- Co-authored-by: Yashasvi Bajpai <[email protected]>
9c73331 to
f6b95ff
Compare
* feat: identify and track for loops * feat: test for mailing lists * Update src/cdk/v2/destinations/loops/procWorkflow.yaml Co-authored-by: Yashasvi Bajpai <[email protected]> * fix: added response step; updated tests * fix: better way to get email and userId * feat: some changes * feat: use type --------- Co-authored-by: Yashasvi Bajpai <[email protected]>
…t.loops_destination
There was a problem hiding this comment.
Actionable comments posted: 2
♻️ Duplicate comments (1)
src/cdk/v2/destinations/loops/procWorkflow.yaml (1)
12-14: Add unit tests for messageType step
It would be useful to have unit or component tests validating that themessageTypestep correctly lowercases the incoming event type and populates$.outputs.messageType. This helps prevent regressions in event routing.
🧹 Nitpick comments (2)
src/cdk/v2/destinations/loops/procWorkflow.yaml (2)
18-21: Unify error message casing
The assertions use inconsistent casing ("message Type"vs"message type"). For clarity and consistency, consider standardizing on a single style, for example"Message type"in all messages.🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 19-19: trailing spaces
(trailing-spaces)
37-40: Reuse computedmessageType
Instead of calling.message.type.toLowerCase()again in theprepareContextstep, you can DRY up the logic by reusing the output from themessageTypestep:- $.context.messageType = .message.type.toLowerCase(); + $.context.messageType = $.outputs.messageType;This avoids redundant transformation and keeps your workflow more maintainable.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between 88fde0a5cf8bf72e1e92c6c12c006cc8483160ea and f6b95ff.
⛔ Files ignored due to path filters (2)
test/integrations/destinations/loops/maskedSecrets.tsis excluded by!**/test/**test/integrations/destinations/loops/processor/data.tsis excluded by!**/test/**
📒 Files selected for processing (1)
src/cdk/v2/destinations/loops/procWorkflow.yaml(1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
src/cdk/v2/destinations/loops/procWorkflow.yaml
[error] 19-19: trailing spaces
(trailing-spaces)
[error] 80-80: no new line character at the end of file
(new-line-at-end-of-file)
⏰ Context from checks skipped due to timeout of 90000ms (8)
- 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 (javascript-typescript)
|
Allure Test reports for this run are available at:
|
|
Allure Test reports for this run are available at:
|
|
Allure Test reports for this run are available at:
|
|
* chore(docs): update README on how to configure secrets in tests (#4242) * chore: remove conplexity issue and redundant comments (#4250) * chore: remove conplexity issue and redundant comments * chore: address comment * chore(deps): bump rudderlabs/build-scan-push-action from 1.5.2 to 1.5.3 (#4236) chore(deps): bump build scan push action to 1.5.3 Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(pyroscope): use forked pyroscope middleware with latest updates * chore(pyroscope): use forked pyroscope middleware with latest updates * chore(pyroscope): use rudderstack scoped pyroscope nodejs * chore(pyroscope): scope and version change * chore: run ingestion svc test after artefacts build (#4196) * chore: run ingestion svc test after artefacts build * fix: test * fix: test * fix: test * chore: test * chore: test * chore: use go version file * chore: use transformer image * chore: misc * chore: review comment * chore: misc * chore: pass secrets * chore: fix workflow * chore: add docker login * chore: pull image * chore: misc * chore: misc * chore: misc * chore: cleanup * chore: remmove env * chore: remove branch * chore: bump actions/setup-node from 4.0.4 to 4.4.0 (#4262) chore(deps): bump actions/setup-node from 4.0.4 to 4.4.0 Bumps [actions/setup-node](https://github.com/actions/setup-node) from 4.0.4 to 4.4.0. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](actions/setup-node@v4.0.4...v4.4.0) --- updated-dependencies: - dependency-name: actions/setup-node dependency-version: 4.4.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump codecov/codecov-action from 5.4.0 to 5.4.2 (#4264) Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5.4.0 to 5.4.2. - [Release notes](https://github.com/codecov/codecov-action/releases) - [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md) - [Commits](codecov/codecov-action@v5.4.0...v5.4.2) --- updated-dependencies: - dependency-name: codecov/codecov-action dependency-version: 5.4.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: convert necessary fields to string for pinterest (#4272) * feat: onboarding new destination loops (#3976) (#4235) * feat: identify and track for loops (#3976) * feat: identify and track for loops * feat: test for mailing lists * Update src/cdk/v2/destinations/loops/procWorkflow.yaml Co-authored-by: Yashasvi Bajpai <[email protected]> * fix: added response step; updated tests * fix: better way to get email and userId * feat: some changes * feat: use type --------- Co-authored-by: Yashasvi Bajpai <[email protected]> * fix: minor issues * chore: added test * feat: identify and track for loops (#3976) * feat: identify and track for loops * feat: test for mailing lists * Update src/cdk/v2/destinations/loops/procWorkflow.yaml Co-authored-by: Yashasvi Bajpai <[email protected]> * fix: added response step; updated tests * fix: better way to get email and userId * feat: some changes * feat: use type --------- Co-authored-by: Yashasvi Bajpai <[email protected]> * fix: minor issues * chore: added test * chore: update test to new structure * chore: minor change * chore: minor change --------- Co-authored-by: Dan <[email protected]> Co-authored-by: Yashasvi Bajpai <[email protected]> * feat: onboarding snapchat v3 (#4052) * feat: snapchat v3 * chore: added mappings for v3 * chore: small fix * chore: updated files * feat: onboarding snapchat capi v3 * feat: refactoring and some changes * chore: minor changes * chore: added tests and minor refactoring * fix: minor change * chore: minor changes --------- Co-authored-by: Manish Kumar <[email protected]> Co-authored-by: Manish Kumar <[email protected]> * fix(dynamicConfigParser): fix cloning issue in getdynamicconfig method (#4278) fix(dynamic config): fix cloning issue in getdynamicconfig method Resolves INT-3571 - Fix bug where original event was being modified instead of cloned event - Add comprehensive tests to verify the fix works correctly - Implement table-driven tests for better maintainability * feat(mixpanel): add support for partial batch failure handling (#4260) * feat(mixpanel): add support for partial batch failure handling * chore: misc * fix: handler * fix: handler * fix: review comments * fix: review comments * chore: review comments * chore: review comments * chore: review comments * chore: review comments * chore: review comments * chore: remove unused code * chore: table test case * chore: table test case * fix: test * chore: improve test * chore: upgrade salesforce api version from v50.0 to v63.0 (#4116) Co-authored-by: Manish Kumar <[email protected]> Co-authored-by: Manish Kumar <[email protected]> * chore: return error when gzip compression fails (#4283) chore: return error when gzip compression fails for mp * chore: revert "chore: upgrade salesforce api version from v50.0 to v63.0" (#4285) Revert "chore: upgrade salesforce api version from v50.0 to v63.0 (#4116)" This reverts commit c600f53. * chore: improving code coverage of snapchat conversion (#4284) * chore: improving code coverage of snapchat conversion * chore: minor change * fix: timestamp duration in v2 api * chore(release): 1.98.0 --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Dilip Kola <[email protected]> Co-authored-by: Yashasvi Bajpai <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Vinay Teki <[email protected]> Co-authored-by: Mahesh Kutty <[email protected]> Co-authored-by: Manish Kumar <[email protected]> Co-authored-by: Dan <[email protected]> Co-authored-by: Aanshi Lahoti <[email protected]> Co-authored-by: Manish Kumar <[email protected]> Co-authored-by: GitHub Actions <[email protected]>



What are the changes introduced in this PR?
ref: https://loops.so/docs/api-reference/update-contact
ref: https://loops.so/docs/api-reference/send-event
Write a brief explainer on your code changes.
What is the related Linear task?
Resolves INT-3196
Please explain the objectives of your changes below
Put down any required details on the broader aspect of your changes. If there are any dependent changes, mandatorily mention them here
Any changes to existing capabilities/behaviour, mention the reason & what are the changes ?
N/A
Any new dependencies introduced with this change?
N/A
Any new generic utility introduced or modified. Please explain the changes.
N/A
Any technical or performance related pointers to consider with the change?
N/A
@coderabbitai review
Developer checklist
My code follows the style guidelines of this project
No breaking changes are being introduced.
All related docs linked with the PR?
All changes manually tested?
Any documentation changes needed with this change?
Is the PR limited to 10 file changes?
Is the PR limited to one linear task?
Are relevant unit and component test-cases added in new readability format?
Reviewer checklist
Is the type of change in the PR title appropriate as per the changes?
Verified that there are no credentials or confidential data exposed with the changes.