(invocationUUID uuid.UUID, event SyncStartedEvent, details *eventDetails)
| 122 | } |
| 123 | |
| 124 | func getSyncCommonProps(invocationUUID uuid.UUID, event SyncStartedEvent, details *eventDetails) rudderstack.Properties { |
| 125 | destinationPaths := make([]string, len(event.Destinations)) |
| 126 | for i, d := range event.Destinations { |
| 127 | destinationPaths[i] = d.Path |
| 128 | } |
| 129 | |
| 130 | userID, userEmail := getUserIDEmail(details.user, details.currentTeam) |
| 131 | |
| 132 | props := rudderstack.NewProperties(). |
| 133 | // we are using the same invocation_uuid for sync_run_id |
| 134 | // invocation_uuid to be consistent with the rest of the events |
| 135 | // sync_run_id to match with cloud events |
| 136 | Set("invocation_uuid", invocationUUID). |
| 137 | Set("sync_run_id", invocationUUID). |
| 138 | Set("team", details.currentTeam). |
| 139 | Set("$groups", rudderstack.NewProperties(). |
| 140 | Set("team", details.currentTeam)). |
| 141 | Set("environment", details.environment). |
| 142 | Set("sync_name", event.Source.Name). |
| 143 | Set("source_path", event.Source.Path). |
| 144 | Set("destination_paths", destinationPaths). |
| 145 | Set("user_id", userID). |
| 146 | Set("user_email", userEmail) |
| 147 | |
| 148 | if event.ShardNum > 0 && event.ShardTotal > 0 { |
| 149 | props = props.Set("shard_num", event.ShardNum). |
| 150 | Set("shard_total", event.ShardTotal) |
| 151 | } |
| 152 | |
| 153 | return props |
| 154 | } |
| 155 | |
| 156 | func TrackSyncStarted(ctx context.Context, invocationUUID uuid.UUID, event SyncStartedEvent) { |
| 157 | if client == nil { |
no test coverage detected