Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6/n] [RFC] add launch all frontend functionality for schedules #26063

Merged
merged 1 commit into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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');
dliu27 marked this conversation as resolved.
Show resolved Hide resolved
}

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
Loading