From e49f4007658f108b2a4ffb95e33fa4e333de58e0 Mon Sep 17 00:00:00 2001 From: Mia Hsu Date: Tue, 11 Nov 2025 15:28:15 -0800 Subject: [PATCH 1/4] feat(aci): add issue stream detectors to connect monitors drawer --- .../workflowEngine/gridCell/titleCell.tsx | 24 ++++++++++++++----- static/app/types/workflowEngine/detectors.tsx | 12 +++++++++- .../components/connectedMonitorsList.tsx | 8 ++++++- .../detectors/components/detectorLink.tsx | 15 ++++++++++-- .../detectors/utils/detectorTypeConfig.tsx | 1 + 5 files changed, 50 insertions(+), 10 deletions(-) diff --git a/static/app/components/workflowEngine/gridCell/titleCell.tsx b/static/app/components/workflowEngine/gridCell/titleCell.tsx index d5de8ae863a7b1..5d8a0e693d1fbe 100644 --- a/static/app/components/workflowEngine/gridCell/titleCell.tsx +++ b/static/app/components/workflowEngine/gridCell/titleCell.tsx @@ -11,7 +11,7 @@ import type {StatusWarning} from 'sentry/types/workflowEngine/automations'; import {defined} from 'sentry/utils'; export type TitleCellProps = { - link: string; + link: string | null; name: string; className?: string; details?: React.ReactNode; @@ -57,6 +57,14 @@ export function TitleCell({ ); + if (!link) { + return ( + + {content} + + ); + } + if (openInNewTab) { return ( ` display: flex; flex-direction: column; gap: ${space(0.5)}; @@ -106,11 +114,15 @@ const TitleBase = styled('div')` overflow: hidden; min-height: 20px; - &:hover { - ${NameText} { - text-decoration: underline; + ${p => + !p.noHover && + ` + &:hover { + ${NameText} { + text-decoration: underline; + } } - } + `} `; const TitleWrapper = TitleBase.withComponent(Link); diff --git a/static/app/types/workflowEngine/detectors.tsx b/static/app/types/workflowEngine/detectors.tsx index 7b21b748b94efc..f956dd9d05a03a 100644 --- a/static/app/types/workflowEngine/detectors.tsx +++ b/static/app/types/workflowEngine/detectors.tsx @@ -154,7 +154,17 @@ export interface ErrorDetector extends BaseDetector { readonly type: 'error'; } -export type Detector = MetricDetector | UptimeDetector | CronDetector | ErrorDetector; +interface IssueStreamDetector extends BaseDetector { + // TODO: Add error detector type fields + readonly type: 'issue_stream'; +} + +export type Detector = + | MetricDetector + | UptimeDetector + | CronDetector + | ErrorDetector + | IssueStreamDetector; interface UpdateConditionGroupPayload { conditions: Array>; diff --git a/static/app/views/automations/components/connectedMonitorsList.tsx b/static/app/views/automations/components/connectedMonitorsList.tsx index ca8304783b12de..e476d221f6310a 100644 --- a/static/app/views/automations/components/connectedMonitorsList.tsx +++ b/static/app/views/automations/components/connectedMonitorsList.tsx @@ -86,7 +86,13 @@ export default function ConnectedMonitorsList({ isSuccess, getResponseHeader, } = useDetectorsQuery( - {ids: detectorIds ?? undefined, limit: limit ?? undefined, cursor, query}, + { + ids: detectorIds ?? undefined, + limit: limit ?? undefined, + cursor, + query, + includeIssueStreamDetectors: true, + }, {enabled: detectorIds === null || detectorIds.length > 0} ); diff --git a/static/app/views/detectors/components/detectorLink.tsx b/static/app/views/detectors/components/detectorLink.tsx index d240577c26ae8c..6a2e9e4f38d4ae 100644 --- a/static/app/views/detectors/components/detectorLink.tsx +++ b/static/app/views/detectors/components/detectorLink.tsx @@ -197,6 +197,7 @@ function Details({detector}: {detector: Detector}) { case 'monitor_check_in_failure': return ; case 'error': + case 'issue_stream': return null; default: unreachable(detectorType); @@ -208,11 +209,21 @@ export function DetectorLink({detector, className, openInNewTab}: DetectorLinkPr const org = useOrganization(); const project = useProjectFromId({project_id: detector.projectId}); + const detectorName = + detector.type === 'issue_stream' + ? t('All Issues in %s', project?.name || 'project') + : detector.name; + + const detectorLink = + detector.type === 'issue_stream' + ? null + : makeMonitorDetailsPathname(org.slug, detector.id); + return ( = { issue_stream: { userCreateable: false, label: t('Issue Stream'), + systemCreatedNotice: () => t('This monitor is managed by Sentry'), }, }; From 614faad1f5412cc1485122dcf6b1cc0898ed25a3 Mon Sep 17 00:00:00 2001 From: Mia Hsu Date: Tue, 11 Nov 2025 15:57:41 -0800 Subject: [PATCH 2/4] fix typing --- .../app/views/detectors/components/details/index.tsx | 10 ++++++++++ static/app/views/detectors/components/forms/index.tsx | 7 +++++++ .../views/detectors/utils/getDetectorEnvironment.tsx | 1 + 3 files changed, 18 insertions(+) diff --git a/static/app/views/detectors/components/details/index.tsx b/static/app/views/detectors/components/details/index.tsx index dd5ffb9654b43b..69e3dd321989e6 100644 --- a/static/app/views/detectors/components/details/index.tsx +++ b/static/app/views/detectors/components/details/index.tsx @@ -1,4 +1,6 @@ +import {Alert} from 'sentry/components/core/alert'; import PageFiltersContainer from 'sentry/components/organizations/pageFilters/container'; +import {t} from 'sentry/locale'; import type {Project} from 'sentry/types/project'; import type {Detector} from 'sentry/types/workflowEngine/detectors'; import {unreachable} from 'sentry/utils/unreachable'; @@ -37,6 +39,14 @@ export function DetectorDetailsContent({detector, project}: DetectorDetailsConte ); + case 'issue_stream': + return ( + + + {t('Issue stream monitors do not support detail views.')} + + + ); default: unreachable(detectorType); return ( diff --git a/static/app/views/detectors/components/forms/index.tsx b/static/app/views/detectors/components/forms/index.tsx index 4681c265d389fd..ac3bf2e0a274a1 100644 --- a/static/app/views/detectors/components/forms/index.tsx +++ b/static/app/views/detectors/components/forms/index.tsx @@ -1,3 +1,4 @@ +import {Alert} from 'sentry/components/core/alert'; import * as Layout from 'sentry/components/layouts/thirds'; import LoadingError from 'sentry/components/loadingError'; import {t} from 'sentry/locale'; @@ -61,6 +62,12 @@ export function EditExistingDetectorForm({detector}: {detector: Detector}) { return ; case 'monitor_check_in_failure': return ; + case 'issue_stream': + return ( + + {t('Issue stream monitors can not be edited.')} + + ); default: unreachable(detectorType); return ; diff --git a/static/app/views/detectors/utils/getDetectorEnvironment.tsx b/static/app/views/detectors/utils/getDetectorEnvironment.tsx index 84ac62ae3a3b3f..d455c64412232c 100644 --- a/static/app/views/detectors/utils/getDetectorEnvironment.tsx +++ b/static/app/views/detectors/utils/getDetectorEnvironment.tsx @@ -15,6 +15,7 @@ export function getDetectorEnvironment(detector: Detector): string | null { // Crons can have multiple environments return null; case 'error': + case 'issue_stream': return null; default: unreachable(detectorType); From 85796f88bee049baff1f264489d57aec77a35a58 Mon Sep 17 00:00:00 2001 From: Mia Hsu Date: Tue, 11 Nov 2025 16:18:13 -0800 Subject: [PATCH 3/4] fix setQueryData --- .../app/views/automations/components/connectedMonitorsList.tsx | 1 + .../app/views/automations/components/editConnectedMonitors.tsx | 2 ++ 2 files changed, 3 insertions(+) diff --git a/static/app/views/automations/components/connectedMonitorsList.tsx b/static/app/views/automations/components/connectedMonitorsList.tsx index e476d221f6310a..488a62055f8a8a 100644 --- a/static/app/views/automations/components/connectedMonitorsList.tsx +++ b/static/app/views/automations/components/connectedMonitorsList.tsx @@ -149,6 +149,7 @@ export default function ConnectedMonitorsList({ {emptyMessage} )} {isSuccess && + (detectorIds === null || detectorIds.length > 0) && detectors.map(detector => ( diff --git a/static/app/views/automations/components/editConnectedMonitors.tsx b/static/app/views/automations/components/editConnectedMonitors.tsx index edd99424d95413..39443df4961423 100644 --- a/static/app/views/automations/components/editConnectedMonitors.tsx +++ b/static/app/views/automations/components/editConnectedMonitors.tsx @@ -110,6 +110,7 @@ function ConnectMonitorsDrawer({ makeDetectorListQueryKey({ orgSlug: organization.slug, ids: localDetectorIds, + includeIssueStreamDetectors: true, }) ) ?? []; @@ -126,6 +127,7 @@ function ConnectMonitorsDrawer({ makeDetectorListQueryKey({ orgSlug: organization.slug, ids: newDetectorIds, + includeIssueStreamDetectors: true, }), newDetectors ); From f2fb4f0029a4347932ffbef942a5aafa3d3de0fc Mon Sep 17 00:00:00 2001 From: Mia Hsu Date: Wed, 12 Nov 2025 16:14:56 -0800 Subject: [PATCH 4/4] fix comment --- static/app/types/workflowEngine/detectors.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/app/types/workflowEngine/detectors.tsx b/static/app/types/workflowEngine/detectors.tsx index f956dd9d05a03a..a422988a57c630 100644 --- a/static/app/types/workflowEngine/detectors.tsx +++ b/static/app/types/workflowEngine/detectors.tsx @@ -155,7 +155,7 @@ export interface ErrorDetector extends BaseDetector { } interface IssueStreamDetector extends BaseDetector { - // TODO: Add error detector type fields + // TODO: Add issue stream detector type fields readonly type: 'issue_stream'; }