Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
beaff61
feat: add bluesky, tiktok and instagram platform types
themarolt Oct 15, 2026
3eb7668
feat: register the mention activity type for every octolens platform
themarolt Oct 15, 2026
38da187
feat: keep a record's own channel when emitting connector activities
themarolt Oct 15, 2026
197ee11
feat: map every person-handle octolens source with a per-mention channel
themarolt Oct 15, 2026
cc15380
fix: map youtube mentions without an author handle and skip more gith…
themarolt Oct 15, 2026
5eb3e4a
refactor: trim comments and extract the record channel helper
themarolt Oct 15, 2026
9f286b8
Merge remote-tracking branch 'origin/main' into feat/issue-748-octole…
themarolt Oct 16, 2026
588050f
fix: tighten octolens channel parsing for reddit and github site paths
themarolt Oct 16, 2026
cc6927c
feat: route octolens activities by their keyword's project, not by re…
themarolt Oct 16, 2026
7346408
feat: map octolens mentions per the ingestion spec
themarolt Oct 16, 2026
fef8323
fix: route octolens mentions by their keywords list and start from now
themarolt Oct 16, 2026
cea7a0e
fix: harden octolens author identities and the first run's watermark
themarolt Oct 16, 2026
ce462bc
Merge remote-tracking branch 'origin/main' into feat/issue-748-octole…
themarolt Oct 16, 2026
1d7f1d5
fix: save the octolens first-run cutoff up front and validate backfil…
themarolt Oct 16, 2026
51a9757
fix: route backfilled octolens mentions like polled ones
themarolt Oct 16, 2026
4f353d2
fix: reject malformed github logins and x app routes as octolens iden…
themarolt Oct 16, 2026
46a5b3f
feat: emit octolens mentions from reddit, dev.to, hn, bluesky, tiktok…
themarolt Oct 16, 2026
cc92a97
Merge remote-tracking branch 'origin/main' into feat/issue-748-octole…
themarolt Oct 16, 2026
6feba8e
fix: reject encoded path separators in octolens linkedin handles
themarolt Oct 16, 2026
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
-- The table has no unique key, so skip rows that already exist (e.g. mention/twitter).
INSERT INTO "activityTypes" ("activityType", platform, "isCodeContribution", "isCollaboration", description, "label")
SELECT v."activityType", v.platform, false, false, v.description, v."label"
FROM (VALUES
('mention', 'github', 'Mentioned the project on GitHub', 'Mentioned the project'),
('mention', 'twitter', 'Mentioned the project on X/Twitter', 'Mentioned the project'),
('mention', 'linkedin', 'Mentioned the project on LinkedIn', 'Mentioned the project'),
('mention', 'reddit', 'Mentioned the project on Reddit', 'Mentioned the project'),
('mention', 'devto', 'Mentioned the project on DEV', 'Mentioned the project'),
('mention', 'hackernews', 'Mentioned the project on Hacker News', 'Mentioned the project'),
('mention', 'stackoverflow', 'Mentioned the project on Stack Overflow', 'Mentioned the project'),
('mention', 'medium', 'Mentioned the project on Medium', 'Mentioned the project'),
('mention', 'producthunt', 'Mentioned the project on Product Hunt', 'Mentioned the project'),
('mention', 'facebook', 'Mentioned the project on Facebook', 'Mentioned the project'),
('mention', 'youtube', 'Mentioned the project on YouTube', 'Mentioned the project'),
('mention', 'bluesky', 'Mentioned the project on Bluesky', 'Mentioned the project'),
('mention', 'tiktok', 'Mentioned the project on TikTok', 'Mentioned the project'),
('mention', 'instagram', 'Mentioned the project on Instagram', 'Mentioned the project')
) AS v("activityType", platform, description, "label")
WHERE NOT EXISTS (
SELECT 1
FROM "activityTypes" a
WHERE a."activityType" = v."activityType"
AND a.platform = v.platform
);
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,10 @@ export default class ActivityService extends LoggerBase {
continue
}

