Skip to content

Commit 7265430

Browse files
feat(inbox): surface health check issues as inbox signals (#2711)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent 0717517 commit 7265430

16 files changed

Lines changed: 244 additions & 303 deletions

File tree

apps/mobile/src/features/inbox/components/FilterSheet.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ const SOURCE_PRODUCT_OPTIONS: { value: SourceProduct; label: string }[] = [
7777
{ value: "zendesk", label: "Zendesk" },
7878
{ value: "conversations", label: "Conversations" },
7979
{ value: "signals_scout", label: "Scout" },
80+
{ value: "health_checks", label: "Health checks" },
8081
];
8182

8283
function SectionHeader({ title }: { title: string }) {

apps/mobile/src/features/inbox/components/SignalCard.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
CheckCircle,
99
Code,
1010
Compass,
11+
FirstAid,
1112
GithubLogo,
1213
LinkSimple,
1314
Question,
@@ -53,6 +54,8 @@ function sourceLine(signal: Signal): string {
5354
)
5455
return "Scout · Cross-source issue";
5556
if (source_product === "signals_scout") return "Scout";
57+
if (source_product === "health_checks" && source_type === "health_issue")
58+
return "Health checks · Issue";
5659
const product = source_product.replace(/_/g, " ");
5760
const type = source_type.replace(/_/g, " ");
5861
return `${product} · ${type}`;
@@ -82,6 +85,8 @@ function SourceIcon({
8285
return <LinkSimple size={size} color={color} />;
8386
case "signals_scout":
8487
return <Compass size={size} color={color} />;
88+
case "health_checks":
89+
return <FirstAid size={size} color={color} />;
8590
default:
8691
return <WarningCircle size={size} color={color} />;
8792
}

apps/mobile/src/features/inbox/stores/inboxFilterStore.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,15 @@ type SortField = Extract<
1515
type SortDirection = "asc" | "desc";
1616

1717
export type SourceProduct =
18-
| "session_replay"
18+
| "conversations"
1919
| "error_tracking"
20-
| "llm_analytics"
2120
| "github"
21+
| "health_checks"
2222
| "linear"
23-
| "zendesk"
24-
| "conversations"
25-
| "signals_scout";
23+
| "llm_analytics"
24+
| "session_replay"
25+
| "signals_scout"
26+
| "zendesk";
2627

2728
export const DEFAULT_STATUS_FILTER: SignalReportStatus[] = [
2829
"ready",

packages/api-client/src/posthog-client.ts

Lines changed: 4 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import type {
77
CloudRunSource,
88
ExecutionMode,
99
PrAuthorshipMode,
10+
SourceProduct,
11+
SourceType,
1012
StoredLogEntry,
1113
TaskRunArtifactMetadata,
1214
} from "@posthog/shared";
@@ -244,59 +246,8 @@ export interface LlmSkillFileInput {
244246

245247
export interface SignalSourceConfig {
246248
id: string;
247-
source_product:
248-
| "session_replay"
249-
| "llm_analytics"
250-
| "github"
251-
| "linear"
252-
| "jira"
253-
| "zendesk"
254-
| "conversations"
255-
| "error_tracking"
256-
| "pganalyze"
257-
| "signals_scout"
258-
| "freshdesk"
259-
| "freshservice"
260-
| "front"
261-
| "gorgias"
262-
| "kustomer"
263-
| "dixa"
264-
| "plain"
265-
| "gitlab"
266-
| "gitea"
267-
| "shortcut"
268-
| "sentry"
269-
| "rollbar"
270-
| "bugsnag"
271-
| "honeybadger"
272-
| "raygun"
273-
| "snyk"
274-
| "sonarqube"
275-
| "semgrep"
276-
| "rapid7_insightvm"
277-
| "featurebase"
278-
| "frill"
279-
| "aha"
280-
| "uservoice"
281-
| "productboard"
282-
| "canny"
283-
| "asknicely"
284-
| "retently"
285-
| "appfigures"
286-
| "appfollow"
287-
| "judgeme_reviews";
288-
source_type:
289-
| "session_analysis_cluster"
290-
| "evaluation"
291-
| "issue"
292-
| "ticket"
293-
| "issue_created"
294-
| "issue_reopened"
295-
| "issue_spiking"
296-
| "cross_source_issue"
297-
| "scanner_finding"
298-
| "feedback"
299-
| "review";
249+
source_product: SourceProduct;
250+
source_type: SourceType;
300251
enabled: boolean;
301252
config: Record<string, unknown>;
302253
created_at: string;

packages/core/src/inbox/signalSourceService.test.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ describe("computeSourceValues", () => {
6060
const values = computeSourceValues([config("github", "issue", true)]);
6161
expect(values.github).toBe(true);
6262
});
63+
64+
it("enables health_checks when its config is enabled", () => {
65+
const values = computeSourceValues([
66+
config("health_checks", "health_issue", true),
67+
]);
68+
expect(values.health_checks).toBe(true);
69+
});
6370
});
6471

6572
describe("deriveSourceStates", () => {
@@ -106,6 +113,17 @@ describe("SignalSourceService.toggleSource", () => {
106113
expect(client.createSignalSourceConfig).toHaveBeenCalledTimes(1);
107114
});
108115

116+
it("creates a health_checks config with the health_issue source type", async () => {
117+
const client = fakeClient();
118+
const service = new SignalSourceService();
119+
await service.toggleSource(client, 1, "health_checks", true, [], []);
120+
expect(client.createSignalSourceConfig).toHaveBeenCalledWith(1, {
121+
source_product: "health_checks",
122+
source_type: "health_issue",
123+
enabled: true,
124+
});
125+
});
126+
109127
it("ensures the issues table syncs with full_refresh for github before enabling", async () => {
110128
const client = fakeClient();
111129
const service = new SignalSourceService();

packages/core/src/inbox/signalSourceService.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ type SourceType = SignalSourceConfig["source_type"];
3434
// Non-warehouse toggles are hard-wired; warehouse sources are derived from the shared
3535
// EXTERNAL_INBOX_SOURCES registry (kept in sync with the UI hook).
3636
const SOURCE_TYPE_MAP: Partial<Record<SignalSourceProduct, SourceType>> = {
37-
session_replay: "session_analysis_cluster",
3837
conversations: "ticket",
38+
health_checks: "health_issue",
39+
session_replay: "session_analysis_cluster",
3940
...Object.fromEntries(
4041
EXTERNAL_INBOX_SOURCES.map((s) => [s.product, s.recordKind]),
4142
),
@@ -62,10 +63,11 @@ const DATA_WAREHOUSE_SOURCES: Record<
6263
);
6364

6465
const ALL_SOURCE_PRODUCTS: SignalSourceProduct[] = [
65-
"session_replay",
66-
"error_tracking",
6766
"conversations",
68-
...EXTERNAL_INBOX_SOURCES.map((s) => s.product as SignalSourceProduct),
67+
"error_tracking",
68+
"health_checks",
69+
"session_replay",
70+
...EXTERNAL_INBOX_SOURCES.map((s) => s.product),
6971
];
7072

7173
function isWarehouseSource(product: SignalSourceProduct): boolean {

packages/shared/src/analytics-events.ts

Lines changed: 2 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Analytics event types and properties
22

33
import type { Adapter } from "./adapter";
4+
import type { SourceProduct } from "./inbox-types";
45

56
export interface PromptHistoryOpenedProperties {
67
entry_count: number;
@@ -793,47 +794,7 @@ export interface ScoutActionProperties {
793794
}
794795

795796
export interface SignalSourceConnectedProperties {
796-
source_product:
797-
| "session_replay"
798-
| "error_tracking"
799-
| "signals_scout"
800-
| "github"
801-
| "linear"
802-
| "jira"
803-
| "zendesk"
804-
| "conversations"
805-
| "pganalyze"
806-
| "llm_analytics"
807-
| "freshdesk"
808-
| "freshservice"
809-
| "front"
810-
| "gorgias"
811-
| "kustomer"
812-
| "dixa"
813-
| "plain"
814-
| "gitlab"
815-
| "gitea"
816-
| "shortcut"
817-
| "sentry"
818-
| "rollbar"
819-
| "bugsnag"
820-
| "honeybadger"
821-
| "raygun"
822-
| "snyk"
823-
| "sonarqube"
824-
| "semgrep"
825-
| "rapid7_insightvm"
826-
| "featurebase"
827-
| "frill"
828-
| "aha"
829-
| "uservoice"
830-
| "productboard"
831-
| "canny"
832-
| "asknicely"
833-
| "retently"
834-
| "appfigures"
835-
| "appfollow"
836-
| "judgeme_reviews";
797+
source_product: SourceProduct;
837798
/** True when this is a brand-new createSignalSourceConfig, false for re-enable of an existing config. */
838799
is_first_connection: boolean;
839800
/** True when the connection went through the DataSourceSetup wizard (warehouse OAuth path). */

0 commit comments

Comments
 (0)