Skip to content

Commit

Permalink
Replace Auto-materialize references in the UI with Automation condition
Browse files Browse the repository at this point in the history
  • Loading branch information
OwenKephart committed Oct 22, 2024
1 parent c3e96ea commit d30af9a
Show file tree
Hide file tree
Showing 14 changed files with 30 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import asset_plot from '../icon-svgs/asset_plot.svg';
import assignment from '../icon-svgs/assignment.svg';
import assignment_turned_in from '../icon-svgs/assignment_turned_in.svg';
import attach_file from '../icon-svgs/attach_file.svg';
import auto_materialize_policy from '../icon-svgs/auto_materialize_policy.svg';
import automation_condition from '../icon-svgs/automation_condition.svg';
import auto_observe from '../icon-svgs/auto_observe.svg';
import automation from '../icon-svgs/automation.svg';
import backfill from '../icon-svgs/backfill.svg';
Expand Down Expand Up @@ -424,7 +424,7 @@ export const Icons = {
assignment,
assignment_turned_in,
attach_file,
auto_materialize_policy,
automation_condition,
auto_observe,
automation,
backfill,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ export const AssetNodeOverview = ({
<LargeCollapsibleSection header="Definition" icon="info">
{renderDefinitionSection()}
</LargeCollapsibleSection>
<LargeCollapsibleSection header="Automation details" icon="auto_materialize_policy">
<LargeCollapsibleSection header="Automation details" icon="automation_condition">
{renderAutomationDetailsSection()}
</LargeCollapsibleSection>
{cachedOrLiveAssetNode.isExecutable ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ export const AutomaterializeDaemonStatusTag = () => {
<Tooltip
content={
paused
? 'Auto-materializing is paused. New materializations will not be triggered by auto-materialization policies.'
? 'Automation condition evaluation is paused. New materializations will not be triggered by automation conditions.'
: ''
}
canShow={paused}
>
<Link to="/health" style={{outline: 'none'}}>
<Tag icon={paused ? 'toggle_off' : 'toggle_on'} intent={paused ? 'warning' : 'success'}>
{paused ? 'Auto-materialize off' : 'Auto-materialize on'}
{paused ? 'Automation conditions off' : 'Automation conditions on'}
</Tag>
</Link>
</Tooltip>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const AutomaterializeTagWithEvaluation = ({assetKeys, evaluationId}: Prop
content={
<div style={{width: '340px'}}>
<Box padding={{vertical: 8, horizontal: 12}} border="bottom" style={{fontWeight: 600}}>
Auto-materialized
Automation condition
</Box>
<Box
flex={{direction: 'column', gap: 12}}
Expand Down Expand Up @@ -65,7 +65,7 @@ export const AutomaterializeTagWithEvaluation = ({assetKeys, evaluationId}: Prop
}
interactionKind="hover"
>
<Tag icon="auto_materialize_policy">Auto-materialized</Tag>
<Tag icon="automation_condition">Automation condition</Tag>
</Popover>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export const MergedAutomationRoot = () => {
const automationTypeFilter = useStaticSetFilter({
name: 'Automation type',
allValues: ALL_AUTOMATION_VALUES,
icon: 'auto_materialize_policy',
icon: 'automation_condition',
getStringValue: (value) => value.label,
state: automationFilterState,
renderLabel: ({value}) => <span>{value.label}</span>,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {Box, Checkbox, Group, Spinner, Table, Tag} from '@dagster-io/ui-components';

import {DaemonHealth} from './DaemonHealth';
import {gql} from '../apollo-client';
import {DaemonStatusForListFragment} from './types/DaemonList.types';
import {gql} from '../apollo-client';
import {useConfirmation} from '../app/CustomConfirmationProvider';
import {useUnscopedPermissions} from '../app/Permissions';
import {PYTHON_ERROR_FRAGMENT} from '../app/PythonErrorFragment';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const automationName = (automation: RunAutomation | null) => {
const {type} = automation;
switch (type) {
case 'legacy-amp':
return 'Auto-materialized';
return 'Automation condition';
case 'schedule':
case 'sensor':
return automation.name;
Expand Down
10 changes: 5 additions & 5 deletions js_modules/dagster-ui/packages/ui-core/src/runs/CreatedByTag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const CreatedByTagCellWrapper = styled(Box)``;

type TagType =
| {
type: 'user' | 'schedule' | 'sensor' | 'auto-materialize' | 'auto-observe';
type: 'user' | 'schedule' | 'sensor' | 'automation-condition' | 'auto-observe';
tag: RunTagsFragment;
}
| {type: 'manual'};
Expand All @@ -53,11 +53,11 @@ const pluckTagFromList = (tags: RunTagsFragment[]): TagType => {
const {key} = tag;
switch (key) {
case DagsterTag.Automaterialize:
return {type: 'auto-materialize', tag};
return {type: 'automation-condition', tag};
case DagsterTag.CreatedBy: {
// Backwards compatibility
if (tag.value === 'auto_materialize') {
return {type: 'auto-materialize', tag};
return {type: 'automation-condition', tag};
} else {
continue;
}
Expand Down Expand Up @@ -105,8 +105,8 @@ export const CreatedByTag = ({repoAddress, tags, onAddTag}: Props) => {
</Tag>
);
}
case 'auto-materialize':
return <Tag icon="auto_materialize_policy">Auto-materialize policy</Tag>;
case 'automation-condition':
return <Tag icon="automation_condition">Automation condition</Tag>;
case 'auto-observe':
return <Tag icon="auto_observe">Auto-observation</Tag>;
}
Expand Down
1 change: 1 addition & 0 deletions js_modules/dagster-ui/packages/ui-core/src/runs/RunTag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {Link} from 'react-router-dom';
import {TagAction, TagActionsPopover} from '../ui/TagActions';

export enum DagsterTag {
AutomationCondition = 'dagster/from_automation_condition',
Automaterialize = 'dagster/auto_materialize',
AutoObserve = 'dagster/auto_observe',
Namespace = 'dagster/',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ import {useCallback, useMemo} from 'react';
import {UserDisplay} from 'shared/runs/UserDisplay.oss';

import {DagsterTag} from './RunTag';
import {gql, useApolloClient, useLazyQuery} from '../apollo-client';
import {
RunTagKeysQuery,
RunTagKeysQueryVariables,
RunTagValuesQuery,
RunTagValuesQueryVariables,
} from './types/RunsFilterInput.types';
import {gql, useApolloClient, useLazyQuery} from '../apollo-client';
import {COMMON_COLLATOR} from '../app/Util';
import {__ASSET_JOB_PREFIX} from '../asset-graph/Utils';
import {RunStatus, RunsFilter} from '../graphql/types';
Expand Down Expand Up @@ -499,8 +499,8 @@ export const useRunsFilterInput = ({tokens, onChange, enabledFilters}: RunsFilte
} else if (value.type === DagsterTag.User) {
return <UserDisplay email={value.value!} isFilter />;
} else if (value.type === DagsterTag.Automaterialize) {
icon = <Icon name="auto_materialize_policy" />;
labelValue = 'Auto-materialize policy';
icon = <Icon name="automation_condition" />;
labelValue = 'Automation condition';
}
return (
<Box flex={{direction: 'row', gap: 4, alignItems: 'center'}}>
Expand All @@ -511,7 +511,7 @@ export const useRunsFilterInput = ({tokens, onChange, enabledFilters}: RunsFilte
},
getStringValue: (x) => {
if (x.type === DagsterTag.Automaterialize) {
return 'Auto-materialize policy';
return 'Automation condition';
}
return x.value!;
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,14 +284,15 @@ export const SENSOR_TYPE_META: Record<
},
[SensorType.AUTO_MATERIALIZE]: {
name: 'Automation condition sensor',
icon: 'auto_materialize_policy',
icon: 'automation_condition',
description:
'Auto-materialize sensors trigger runs based on auto-materialize policies defined on assets.',
'Automation condition sensors trigger runs based on conditions defined on assets or checks.',
},
[SensorType.AUTOMATION]: {
name: 'Automation condition sensor',
icon: 'auto_materialize_policy',
description: 'Automation sensors trigger runs based on conditions defined on assets.',
icon: 'automation_condition',
description:
'Automation condition sensors trigger runs based on conditions defined on assets or checks.',
},
[SensorType.FRESHNESS_POLICY]: {
name: 'Freshness policy sensor',
Expand Down
4 changes: 2 additions & 2 deletions python_modules/dagster/dagster/_daemon/asset_daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def __exit__(
):
try:
raise Exception(
"Unable to reach the code server. Auto-materialization will resume once the code server is available."
"Unable to reach the code server. Automation condition evaluation will resume once the code server is available."
) from exception_value
except:
error_data = DaemonErrorCapture.on_exception(sys.exc_info())
Expand Down Expand Up @@ -853,7 +853,7 @@ def _process_auto_materialize_tick_generator(
error_info = DaemonErrorCapture.on_exception(
exc_info=sys.exc_info(),
logger=self._logger,
log_message="Auto-materialize daemon caught an error",
log_message="Automation condition daemon caught an error",
)

yield error_info
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,9 @@ def test_error_loop_after_cursor_written(daemon_not_paused_instance, crash_locat
assert ticks[0].tick_data.failure_count == 0

assert "WHERE IS THE CODE" in str(ticks[0].tick_data.error)
assert "Auto-materialization will resume once the code server is available" in str(
ticks[0].tick_data.error
assert (
"Automation condition evaluation will resume once the code server is available"
in str(ticks[0].tick_data.error)
)

# Run requests are still on the tick since they were stored there before the
Expand Down

0 comments on commit d30af9a

Please sign in to comment.