if (payload.platform === PlatformType.GITLAB || payload.platform === PlatformType.GITHUB) {
if (
!payload.skipRepositorySegmentLookup &&
(payload.platform === PlatformType.GITLAB || payload.platform === PlatformType.GITHUB)
) {
repoPayloads.push(payload)
} else if (!payload.segmentId) {
resultMap.set(payload.resultId, {
Expand Down Expand Up @@ -2144,6 +2147,7 @@ interface IActivityProcessData {
platform: PlatformType
activity: IActivityData
segmentId: string
skipRepositorySegmentLookup?: boolean

dbMember?: IDbMember
dbObjectMember?: IDbMember
Expand Down
10 changes: 9 additions & 1 deletion services/apps/data_sink_worker/src/service/dataSink.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ import {
import { WORKER_SETTINGS } from '../conf'
import ActivityService from './activity.service'
import MemberService from './member.service'
import { resolveActivityResultPlatform } from './resolveActivityResultPlatform'
import {
resolveActivityResultPlatform,
skipsRepositorySegmentLookup,
} from './resolveActivityResultPlatform'

/* eslint-disable @typescript-eslint/no-explicit-any */

Expand Down Expand Up @@ -351,7 +354,11 @@ export default class DataSinkService extends LoggerBase {
if (type === IntegrationResultType.ACTIVITY) {
const results = groupedByType.get(type)

const keepsResultSegment = new Set<string>()
for (const result of results) {
if (skipsRepositorySegmentLookup(result.platform)) {
keepsResultSegment.add(result.id)
}
result.platform = resolveActivityResultPlatform(
result.platform,
(result.data.data as IActivityData | undefined)?.platform as PlatformType | undefined,
Expand Down Expand Up @@ -393,6 +400,7 @@ export default class DataSinkService extends LoggerBase {
platform: r.platform,
activity: r.data.data as IActivityData,
segmentId: r.data.segmentId ?? r.segmentId,
skipRepositorySegmentLookup: keepsResultSegment.has(r.id),
}
}),
toProcess.some((r) => r.onboarding === true),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import { describe, expect, it } from 'vitest'

import { PlatformType } from '@crowd/types'

import { resolveActivityResultPlatform } from './resolveActivityResultPlatform'
import {
resolveActivityResultPlatform,
skipsRepositorySegmentLookup,
} from './resolveActivityResultPlatform'

describe('resolveActivityResultPlatform', () => {
it('prefers the activity platform over the integration platform when both are set', () => {
Expand All @@ -29,3 +32,16 @@ describe('resolveActivityResultPlatform', () => {
expect(resolveActivityResultPlatform(null, undefined)).toBeNull()
})
})

describe('skipsRepositorySegmentLookup', () => {
it('skips the repositories lookup for activities from an Octolens integration', () => {
expect(skipsRepositorySegmentLookup(PlatformType.OCTOLENS)).toBe(true)
})

it.each([PlatformType.GITHUB, PlatformType.GITHUB_NANGO, PlatformType.GITLAB, null])(
'keeps the lookup for %s integrations',
(platform) => {
expect(skipsRepositorySegmentLookup(platform)).toBe(false)
},
)
})
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,8 @@ export function resolveActivityResultPlatform(
const platform = activityPlatform ?? integrationPlatform
return platform === PlatformType.GITHUB_NANGO ? PlatformType.GITHUB : platform
}

// Octolens routes each mention to its keyword's project, never through public.repositories.
export function skipsRepositorySegmentLookup(integrationPlatform: PlatformType | null): boolean {
return integrationPlatform === PlatformType.OCTOLENS
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ import {
IOrganizationEnrichmentDataInternalAPIResponse,
} from './types'

// Never stored before these PlatformType values existed; storing them needs its own decision.
const IGNORED_IDENTITY_PLATFORMS = new Set<PlatformType>([
PlatformType.BLUESKY,
PlatformType.TIKTOK,
PlatformType.INSTAGRAM,
])

export default class EnrichmentServiceLFXInternalAPI
extends LoggerBase
implements IOrganizationEnrichmentService
Expand Down Expand Up @@ -126,6 +133,10 @@ export default class EnrichmentServiceLFXInternalAPI
this.log.warn({ key }, 'Unknown platform in identities, skipping')
return []
}
if (IGNORED_IDENTITY_PLATFORMS.has(platform)) {
this.log.warn({ key }, 'Ignored platform in identities, skipping')
return []
}

return (Array.isArray(values) ? values : [values])
.filter((v) => v && typeof v === 'string')
Expand Down
Loading
Loading