Skip to content

Commit

Permalink
add launch all frontend for schedules
Browse files Browse the repository at this point in the history
  • Loading branch information
dliu27 committed Nov 20, 2024
1 parent 91b0ac4 commit d90bb7e
Show file tree
Hide file tree
Showing 5 changed files with 353 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 d90bb7e

Please sign in to comment.