Skip to content

Commit

Permalink
feat: add alert failure event (#7238)
Browse files Browse the repository at this point in the history
  • Loading branch information
rexledesma committed Mar 30, 2022
1 parent 847889d commit 7024d7c
Show file tree
Hide file tree
Showing 14 changed files with 38 additions and 9 deletions.

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions js_modules/dagit/packages/core/src/graphql/schema.graphql

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@ export const LogsRowStructuredContent: React.FC<IStructuredContentProps> = ({nod
case 'AlertStartEvent':
return <DefaultContent eventType={eventType} message={node.message} />;
case 'AlertSuccessEvent':
return <DefaultContent eventType={eventType} message={node.message} />;
return <DefaultContent eventType={eventType} message={node.message} eventIntent="success" />;
case 'AlertFailureEvent':
return <DefaultContent eventType={eventType} message={node.message} eventIntent="warning" />;
case 'RunFailureEvent':
if (node.pipelineFailureError) {
return (
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions js_modules/dagit/packages/core/src/types/globalTypes.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ def _to_metadata_entries(metadata_entries):
def from_dagster_event_record(event_record, pipeline_name):
from ..schema.errors import GraphenePythonError
from ..schema.logs.events import (
GrapheneAlertFailureEvent,
GrapheneAlertStartEvent,
GrapheneAlertSuccessEvent,
GrapheneEngineEvent,
Expand Down Expand Up @@ -292,6 +293,8 @@ def from_dagster_event_record(event_record, pipeline_name):
return GrapheneAlertStartEvent(pipelineName=pipeline_name, **basic_params)
elif dagster_event.event_type == DagsterEventType.ALERT_SUCCESS:
return GrapheneAlertSuccessEvent(pipelineName=pipeline_name, **basic_params)
elif dagster_event.event_type == DagsterEventType.ALERT_FAILURE:
return GrapheneAlertFailureEvent(pipelineName=pipeline_name, **basic_params)
elif dagster_event.event_type == DagsterEventType.HANDLED_OUTPUT:
return GrapheneHandledOutputEvent(
output_name=dagster_event.event_specific_data.output_name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ class Meta:
name = "AlertSuccessEvent"


class GrapheneAlertFailureEvent(graphene.ObjectType):
class Meta:
interfaces = (GrapheneMessageEvent, GrapheneRunEvent)
name = "AlertFailureEvent"


class GrapheneStepEvent(graphene.Interface):
stepKey = graphene.Field(graphene.String)
solidHandleID = graphene.Field(graphene.String)
Expand Down Expand Up @@ -457,6 +463,7 @@ class Meta:
GrapheneHookErroredEvent,
GrapheneAlertStartEvent,
GrapheneAlertSuccessEvent,
GrapheneAlertFailureEvent,
)
name = "DagsterRunEvent"

Expand Down
3 changes: 3 additions & 0 deletions python_modules/dagster/dagster/core/events/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ class DagsterEventType(Enum):

ALERT_START = "ALERT_START"
ALERT_SUCCESS = "ALERT_SUCCESS"
ALERT_FAILURE = "ALERT_FAILURE"

LOGS_CAPTURED = "LOGS_CAPTURED"


Expand Down Expand Up @@ -172,6 +174,7 @@ class DagsterEventType(Enum):
ALERT_EVENTS = {
DagsterEventType.ALERT_START,
DagsterEventType.ALERT_SUCCESS,
DagsterEventType.ALERT_FAILURE,
}


Expand Down

0 comments on commit 7024d7c

Please sign in to comment.