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: send analytics events from individual to team migration - WPB-11319 #2277

Merged
merged 160 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from 158 commits
Commits
Show all changes
160 commits
Select commit Hold shift + click to select a range
fa9c3e3
rename file
caldrian Dec 5, 2024
a41a7d5
prepare for creating the event definitions
caldrian Dec 5, 2024
4515624
declare events
caldrian Dec 5, 2024
be2cbed
minor adjustment
caldrian Dec 6, 2024
b51e1c8
update to develop
caldrian Dec 9, 2024
56b2057
re-apply changes
caldrian Dec 9, 2024
bb09b2e
Merge branch 'develop' of github.com:wireapp/wire-ios into chore/pers…
caldrian Dec 9, 2024
ecb2182
cleanup
caldrian Dec 9, 2024
db6b5b5
delete Countly references
caldrian Dec 9, 2024
f09c4af
chore: resolve todos in WireAnalytics - WPB-11881
caldrian Dec 9, 2024
dc03f4c
Merge branch 'chore/resolve-todos-WPB-10941.squashed' into chore/coun…
caldrian Dec 9, 2024
e51a66a
fix build errors
caldrian Dec 9, 2024
eb66034
create CountlyWrapper
caldrian Dec 9, 2024
e1650d8
closure for countly
caldrian Dec 9, 2024
0aa4771
Merge remote-tracking branch 'github/gh-readonly-queue/develop/pr-225…
caldrian Dec 9, 2024
3774ecd
Merge branch 'chore/resolve-todos-WPB-10941.squashed' into chore/coun…
caldrian Dec 9, 2024
6e7d6ac
linke WireAnalytics into WireDomain
caldrian Dec 9, 2024
d7337fe
link WireAnalytics into Wire-iOS
caldrian Dec 9, 2024
8da07d5
feat: show individual to team migration banner when API v7 is availab…
El-Fitz Dec 9, 2024
7c762ce
fix: dismiss banner on team creation
El-Fitz Dec 9, 2024
8a7a1aa
fix: dismiss banner on team creation
El-Fitz Dec 9, 2024
6c31c98
Merge branch 'feat/individual-to-team-migration-integration' into cho…
caldrian Dec 9, 2024
72775a3
Merge branch 'develop' into chore/countly-abstraction-WPB-11319
caldrian Dec 9, 2024
6183888
style: fix formatting
El-Fitz Dec 9, 2024
6663d04
Merge branch 'chore/countly-abstraction-WPB-11319' into chore/persona…
caldrian Dec 9, 2024
783709d
fix warning
caldrian Dec 9, 2024
5d53a9d
Merge branch 'develop' of github.com:wireapp/wire-ios into chore/coun…
caldrian Dec 10, 2024
788fd88
fix: check API version, refactor calls
El-Fitz Dec 10, 2024
7dcf480
style: fix formatting
El-Fitz Dec 10, 2024
63de94f
style: fix formatting
El-Fitz Dec 10, 2024
14e2eb0
Merge branch 'develop' into feat/individual-to-team-migration-integra…
netbe Dec 10, 2024
0269a31
create target WireCountly
caldrian Dec 10, 2024
472712d
cleanup
caldrian Dec 10, 2024
db78b91
dummy target
caldrian Dec 10, 2024
cd0f899
Merge branch 'chore/countly-abstraction-WPB-11319.todo' into chore/co…
caldrian Dec 10, 2024
09bccf3
minor cleanup
caldrian Dec 10, 2024
9fccffa
Trigger CI
caldrian Dec 10, 2024
bb9d641
format code
caldrian Dec 10, 2024
2eb4c2f
fix: format Swift code - WPB-10347
caldrian Dec 10, 2024
ae51445
Merge branch 'fix/format-code-WPB-10347' into chore/countly-abstracti…
caldrian Dec 10, 2024
ee274d6
use env var ENABLE_COUNTLY
caldrian Dec 10, 2024
ac59ee9
explicitly declare variable
caldrian Dec 10, 2024
68090a9
Merge branch 'develop' into feat/individual-to-team-migration-integra…
netbe Dec 10, 2024
028b67a
Merge branch 'develop' of github.com:wireapp/wire-ios into chore/coun…
caldrian Dec 10, 2024
50b5124
don't expose countly for c1/c2/c3
caldrian Dec 10, 2024
ea9d155
remove default for countly_enabled
caldrian Dec 10, 2024
bad64cf
add comment
caldrian Dec 10, 2024
4789a4a
apply changes
caldrian Dec 10, 2024
61cabde
Merge commit '8a7a1aa' into feat/individual-to-team-migration-integra…
caldrian Dec 10, 2024
700ff2f
Merge commit '68090a9f6b99693f4859bc659648cb7a52676f0e' into feat/ind…
caldrian Dec 10, 2024
ecc0f65
Merge branch 'develop' of github.com:wireapp/wire-ios into feat/indiv…
caldrian Dec 10, 2024
8c3d33a
Merge branch 'feat/individual-to-team-migration-integration' into cho…
caldrian Dec 10, 2024
b3aadfa
Merge branch 'chore/countly-abstraction-WPB-11319' into chore/persona…
caldrian Dec 10, 2024
8ece172
Merge branch 'develop' into chore/countly-abstraction-WPB-11319
caldrian Dec 10, 2024
b60cd7e
Merge remote-tracking branch 'github/chore/countly-abstraction-WPB-11…
caldrian Dec 10, 2024
135f919
Merge branch 'develop' of github.com:wireapp/wire-ios into chore/pers…
caldrian Dec 11, 2024
3f30e94
fix build errors
caldrian Dec 11, 2024
84ba142
Merge branch 'develop' of github.com:wireapp/wire-ios into chore/coun…
caldrian Dec 11, 2024
306c059
revert renaming
caldrian Dec 11, 2024
d5b2e98
Merge branch 'chore/countly-abstraction-WPB-11319' into chore/persona…
caldrian Dec 11, 2024
1710849
rename file
caldrian Dec 11, 2024
3940914
fix: turn ZMUserSession.apiService into a computed property
El-Fitz Dec 11, 2024
72e6d39
prepare for triggering analytics event
caldrian Dec 11, 2024
bd3de74
fix: set WireTestStyleMapping environment in personnal to team
El-Fitz Dec 11, 2024
92323a9
add TODOs
caldrian Dec 11, 2024
0016575
Trigger CI
caldrian Dec 11, 2024
304d661
format code
caldrian Dec 11, 2024
3f51f86
inject analytics event tracker
caldrian Dec 11, 2024
ab8c955
wip
caldrian Dec 11, 2024
4e986a4
public SegmentationEntry.init
caldrian Dec 11, 2024
362627f
flow start event
caldrian Dec 11, 2024
87677d2
Merge branch 'develop' of github.com:wireapp/wire-ios into chore/coun…
caldrian Dec 11, 2024
c9115d5
Merge branch 'chore/countly-abstraction-WPB-11319' into chore/persona…
caldrian Dec 11, 2024
01ba5d5
wip
caldrian Dec 11, 2024
0c9b9e5
Merge branch 'develop' of github.com:wireapp/wire-ios into chore/pers…
caldrian Dec 11, 2024
b98cd9b
fix: red asterisk, text alignment
El-Fitz Dec 11, 2024
0579c64
fix: content views height
El-Fitz Dec 11, 2024
fddac29
fix: open pricing page in selected browser
El-Fitz Dec 11, 2024
3ffd1aa
fix: inverted strings
El-Fitz Dec 11, 2024
bfc8db2
fix: confirmation view items alignment
El-Fitz Dec 11, 2024
d18a389
fix: strings catalog
El-Fitz Dec 11, 2024
6074429
fix: checkbox colours
El-Fitz Dec 11, 2024
6781533
style: fix formatting
El-Fitz Dec 11, 2024
76cfdd2
fix: inject URLs
El-Fitz Dec 11, 2024
919fd77
style: fix formatting
El-Fitz Dec 11, 2024
f3ec8f1
result builder
caldrian Dec 12, 2024
6e513f1
Merge branch 'develop' of github.com:wireapp/wire-ios into chore/pers…
caldrian Dec 12, 2024
54c28e5
add segmentation to analytics events
caldrian Dec 12, 2024
7070f40
cleanup
caldrian Dec 12, 2024
d8134d9
restore removed event, format code
caldrian Dec 12, 2024
a4cef38
Merge branch 'develop' of github.com:wireapp/wire-ios into chore/pers…
caldrian Dec 12, 2024
ee6bae9
fix keychain error
johnxnguyen Dec 12, 2024
42d35c4
resolve TODO
caldrian Dec 12, 2024
34b06c9
fix success response decoding and add tests
johnxnguyen Dec 12, 2024
10114f5
fix always displaying generic error
johnxnguyen Dec 12, 2024
bfa36d3
add resources for tests
johnxnguyen Dec 12, 2024
d79e768
fix: pass the actual api version
El-Fitz Dec 12, 2024
6ae1e94
fix: content view size
El-Fitz Dec 12, 2024
0188a47
fix: use verbatimtext for • and * f instead of strings catalog
El-Fitz Dec 12, 2024
9bc138f
fix team not stored after migration
johnxnguyen Dec 12, 2024
c0725ec
Merge branch 'develop' into fix/misc-individual-to-team-fixes
johnxnguyen Dec 12, 2024
6e0797f
format
johnxnguyen Dec 12, 2024
3b5f5bf
Merge branch 'fix/misc-individual-to-team-fixes' of github.com:wireap…
johnxnguyen Dec 12, 2024
1699e5d
fix: back button text color in dark mode is now white
El-Fitz Dec 12, 2024
3917a48
add TODO
caldrian Dec 13, 2024
78c1e49
Merge branch 'develop' of github.com:wireapp/wire-ios into chore/pers…
caldrian Dec 13, 2024
26371b8
Merge branch 'develop' into fix/misc-individual-to-team-fixes
netbe Dec 13, 2024
dd2ff24
move files
caldrian Dec 13, 2024
c12fc1c
undo move files
caldrian Dec 13, 2024
ac29d71
Merge branch 'fix/misc-individual-to-team-fixes' into chore/personal-…
caldrian Dec 13, 2024
65c8dfb
track open profile from sidebar event
caldrian Dec 13, 2024
a949895
track open profile from the navigation bar event
caldrian Dec 13, 2024
5bff751
resolve TODO
caldrian Dec 13, 2024
25c0201
prepare for sending analytics for modal dismiss
caldrian Dec 13, 2024
00eb437
groups to folders
caldrian Dec 13, 2024
7df5ca8
fixes
caldrian Dec 13, 2024
48ddcc5
cleanup
caldrian Dec 13, 2024
9d34e25
preparations
caldrian Dec 13, 2024
ce070da
Merge branch 'develop' of github.com:wireapp/wire-ios into chore/pers…
caldrian Dec 13, 2024
a59b3e6
flow completion events
caldrian Dec 13, 2024
31034af
cancel events
caldrian Dec 13, 2024
973c7ee
flow stopped event
caldrian Dec 13, 2024
b6cd588
format code
caldrian Dec 13, 2024
cd0469b
resolve TODO
caldrian Dec 13, 2024
252a226
some cleanup
caldrian Dec 13, 2024
12e8b84
Merge branch 'develop' of github.com:wireapp/wire-ios into fix/misc-i…
caldrian Dec 13, 2024
23388c7
Merge branch 'fix/misc-individual-to-team-fixes' into chore/personal-…
caldrian Dec 13, 2024
cd40f67
fix: remove back button on completion view
El-Fitz Dec 13, 2024
6d63236
fix: remove extraneous HStack
El-Fitz Dec 13, 2024
a1155b9
fix: show the correct step number on confirmation view
El-Fitz Dec 13, 2024
c0c6721
Merge remote-tracking branch 'github/fix/misc-individual-to-team-fixe…
caldrian Dec 13, 2024
5071e34
fix build error
caldrian Dec 13, 2024
ecf4063
chore: remove leftover guard
El-Fitz Dec 13, 2024
4306fba
chore: remove leftover todo
El-Fitz Dec 13, 2024
12961f0
fix: misc requested changes & improvements
El-Fitz Dec 13, 2024
d75a236
Merge branch 'develop' of github.com:wireapp/wire-ios into fix/misc-i…
caldrian Dec 13, 2024
3e80d66
Merge branch 'chore/WPB-14957' into chore/personal-to-team-analytics-…
caldrian Dec 13, 2024
04d75ac
Merge branch 'develop' into fix/misc-individual-to-team-fixes
El-Fitz Dec 13, 2024
5ce6fd6
Merge remote-tracking branch 'github/fix/misc-individual-to-team-fixe…
caldrian Dec 13, 2024
a685df7
Merge branch 'gh-readonly-queue/develop/pr-2284-af0e0b5b7f78acc51d778…
caldrian Dec 13, 2024
ee1cab3
Merge branch 'fix/misc-individual-to-team-fixes' into chore/personal-…
caldrian Dec 13, 2024
b8e0564
undo snapshot reference image change
caldrian Dec 14, 2024
ffca7ca
Merge branch 'develop' of github.com:wireapp/wire-ios into chore/pers…
caldrian Dec 16, 2024
46e4dd4
var to let
caldrian Dec 16, 2024
5d1d4b7
Merge branch 'develop' of github.com:wireapp/wire-ios into chore/pers…
caldrian Dec 16, 2024
a2724c3
improve structure of predefined analytics events
caldrian Dec 16, 2024
3c4d9a0
fix build errors
caldrian Dec 16, 2024
d1ce73a
rename events
caldrian Dec 16, 2024
27cde8f
move files
caldrian Dec 16, 2024
d4a913b
fix build errors
caldrian Dec 16, 2024
089c7f4
remove redundant file
caldrian Dec 16, 2024
1d04314
minor change
caldrian Dec 16, 2024
6a8e027
make SegmentationEntry internal
caldrian Dec 16, 2024
9ca1952
format code
caldrian Dec 16, 2024
54b61be
Merge branch 'release/cycle-3.115' of github.com:wireapp/wire-ios int…
caldrian Dec 16, 2024
ee753df
fix build error
caldrian Dec 16, 2024
9369e48
Merge branch 'release/cycle-3.115' of github.com:wireapp/wire-ios int…
caldrian Dec 16, 2024
420cc58
Trigger CI
caldrian Dec 16, 2024
2e8c032
Merge branches 'release/cycle-3.115' and 'chore/personal-to-team-anal…
caldrian Dec 16, 2024
f1cd332
address PR comments
caldrian Dec 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions .github/workflows/swiftformat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,6 @@ jobs:
- uses: actions/checkout@v4
- name: GitHub Action for SwiftFormat
run: >
swiftformat --lint
./WirePlugins
./WireAPI
./WireAnalytics
./WireDomain
./WireFoundation
./WireUI
./scripts
swiftformat --lint .
caldrian marked this conversation as resolved.
Show resolved Hide resolved
--reporter github-actions-log
--config .swiftformat

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
//
// Wire
// Copyright (C) 2024 Wire Swiss GmbH
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see http://www.gnu.org/licenses/.
//

