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

feat(ingestion) slack source v2 - now ingests all user and channels #12795

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
478 changes: 396 additions & 82 deletions metadata-ingestion/src/datahub/ingestion/source/slack/slack.py

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
namespace com.linkedin.dataplatform.slack

/**
* Information about a Slack channel.
* Namespace for the urn of this entity should be 'slack-channel'. See GenericEntityKey.pdl for details.
*/
record SlackChannel {

/**
* The unique ID of the Slack entity. I.e., memberID, or channelID.
*/
id: string

/**
* The display name of the Slack entity. I.e., if this is a member, it would be the member's name.
*/
displayName: string


/**
* The topic of this Slack channel, if set.
*/
topic: optional string
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
namespace com.linkedin.dataplatform.slack

/**
* Information about a Slack conversation.
*/
record SlackConversation {

/**
* The unique ID of the Slack conversation.
*/
id: string

/**
* The display name of the Slack conversation.
*/
displayName: string

/**
* If this is a channel.
*/
isChannel: boolean

/**
* If this is a channel.
*/
isGroup: boolean

/**
* If this is a private conversation.
*/
isPrivate: boolean

/**
* If this conversation is archived.
*/
isArchived: boolean

/**
* If this is a shared channel.
*/
isShared: boolean

/**
* If this is an externally shared channel.
*/
isExtShared: boolean

/**
* If this is a general channel.
*/
isGeneral: boolean

/**
* The team this conversation lives within.
*/
contextTeamID: optional string

/**
* The purpose of this Slack channel, if set.
*/
purpose: optional string

/**
* The topic of this Slack channel, if set.
*/
topic: optional string
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
namespace com.linkedin.dataplatform.slack

import com.linkedin.common.Urn

/**
* Information about a Slack user.
*/
@Aspect = {
"name": "slackUserInfo"
}
record SlackUserInfo {

/**
* The dataplatform instance that this Slack member belongs to.
*/
@Relationship = {
"name": "PartOfSlackWorkspace",
"entityTypes": ["dataPlatformInstance"]
}
slackInstance: Urn

/**
* The unique identifier for the Slack member.
*/
id: string

/**
* The username of the Slack member.
*/
name: string

/**
* The real name of the Slack member.
*/
realName: string

/**
* The display name of the Slack member.
*/
displayName: string

/**
* The email associated with the Slack member.
*/
email: optional string

/**
* The ID associated with the Slack team.
*/
teamId: string

/**
* Whether the member is deleted or not.
*/
isDeleted: boolean

/**
* Whether the member is an admin.
*/
isAdmin: boolean

/**
* Whether the member is an owner.
*/
isOwner: boolean

/**
* Whether the member is a primary owner.
*/
isPrimaryOwner: boolean

/**
* Whether the member is a bot.
*/
isBot: boolean

/**
* The timezone of the Slack member.
*/
timezone: optional string

/**
* The timezone offset of the Slack member.
*/
timezoneOffset: optional int

/**
* The title of the Slack member.
*/
title: optional string

/**
* The phone number of the Slack member.
*/
phone: optional string

/**
* The URL of the member's profile picture.
*/
profilePictureUrl: optional string

/**
* The status text of the Slack member.
*/
statusText: optional string

/**
* The status emoji of the Slack member.
*/
statusEmoji: optional string

/**
* The timestamp of when the member was last updated. (in seconds)
*/
lastUpdatedSeconds: optional long
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace com.linkedin.event.notification

/**
* A type of sink / platform to send a notification to.
*/
enum NotificationSinkType {
/**
* Slack target type.
*/
SLACK,

/**
* Email target type.
*/
EMAIL
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace com.linkedin.event.notification.settings

/**
* Email Notification settings for an actor.
*/
record EmailNotificationSettings {
/**
* Optional user or group email address
*/
email: string
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
namespace com.linkedin.event.notification.settings

import com.linkedin.common.Urn
import com.linkedin.event.notification.NotificationSinkType

/**
* Notification settings for an actor or subscription.
*/
record NotificationSettings {
/**
* Sink types that notifications are sent to.
*/
sinkTypes: array[NotificationSinkType]

/**
* Slack Notification Settings
*/
slackSettings: optional SlackNotificationSettings

/**
* Email Notification Settings
*/
emailSettings: optional EmailNotificationSettings
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace com.linkedin.event.notification.settings

/**
* Slack Notification settings for an actor.
*/
record SlackNotificationSettings {
/**
* Optional user handle
*/
userHandle: optional string

/**
* Optional list of channels to send notifications to
*/
channels: optional array[string]
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,11 @@ record CorpUserEditableInfo {
* Email address to contact the user
*/
email: optional string

/**
* Information sources that have been used to populate this CorpUserEditableInfo.
* These include platform resources, such as Slack members or Looker users.
* They can also refer to other semantic urns in the future.
*/
informationSources: optional array[Urn]
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ namespace com.linkedin.identity
import com.linkedin.common.CorpuserUrn
import com.linkedin.common.CustomProperties
import com.linkedin.common.EmailAddress
import com.linkedin.common.Urn

/**
* Linkedin corp user information
Expand Down Expand Up @@ -110,4 +111,5 @@ record CorpUserInfo includes CustomProperties {
"queryByDefault": false
}
system: optional boolean = false

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
namespace com.linkedin.identity

import com.linkedin.event.notification.settings.NotificationSettings

/**
* Settings that a user can customize through the datahub ui
*/
Expand All @@ -16,4 +18,9 @@ record CorpUserSettings {
* User preferences for the Views feature.
*/
views: optional CorpUserViewsSettings

/**
* Notification settings for a user
*/
notificationSettings: optional NotificationSettings
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
namespace com.linkedin.settings

record NotificationSetting {
/**
* Integrations between DataHub & other platforms.
*/
value: enum NotificationSettingValue {
/**
* Setting is enabled.
*/
ENABLED

/**
* Setting is disabled.
*/
DISABLED
}

/**
* Custom set of setting parameters.
*/
params: optional map[string, string]
}
1 change: 1 addition & 0 deletions metadata-models/src/main/resources/entity-registry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ entities:
- forms
- testResults
- subTypes
- slackUserInfo
- name: corpGroup
doc: CorpGroup represents an identity of a group of users in the enterprise.
keyAspect: corpGroupKey
Expand Down
Loading