-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: onboard topsort destination #1842
Conversation
WalkthroughThis pull request introduces several new configuration files for the "TOPSORT" destination, including Changes
Possibly related PRs
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 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
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #1842 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 2 2
Lines 53 53
Branches 7 7
=========================================
Hits 53 53 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
🧹 Outside diff range and nitpick comments (7)
src/configurations/destinations/topsort/db-config.json (2)
35-103
: Reduce configuration duplication in destConfig.The configuration repeats the same set of keys (
connectionMode
,consentManagement
,oneTrustCookieCategories
,ketchConsentPurposes
) for each platform. Consider refactoring to reduce duplication."destConfig": { "defaultConfig": ["apiKey", "topsortEvents"], - "android": [ - "connectionMode", - "consentManagement", - "oneTrustCookieCategories", - "ketchConsentPurposes" - ], - "ios": [...], + "commonConfig": [ + "connectionMode", + "consentManagement", + "oneTrustCookieCategories", + "ketchConsentPurposes" + ], + "android": "commonConfig", + "ios": "commonConfig", // ... other platforms referencing commonConfig }
106-108
: Consider adding beta expiration date.The configuration is marked as beta. Consider adding an expiration date for the beta status to ensure it's reviewed for production readiness.
"options": { - "isBeta": true + "isBeta": true, + "betaExpiresAt": "2025-03-31" }test/data/validation/destinations/topsort.json (1)
122-131
: Add test case for duplicate event mappings.The test cases don't validate the scenario where the same Topsort event is mapped to multiple Rudderstack events. Add a test case to prevent duplicate mappings.
+ { + "testTitle": "Duplicate Topsort event mappings", + "config": { + "apiKey": "test-api", + "topsortEvents": [ + { + "to": "clicks", + "from": "Product Clicked" + }, + { + "to": "clicks", + "from": "Product Viewed" + } + ] + }, + "result": false, + "err": ["Duplicate Topsort event 'clicks' found in mappings"] + },src/configurations/destinations/topsort/ui-config.json (1)
243-253
: Add tooltip for consent category IDs.The consent category IDs field would benefit from a tooltip explaining the expected format and providing examples of valid IDs.
{ "type": "tagInput", "label": "Enter consent category IDs", "note": "Input your consent category IDs by pressing 'Enter' after each entry. We recommend using IDs instead of names as IDs are unique and less likely to change over time, making them a more reliable choice.", + "tooltip": "Valid consent category IDs are alphanumeric strings (e.g., 'C0001', 'MARKETING_001'). Enter one ID at a time and press Enter.", "configKey": "consents", "tagKey": "consent", "placeholder": "e.g: Marketing", "default": [ { "consent": "" } ] }
src/configurations/destinations/topsort/schema.json (3)
11-39
: Consider enhancing event mapping validation.While the basic structure is good, consider these improvements:
- Add
required: ["from", "to"]
to ensure both mapping fields are provided- Add
minItems
andmaxItems
to prevent empty or overly large mappings- Consider adding more e-commerce events like "Product List Viewed", "Promotion Viewed", etc.
"topsortEvents": { "type": "array", + "minItems": 1, + "maxItems": 100, "items": { "type": "object", + "required": ["from", "to"], "properties": { "from": { "type": "string", "enum": [ "Product Clicked", "Product Viewed", "Product Added", "Product Removed", "Cart Viewed", "Checkout Started", "Checkout Step Viewed", "Payment Info Entered", "Order Updated", "Order Completed", "Order Refunded", "Order Cancelled", + "Product List Viewed", + "Promotion Viewed", + "Promotion Clicked" ] },
688-824
: Consolidate Ketch consent purposes schema.Similar to previous sections, the Ketch consent purposes configuration can be simplified by extracting the common pattern.
+ "definitions": { + "ketchPurposeConfig": { + "type": "array", + "items": { + "type": "object", + "properties": { + "purpose": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + } + }, "ketchConsentPurposes": { "type": "object", "properties": { - "android": { - "type": "array", - ... - }, + "android": { "$ref": "#/definitions/ketchPurposeConfig" }, + "ios": { "$ref": "#/definitions/ketchPurposeConfig" },
825-876
: Simplify connection mode configuration.Since all platforms are restricted to "cloud" mode, consider simplifying this section to reduce redundancy.
"connectionMode": { "type": "object", + "additionalProperties": { + "type": "string", + "enum": ["cloud"] + }, "properties": { - "android": { - "type": "string", - "enum": ["cloud"] - }, - "ios": { - "type": "string", - "enum": ["cloud"] - }, + "android": {}, + "ios": {}, // ... other platforms } }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
src/configurations/destinations/topsort/db-config.json
(1 hunks)src/configurations/destinations/topsort/schema.json
(1 hunks)src/configurations/destinations/topsort/ui-config.json
(1 hunks)test/data/validation/destinations/topsort.json
(1 hunks)
🔇 Additional comments (2)
src/configurations/destinations/topsort/db-config.json (1)
4-21
: Consider adding validation for message types.
The configuration only supports 'track' message type for cloud sources. Consider if other message types like 'identify', 'page', or 'screen' should be supported for a complete integration.
src/configurations/destinations/topsort/schema.json (1)
1-10
: LGTM: API key validation is properly configured.
The schema correctly enforces API key requirements with appropriate pattern matching for template syntax, environment variables, and direct values, with a reasonable maximum length limit.
What are the changes introduced in this PR?
Onboarded new destination : Topsort
What is the related Linear task?
Resolves INT-2661
UI:
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 checks got introduced or modified in test suites. Please explain the changes.
N/A
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?
I have executed schemaGenerator tests and updated schema if needed
Are sensitive fields marked as secret in definition config?
My test cases and placeholders use only masked/sample values for sensitive fields
Is the PR limited to 10 file changes & one task?
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.
Summary by CodeRabbit
New Features
Tests