Skip to content

Commit

Permalink
Run action menu displays run metric based on graphql field instead of…
Browse files Browse the repository at this point in the history
… tag (dagster-io#24664)

## Summary & Motivation

Use the new graphql 'hasRunMetricsEnabled' field created in dagster-io#24662 to condition visibility of run metrics in action menu

## How I Tested These Changes

- manual testing

## Changelog

NOCHANGELOG
  • Loading branch information
mlarose authored Oct 8, 2024
1 parent 75d9d72 commit 27cc76b
Show file tree
Hide file tree
Showing 20 changed files with 42 additions and 26 deletions.
20 changes: 10 additions & 10 deletions js_modules/dagster-ui/packages/ui-core/client.json

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.

Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import {DeletionDialog} from './DeletionDialog';
import {ReexecutionDialog} from './ReexecutionDialog';
import {RunConfigDialog} from './RunConfigDialog';
import {doneStatuses, failedStatuses} from './RunStatuses';
import {DagsterTag} from './RunTag';
import {RunTags} from './RunTags';
import {RunsQueryRefetchContext} from './RunUtils';
import {RunFilterToken} from './RunsFilterInput';
Expand Down Expand Up @@ -92,8 +91,7 @@ export const RunActionsMenu = React.memo(({run, onAddTag, anchorLabel}: Props) =
const pipelineRun =
data?.pipelineRunOrError?.__typename === 'Run' ? data?.pipelineRunOrError : null;
const runConfigYaml = pipelineRun?.runConfigYaml;
const runMetricsEnabled = run.tags.some((t) => t.key === DagsterTag.RunMetrics);

const runMetricsEnabled = run.hasRunMetricsEnabled;
const repoMatch = useRepositoryForRunWithParentSnapshot(pipelineRun);
const jobError = useJobAvailabilityErrorForRun({
...run,
Expand Down Expand Up @@ -518,6 +516,7 @@ export const RUN_ACTIONS_MENU_RUN_FRAGMENT = gql`
repositoryName
repositoryLocationName
}
hasRunMetricsEnabled
}
`;

Expand All @@ -537,6 +536,7 @@ export const PIPELINE_ENVIRONMENT_QUERY = gql`
repositoryName
repositoryLocationName
}
hasRunMetricsEnabled
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const RUN_FRAGMENT = gql`
hasReExecutePermission
hasTerminatePermission
hasDeletePermission
hasRunMetricsEnabled
status
mode
tags {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {DeletionDialog} from './DeletionDialog';
import {QueuedRunCriteriaDialog} from './QueuedRunCriteriaDialog';
import {RunConfigDialog} from './RunConfigDialog';
import {doneStatuses} from './RunStatuses';
import {DagsterTag} from './RunTag';
import {RunsQueryRefetchContext} from './RunUtils';
import {TerminationDialog} from './TerminationDialog';
import {RunFragment} from './types/RunFragments.types';
Expand Down Expand Up @@ -35,7 +34,7 @@ type VisibleDialog =

export const RunHeaderActions = ({run, isJob}: {run: RunFragment; isJob: boolean}) => {
const {runConfigYaml} = run;
const runMetricsEnabled = run.tags.some((t) => t.key === DagsterTag.RunMetrics);
const runMetricsEnabled = run.hasRunMetricsEnabled;

const [visibleDialog, setVisibleDialog] = useState<VisibleDialog>(null);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const RUN_TABLE_RUN_FRAGMENT = gql`
hasReExecutePermission
hasTerminatePermission
hasDeletePermission
hasRunMetricsEnabled
mode
rootRunId
parentRunId
Expand Down
1 change: 0 additions & 1 deletion js_modules/dagster-ui/packages/ui-core/src/runs/RunTag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export enum DagsterTag {
SnapshotID = 'dagster/snapshot_id', // This only exists on the client, not the server.
ReportingUser = 'dagster/reporting_user',
User = 'user',
RunMetrics = 'dagster/run_metrics',

// Hidden tags (using ".dagster" HIDDEN_TAG_PREFIX)
RepositoryLabelTag = '.dagster/repository',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export const buildRunActionsMenuFragment = ({hasReExecutePermission}: RunConfigI
canTerminate: true,
hasDeletePermission: true,
hasReExecutePermission,
hasRunMetricsEnabled: true,
hasTerminatePermission: true,
mode: 'default',
rootRunId: 'abcdef12',
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.

0 comments on commit 27cc76b

Please sign in to comment.