Skip to content

Commit

Permalink
[6/n] [RFC] add launch all frontend functionality for schedules (dags…
Browse files Browse the repository at this point in the history
…ter-io#26063)

## Summary & Motivation
Linear:
https://linear.app/dagster-labs/issue/FE-654/[fe]-implement-launch-all-frontend-schedule

Adds the frontend for 'launch all' for manual tick schedules

Video:


https://github.com/user-attachments/assets/1d3a9315-cc05-4142-8964-5e86e077403b


## How I Tested These Changes
tested the launch all runs flow locally

yarn lint, ts, jest, generate-graphql in ui-core
  • Loading branch information
dliu27 committed Dec 9, 2024
1 parent 09e968b commit 9e4a1f9
Show file tree
Hide file tree
Showing 5 changed files with 359 additions and 143 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,26 @@ export function useLaunchMultipleRunsWithTelemetry() {

return useCallback(
async (variables: LaunchMultipleRunsMutationVariables, behavior: LaunchBehavior) => {
const executionParamsList = Array.isArray(variables.executionParamsList)
? variables.executionParamsList
: [variables.executionParamsList];
const jobNames = executionParamsList.map((params) => params.selector?.jobName);
try {
const executionParamsList = Array.isArray(variables.executionParamsList)
? variables.executionParamsList
: [variables.executionParamsList];
const jobNames = executionParamsList.map((params) => params.selector?.jobName);

if (jobNames.length !== executionParamsList.length || jobNames.includes(undefined)) {
return;
}
if (
jobNames.length !== executionParamsList.length ||
jobNames.includes(undefined) ||
jobNames.includes(null)
) {
throw new Error('Invalid job names');
}

const metadata: {[key: string]: string | string[] | null | undefined} = {
jobNames: jobNames.filter((name): name is string => name !== undefined),
opSelection: undefined,
};
const metadata: {[key: string]: string | string[] | null | undefined} = {
jobNames: jobNames.filter((name): name is string => name !== undefined),
opSelection: undefined,
};

let result;
try {
result = (await launchMultipleRuns({variables})).data?.launchMultipleRuns;
const result = (await launchMultipleRuns({variables})).data?.launchMultipleRuns;
if (result) {
handleLaunchMultipleResult(result, history, {behavior});
logTelemetry(
Expand Down
Loading

0 comments on commit 9e4a1f9

Please sign in to comment.