// Allows for writing the event initialization with segmentations more compact.

extension AnalyticsEvent {

@resultBuilder
struct SegmentationEntryBuilder {

static func buildBlock(_ components: [SegmentationEntry]...) -> [SegmentationEntry] {
components.flatMap { $0 }
}

static func buildExpression(_ expression: SegmentationEntry) -> [SegmentationEntry] {
[expression]
}

static func buildExpression(_ expression: [SegmentationEntry]) -> [SegmentationEntry] {
expression
}

static func buildOptional(_ components: [SegmentationEntry]?) -> [SegmentationEntry] {
components ?? []
}

static func buildEither(first components: [SegmentationEntry]) -> [SegmentationEntry] {
components
}

static func buildEither(second components: [SegmentationEntry]) -> [SegmentationEntry] {
components
}
}

/// Create a new `AnalyticsEvent`.
///
/// - Parameters:
/// - name: A unique name.
/// - segmentation: Additional metadata.

init(
name: String,
@SegmentationEntryBuilder segmentation: () -> [SegmentationEntry]
) {
self.init(
name: name,
segmentation: segmentation()
)
}
}
13 changes: 6 additions & 7 deletions WireAnalytics/Sources/WireAnalytics/Events/AnalyticsEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
// along with this program. If not, see http://www.gnu.org/licenses/.
//

