Repository navigation
chore(release): pull main into develop post release v1.97.1 - #4268
Conversation
Summary by CodeRabbit
WalkthroughThis update introduces conditional property inclusion and safer property access in workflow and utility files. In the Userpilot workflow YAML, the payload construction is refined to only include the "company" field if a specific trait exists and is not null, and the event field key is renamed in the tracking step. Payload cleaning is also made more explicit. In the Shopify pixel utility JavaScript, optional chaining is added to prevent runtime errors when accessing deeply nested properties, ensuring robustness against undefined or null intermediate objects. Changes
Suggested reviewers
Suggestions for improvement: Tip ⚡💬 Agentic Chat (Pro Plan, General Availability)
✨ Finishing Touches
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
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/cdk/v2/destinations/userpilot/procWorkflow.yaml (2)
39-40: Guardcompany.idpresence using null-safety check
Leveraging$.isDefinedAndNotNull(.message.context.traits.company.id)ensures thecompanyfield is only included when itsidexists, reducing payload bloat. However, ifcompanycan be undefined, consider using optional chaining (.message.context.traits.company?.id) to avoid template evaluation errors.
44-44: Remove trailing spaces to satisfy YAMLlint
The line defining$.context.payload.metadatahas trailing spaces, which triggers lint errors. Removing them will clear the warning:- $.context.payload.metadata = $.removeUndefinedAndNullValues(traits); + $.context.payload.metadata = $.removeUndefinedAndNullValues(traits);🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 44-44: trailing spaces
(trailing-spaces)
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (10)
CHANGELOG.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/userpilot/commonConfig.tsis excluded by!**/test/**test/integrations/destinations/userpilot/maskedSecrets.tsis excluded by!**/test/**test/integrations/destinations/userpilot/processor/data.tsis excluded by!**/test/**test/integrations/destinations/userpilot/processor/groupTestData.tsis excluded by!**/test/**test/integrations/destinations/userpilot/processor/identifyTestData.tsis excluded by!**/test/**test/integrations/destinations/userpilot/processor/trackTestData.tsis excluded by!**/test/**
📒 Files selected for processing (2)
src/cdk/v2/destinations/userpilot/procWorkflow.yaml(4 hunks)src/sources/shopify/webpixelTransformations/pixelUtils.js(3 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/sources/shopify/webpixelTransformations/pixelUtils.js
🪛 YAMLlint (1.35.1)
src/cdk/v2/destinations/userpilot/procWorkflow.yaml
[error] 44-44: trailing spaces
(trailing-spaces)
⏰ Context from checks skipped due to timeout of 90000ms (5)
- GitHub Check: Code Coverage
- GitHub Check: UT Tests
- GitHub Check: test_and_publish
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (8)
src/sources/shopify/webpixelTransformations/pixelUtils.js (3)
85-85: Ensure safe access tocart_idwith optional chaining
UsinginputEvent.data?.cart?.idprevents errors whendataorcartis missing. This change aligns with the rest of the file’s optional chaining usage.
166-166: Use optional chaining forcheckout_id
Switching toinputEvent?.data?.checkout?.tokenguards against undefined intermediate objects, reducing the risk of runtime exceptions.
178-178: Apply optional chaining forquery
AccessinginputEvent?.data?.searchResult?.querysafely handles cases wheresearchResultor its parent objects are nullish.src/cdk/v2/destinations/userpilot/procWorkflow.yaml (5)
6-7: Add binding forisDefinedAndNotNullutility
IncludingisDefinedAndNotNullalongsideremoveUndefinedAndNullValuesallows conditional inclusion of nested fields in payloads. This supports the enhanced null-safety added elsewhere.
31-32: Comment lines for documentation; no action required.
47-47: Comment header for the track payload step; no changes to logic.
56-56: Renameeventtoevent_namein track payload
Updating the key to"event_name"matches the Userpilot API contract and avoids ambiguity with the reservedeventfield.
83-83: Clean payload before assignment
Assigningresponse.body.JSON = $.removeUndefinedAndNullValues($.context.payload)ensures no undefined/null values are sent. This makes the response payload more robust.
|
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 #4268 +/- ##
===========================================
+ Coverage 91.17% 91.21% +0.04%
===========================================
Files 632 632
Lines 33079 33057 -22
Branches 7831 7826 -5
===========================================
- Hits 30160 30154 -6
- Misses 2674 2688 +14
+ Partials 245 215 -30 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|



👑 An automated PR