Skip to content
Closed
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
29 changes: 23 additions & 6 deletions services/apps/data_sink_worker/src/service/activity.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,17 @@
username,
objectMemberId,
objectMemberUsername,
attributes: activity.attributes || {},
attributes:
platform === PlatformType.GITHUB &&
activity.type === GithubActivityType.AUTHORED_COMMIT
? await this.findMatchingGitActivityAttributes({
tenantId,
segmentId,
activity,
platform,
attributes: activity.attributes || {},
})
: activity.attributes || {},
body: activity.body,
title: activity.title,
channel: activity.channel,
Expand Down Expand Up @@ -1115,6 +1125,7 @@
tenantId,
segmentId,
activity,
platform,
attributes: activity.attributes || {},
})
: activity.attributes || {},
Expand All @@ -1132,12 +1143,12 @@
}

if (platform === PlatformType.GIT && activity.type === GitActivityType.AUTHORED_COMMIT) {
await this.pushAttributesToMatchingGithubActivity({ tenantId, segmentId, activity })
await this.pushAttributesToMatchingGithubActivity({ tenantId, segmentId, platform, activity })

Check failure on line 1146 in services/apps/data_sink_worker/src/service/activity.service.ts

View workflow job for this annotation

GitHub Actions / lint-format-services

Replace `·tenantId,·segmentId,·platform,·activity` with `⏎············tenantId,⏎············segmentId,⏎············platform,⏎············activity,⏎·········`
} else if (
platform === PlatformType.GITHUB &&
activity.type === GithubActivityType.PULL_REQUEST_OPENED
) {
await this.pushPRSourceIdToMatchingGithubCommits({ tenantId, activity })
await this.pushPRSourceIdToMatchingGithubCommits({ tenantId, platform, activity })
}
} finally {
// release locks matter what
Expand Down Expand Up @@ -1261,15 +1272,17 @@
tenantId,
segmentId,
activity,
platform,
attributes,
}: {
tenantId: string
segmentId: string
activity: IActivityData
platform: PlatformType
attributes: Record<string, unknown>
}): Promise<Record<string, unknown>> {
if (

Check failure on line 1284 in services/apps/data_sink_worker/src/service/activity.service.ts

View workflow job for this annotation

GitHub Actions / lint-format-services

Replace `⏎······platform·!==·PlatformType.GITHUB·||⏎······activity.type·!==·GithubActivityType.AUTHORED_COMMIT⏎····` with `platform·!==·PlatformType.GITHUB·||·activity.type·!==·GithubActivityType.AUTHORED_COMMIT`
activity.platform !== PlatformType.GITHUB ||
platform !== PlatformType.GITHUB ||
activity.type !== GithubActivityType.AUTHORED_COMMIT
) {
this.log.error(
Expand Down Expand Up @@ -1298,14 +1311,16 @@
private async pushAttributesToMatchingGithubActivity({
tenantId,
segmentId,
platform,
activity,
}: {
tenantId: string
segmentId: string
platform: string
activity: IActivityData
}) {
if (

Check failure on line 1322 in services/apps/data_sink_worker/src/service/activity.service.ts

View workflow job for this annotation

GitHub Actions / lint-format-services

Replace `⏎······platform·!==·PlatformType.GIT·||⏎······activity.type·!==·GitActivityType.AUTHORED_COMMIT⏎····` with `platform·!==·PlatformType.GIT·||·activity.type·!==·GitActivityType.AUTHORED_COMMIT`
activity.platform !== PlatformType.GIT ||
platform !== PlatformType.GIT ||
activity.type !== GitActivityType.AUTHORED_COMMIT
) {
this.log.error(
Expand Down Expand Up @@ -1355,13 +1370,15 @@

private async pushPRSourceIdToMatchingGithubCommits({
tenantId,
platform,
activity,
}: {
tenantId: string
platform: string
activity: IActivityData
}) {
if (
activity.platform !== PlatformType.GITHUB ||
platform !== PlatformType.GITHUB ||
activity.type !== GithubActivityType.PULL_REQUEST_OPENED
) {
return
Expand Down
Loading