Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(cdp): show source.id in the workflow and destination editors (#116136)

Meikel Ratz69711ca6b8a0
diff --git a/frontend/src/scenes/hog-functions/configuration/hogFunctionConfigurationLogic.tsx b/frontend/src/scenes/hog-functions/configuration/hogFunctionConfigurationLogic.tsx
index 3b2bb13f556f..35384f6b2fc3 100644
--- a/frontend/src/scenes/hog-functions/configuration/hogFunctionConfigurationLogic.tsx
+++ b/frontend/src/scenes/hog-functions/configuration/hogFunctionConfigurationLogic.tsx
@@ -719,7 +719,7 @@ export interface hogFunctionConfigurationLogicMeta {
surveyIdFromFilters: (configuration: HogFunctionConfigurationType) => string | null
type: (configuration: HogFunctionConfigurationType, hogFunction: HogFunctionType | null) => HogFunctionTypeType
hasGroupsAddon: (
- hasAvailableFeature: (feature: AvailableFeature, currentUsage?: number | undefined) => boolean
+ hasAvailableFeature: (feature: AvailableFeature, currentUsage?: number | undefined) => boolean // userLogic
) => boolean
useMapping: (
hogFunction: HogFunctionType | null,
@@ -752,7 +752,8 @@ export interface hogFunctionConfigurationLogicMeta {
currentProject: ProjectType | null,
groupTypes: Map<GroupTypeIndex, GroupType>,
contextId: HogFunctionConfigurationContextId,
- survey: Survey | null
+ survey: Survey | null,
+ hogFunction: HogFunctionType | null
) => CyclotronJobInvocationGlobals
sampleGlobalsWithInputs: (
sampleGlobals: CyclotronJobInvocationGlobals | null,
@@ -1402,13 +1403,14 @@ export const hogFunctionConfigurationLogic = kea<hogFunctionConfigurationLogicTy
},
],
exampleInvocationGlobals: [
- (s) => [s.configuration, s.currentProject, s.groupTypes, s.contextId, s.survey],
+ (s) => [s.configuration, s.currentProject, s.groupTypes, s.contextId, s.survey, s.hogFunction],
(
configuration: HogFunctionConfigurationType,
currentProject: null | import('~/types').ProjectType,
groupTypes: Map<import('~/types').GroupTypeIndex, import('~/types').GroupType>,
contextId: HogFunctionConfigurationContextId,
- survey: Survey | null
+ survey: Survey | null,
+ hogFunction: HogFunctionType | null
): CyclotronJobInvocationGlobals => {
// Log transformations are seeded with a sample record (no event), so the inline
// tester shows something useful to run against instead of an empty object.
@@ -1426,6 +1428,7 @@ export const hogFunctionConfigurationLogic = kea<hogFunctionConfigurationLogicTy
const eventId = uuid()
const personId = uuid()
const source = {
+ id: hogFunction?.id ?? '00000000-0000-0000-0000-000000000000',
name: configuration?.name ?? 'Unnamed',
url: currentUrl,
}
diff --git a/frontend/src/types.ts b/frontend/src/types.ts
index 34c33160e391..f0e83ae89423 100644
--- a/frontend/src/types.ts
+++ b/frontend/src/types.ts
@@ -7630,6 +7630,7 @@ export type CyclotronJobInvocationGlobals = {
url: string
}
source?: {
+ id?: string
name: string
url: string
}
diff --git a/products/workflows/frontend/Workflows/hogflows/steps/components/HogFlowFunctionConfiguration.tsx b/products/workflows/frontend/Workflows/hogflows/steps/components/HogFlowFunctionConfiguration.tsx
index 2fa33b51ec45..a03269288c0a 100644
--- a/products/workflows/frontend/Workflows/hogflows/steps/components/HogFlowFunctionConfiguration.tsx
+++ b/products/workflows/frontend/Workflows/hogflows/steps/components/HogFlowFunctionConfiguration.tsx
@@ -65,7 +65,8 @@ export function buildSampleGlobals(
url: 'https://example.com/project/1',
},
source: {
- name: 'Example step',
+ id: '00000000-0000-0000-0000-000000000000',
+ name: 'Example workflow',
url: 'https://example.com/project/1/workflows/1',
},
}