/// An event that can be tracked..
/// An event that can be tracked.

public struct AnalyticsEvent: Sendable, Equatable {
public struct AnalyticsEvent: Equatable, Sendable {

/// A unique name.

Expand All @@ -34,14 +34,13 @@ public struct AnalyticsEvent: Sendable, Equatable {
/// - name: A unique name.
/// - segmentation: Additional metadata.

init(
init<Collection>(
name: String,
segmentation: Set<SegmentationEntry> = []
) {
segmentation: Collection = []
) where Collection: Swift.Collection, Collection.Element == SegmentationEntry {
self.name = name
self.segmentation = segmentation
self.segmentation = Set(segmentation)
}

}

extension AnalyticsEvent: CustomDebugStringConvertible {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//
// Wire
// Copyright (C) 2024 Wire Swiss GmbH
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see http://www.gnu.org/licenses/.
//

public extension AnalyticsEvent {

enum App {
caldrian marked this conversation as resolved.
Show resolved Hide resolved

/// An event tracking when the user opens the app.

public static let open = AnalyticsEvent(name: "app.open")

}
}
caldrian marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//
// Wire
// Copyright (C) 2024 Wire Swiss GmbH
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see http://www.gnu.org/licenses/.
//

public extension AnalyticsEvent {

enum Backup {
caldrian marked this conversation as resolved.
Show resolved Hide resolved

/// An event tracking when the user fails to export a backup.

public static let exportFailed = AnalyticsEvent(name: "backup.export_failed")

/// An event tracking when the user successuflly restores a backup.

public static let restored = AnalyticsEvent(name: "backup.restore_succeeded")

/// An event tracking when the user fails to restores a backup.

public static let restoredFailed = AnalyticsEvent(name: "backup.restore_failed")

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
//
// Wire
// Copyright (C) 2024 Wire Swiss GmbH
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see http://www.gnu.org/licenses/.
//

public extension AnalyticsEvent {

enum Calling {
caldrian marked this conversation as resolved.
Show resolved Hide resolved

/// An event tracking when the user initiates a call.
///
/// - Parameters:
/// - isVideo: Whether video is enabled.
/// - conversationType: The type of conversation.
///
/// - Returns: A call initialized analytics event.

public static func initiatedCall(
isVideo: Bool,
conversationType: ConversationType
) -> AnalyticsEvent {
AnalyticsEvent(
name: "calling.initiated_call",
segmentation: [
.isVideoCall(isVideo),
.groupType(conversationType)
]
)
}

/// An event tracking when the user joins a call.
///
/// - Parameters:
/// - isVideo: Whether video is enabled.
/// - conversationType: The type of conversation.
///
/// - Returns: A call joined analytics event.

public static func joinedCall(
isVideo: Bool,
conversationType: ConversationType
) -> AnalyticsEvent {
AnalyticsEvent(
name: "calling.joined_call",
segmentation: [
.isVideoCall(isVideo),
.groupType(conversationType)
]
)
}

/// An event tracking the call quality when the user end the call.
/// - Parameter review: The Review containing score, reason or duration related to the call
/// - Returns: A callQualitySurvey analytics event.

public static func callQualitySurvey(_ review: CallQualitySurveyReview) -> AnalyticsEvent {
.init(name: "calling.call_quality_review", segmentation: review.segmentation)
}

}
}
Loading
Loading