Repository navigation
fix: check on traits and traits.context (#4682) - #4698
Conversation
* fix: check on traits and traits.context * prioritize message.context.traits
Summary by CodeRabbit
WalkthroughRefactors identify payload construction in src/cdk/v2/destinations/userpilot/procWorkflow.yaml to introduce a unified userTraits source (from message.context.traits or message.traits), derive companyTraits from userTraits.company, update company inclusion checks to use companyTraits.id, and base metadata transformation on the sanitized userTraits. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Src as Event Source
participant Proc as Userpilot ProcWorkflow
participant UP as Userpilot API
Src->>Proc: identify(message)
note over Proc: Build userTraits = context.traits || traits
Proc->>Proc: Derive companyTraits = userTraits.company
alt companyTraits.id present
Proc->>Proc: Include company in payload
else
Proc->>Proc: Set company = null
end
Proc->>Proc: Sanitize userTraits for metadata
Proc->>UP: POST identify payload
UP-->>Proc: Response
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggestions: Verify edge cases where traits are arrays or non-objects; add unit tests for fallback resolution and company nulling. Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/cdk/v2/destinations/userpilot/procWorkflow.yaml(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
- GitHub Check: Build 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 User Transformer Docker Image - PR / Build Transformer Docker Image AMD64
- GitHub Check: Code Coverage
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Analyze (go)
- GitHub Check: UT Tests
- GitHub Check: test_and_publish
|
Allure Test reports for this run are available at:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #4698 +/- ##
=========================================
Coverage 91.79% 91.80%
=========================================
Files 645 650 +5
Lines 34086 34486 +400
Branches 8050 8098 +48
=========================================
+ Hits 31290 31660 +370
- Misses 2544 2574 +30
Partials 252 252 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|



fix: check on traits and traits.context
prioritize message.context.traits
What are the changes introduced in this PR?
Write a brief explainer on your code changes.
What is the related Linear task?
Resolves INT-XXX
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.