Skip to content

Commit

Permalink
add tick tooltip info for skipped ticks due to run key idempotence (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
prha committed Mar 22, 2022
1 parent b17183e commit 291fbf5
Show file tree
Hide file tree
Showing 17 changed files with 50 additions and 8 deletions.
1 change: 1 addition & 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.

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.

37 changes: 29 additions & 8 deletions js_modules/dagit/packages/core/src/instigation/InstigationTick.tsx
Expand Up @@ -39,7 +39,7 @@ export const TickTag: React.FC<{
if (!tick.runIds.length) {
return <TagWIP intent="primary">Requested</TagWIP>;
}
return (
const tag = (
<>
<TagWIP intent="primary" interactive>
<ButtonLink underline="never" onClick={() => setOpen(true)}>
Expand All @@ -61,15 +61,35 @@ export const TickTag: React.FC<{
</DialogWIP>
</>
);
if (tick.runKeys.length > tick.runIds.length) {
const message = `${tick.runKeys.length} runs requested, but ${
tick.runKeys.length - tick.runIds.length
} skipped because the runs already exist for those requested keys.`;
return (
<Tooltip position="right" content={message}>
{tag}
</Tooltip>
);
}
return tag;

case InstigationTickStatus.SKIPPED:
if (!tick.skipReason) {
return <TagWIP intent="warning">Skipped</TagWIP>;
if (tick.runKeys) {
const message = `${tick.runKeys.length} runs requested, but skipped because the runs already exist for the requested keys.`;
return (
<Tooltip position="right" content={message}>
<TagWIP intent="warning">Skipped</TagWIP>
</Tooltip>
);
}
return (
<Tooltip position="right" content={tick.skipReason} targetTagName="div">
<TagWIP intent="warning">Skipped</TagWIP>
</Tooltip>
);
if (tick.skipReason) {
return (
<Tooltip position="right" content={tick.skipReason} targetTagName="div">
<TagWIP intent="warning">Skipped</TagWIP>
</Tooltip>
);
}
return <TagWIP intent="warning">Skipped</TagWIP>;
case InstigationTickStatus.FAILURE:
if (!tick.error) {
return <TagWIP intent="danger">Failure</TagWIP>;
Expand Down Expand Up @@ -186,6 +206,7 @@ export const TICK_TAG_FRAGMENT = gql`
timestamp
skipReason
runIds
runKeys
error {
...PythonErrorFragment
}
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.

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.

Expand Up @@ -99,6 +99,7 @@ class GrapheneInstigationTick(graphene.ObjectType):
status = graphene.NonNull(GrapheneInstigationTickStatus)
timestamp = graphene.NonNull(graphene.Float)
runIds = non_null_list(graphene.String)
runKeys = non_null_list(graphene.String)
error = graphene.Field(GraphenePythonError)
skipReason = graphene.String()
cursor = graphene.String()
Expand All @@ -115,6 +116,7 @@ def __init__(self, _, tick):
status=tick.status,
timestamp=tick.timestamp,
runIds=tick.run_ids,
runKeys=tick.run_keys,
error=tick.error,
skipReason=tick.skip_reason,
originRunIds=tick.origin_run_ids,
Expand Down

0 comments on commit 291fbf5

Please sign in to comment.