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

[NT-1741][NT-1743][NT-1744] Adding Segment SDK and deprecating Koala #1367

Merged
merged 37 commits into from
Feb 5, 2021

Conversation

singhhari
Copy link
Contributor

📲 What

Analytics at Kickstarter, prior to this PR, entailed the use of two internal clients. Both Koala and our DataLake clients send events to destinations our Insights team can digest. There are a couple of different things happening in this PR that are all closely related to one another. First, we are adding another dependency that will become our new go-to analytics tool. Segment will be added as a client while we simultaneously deprecate Koala. Furthermore, we are getting rid of the Koala namespace entirely and moving forward with KSRAnalytics. To summarize, we are:

  • Deprecating Koala
  • Adding Segment and implementing its basic functionality
  • Renaming all files and objects that were previously associated with the Koala namespace
  • Fixing a lot of tests

🤔 Why

Kickstarter is moving forward with Segment as our primary analytics tool and this involves not only removing Koala but also incrementally adding functionality that sends useful data to Segment.

🛠 How

Segment provides an SDK with handy methods, which we implement in here. We also have some events our Insights team has approved and removed everything else.

@nativeksr
Copy link
Collaborator

nativeksr commented Jan 29, 2021

1 Warning
⚠️ Big PR

Generated by 🚫 Danger

@codecov
Copy link

codecov bot commented Jan 30, 2021

Codecov Report

Merging #1367 (84fba2d) into master (a13ed6e) will decrease coverage by 0.28%.
The diff coverage is 99.07%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1367      +/-   ##
==========================================
- Coverage   86.12%   85.83%   -0.29%     
==========================================
  Files        1099     1100       +1     
  Lines       97537    95932    -1605     
==========================================
- Hits        84005    82348    -1657     
- Misses      13532    13584      +52     
Impacted Files Coverage Δ
...kstarter-iOS/ViewModels/AppDelegateViewModel.swift 96.33% <ø> (-0.98%) ⬇️
...rter-iOS/ViewModels/SettingsAccountViewModel.swift 94.82% <ø> (-0.42%) ⬇️
...iOS/ViewModels/SettingsAccountViewModelTests.swift 100.00% <ø> (ø)
Kickstarter-iOS/ViewModels/SettingsViewModel.swift 95.23% <ø> (-0.77%) ⬇️
...tarter-iOS/ViewModels/SettingsViewModelTests.swift 100.00% <ø> (ø)
...tarter-iOS/ViewModels/UpdatePreviewViewModel.swift 100.00% <ø> (ø)
Kickstarter-iOS/ViewModels/UpdateViewModel.swift 98.87% <ø> (-0.05%) ⬇️
...S/Views/Controllers/AddNewCardViewController.swift 79.83% <ø> (-0.25%) ⬇️
.../Views/Controllers/ChangeEmailViewController.swift 84.18% <ø> (-0.27%) ⬇️
...iews/Controllers/CommentDialogViewController.swift 0.00% <ø> (ø)
... and 189 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a13ed6e...84fba2d. Read the comment docs.

.circleci/config.yml Show resolved Hide resolved
Library/Tracking/KSRAnalytics.swift Outdated Show resolved Hide resolved
Library/Tracking/Segment.swift Show resolved Hide resolved
Library/Tracking/Segment.swift Outdated Show resolved Hide resolved
Library/Tracking/Segment.swift Show resolved Hide resolved
@@ -102,21 +102,21 @@ internal final class DiscoveryFiltersViewModelTests: TestCase {

XCTAssertEqual(
[],
self.trackingClient.events
self.dataLakeTrackingClient.events
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we keep this as tracking client since we sending events to segment and not just the data lake?

Copy link
Contributor Author

@singhhari singhhari Feb 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So internally trackingClient used to refer to Koala specifically. That client was deleted and now we only have two:

  • dataLakeTrackingClient` and
  • segmentClient
    The data lake and segment tracking clients are technically tracking the same events throughout the app. Should I add an assert for the segmentClient wherever im doing so for the dataLakeClient?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should prepare for a world where we no longer have the datalake client. When the integration is 100% we will transition to use segment. I would recommend to test against the segment client. If its better to do that in another PR then that is also good with me

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just pushed up a large commit with segmentClient tests written wherever there are dataLakeClient assertions.

@singhhari singhhari requested a review from jgsamudio February 2, 2021 23:33
Copy link
Contributor

@jgsamudio jgsamudio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks Good! Thanks Hari!

@singhhari singhhari merged commit 151842d into master Feb 5, 2021
@singhhari singhhari deleted the NT-1724-segment-spike branch February 5, 2021 17:06
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.

4 participants