Skip to content
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

chore: data pipelines object support #417

Open
wants to merge 2 commits into
base: feature/object-support
Choose a base branch
from

Conversation

mrehan27
Copy link
Contributor

@mrehan27 mrehan27 commented Jul 30, 2024

part of MBL-407

Changes

  • Added TraitsBuilder to simplify adding traits to events (Read full docs here)
  • Added support for associating profile with group

Public API Usage

Using TraitBuilder

val traitsBuilder = TraitsBuilder()
    .addObjectTypeId("100")
    .addRelationshipAttributes(mapOf("manager" to "[email protected]", "department" to "Engineering"))
    .addTrait("companyName" to "NewCompany")
CustomerIO.instance().group(groupId = "Employee", traits = traitsBuilder.build())

Using Custom Serializable Class

val traits = TraitsSerializable(
    companyName = "NewCompany"
)
CustomerIO.instance().group(groupId = "Employee", traits = traits)

Using Json Object

CustomerIO.instance().group(groupId = "Employee", traits = buildJsonObject {
    put("name", "NewCompany")
})

Using Map

CustomerIO.instance().group(groupId = "Employee", traits = buildMap {
    put("name", "NewCompany")
})

Tests

Tests are added in #418

Resources

@mrehan27 mrehan27 self-assigned this Jul 30, 2024
Copy link

github-actions bot commented Jul 30, 2024

Sample app builds 📱

Below you will find the list of the latest versions of the sample apps. It's recommended to always download the latest builds of the sample apps to accurately test the pull request.


  • java_layout: rehan/mbl-407-object-support (1723712022)
  • kotlin_compose: rehan/mbl-407-object-support (1723712029)

Copy link

codecov bot commented Jul 30, 2024

Codecov Report

Attention: Patch coverage is 0% with 22 lines in your changes missing coverage. Please review.

Please upload report for BASE (feature/object-support@47c8a3c). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...customer/datapipelines/data/model/TraitsBuilder.kt 0.00% 11 Missing ⚠️
...ines/src/main/kotlin/io/customer/sdk/CustomerIO.kt 0.00% 8 Missing ⚠️
...ain/kotlin/io/customer/sdk/DataPipelineInstance.kt 0.00% 3 Missing ⚠️
Additional details and impacted files
@@                    Coverage Diff                    @@
##             feature/object-support     #417   +/-   ##
=========================================================
  Coverage                          ?   41.58%           
  Complexity                        ?      256           
=========================================================
  Files                             ?       95           
  Lines                             ?     2251           
  Branches                          ?      319           
=========================================================
  Hits                              ?      936           
  Misses                            ?     1226           
  Partials                          ?       89           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

Build available to test
Version: rehan-mbl-407-object-support-SNAPSHOT
Repository: https://s01.oss.sonatype.org/content/repositories/snapshots/

Copy link

github-actions bot commented Jul 30, 2024

📏 SDK Binary Size Comparison Report

No changes detected in SDK binary size ✅

@mrehan27
Copy link
Contributor Author

I used chore here as the PR will be merged to feature branch. When merging feature branch to main, we can use feat prefix to trigger intended release updates.

@mrehan27 mrehan27 requested a review from a team July 30, 2024 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant