Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
} catch (e) {
this.setState({ triggering: false });
notify(`YAML Error: ${e.message}`, 'danger');
return;
}
const valid = validate(input);
if (!valid) {
this.setState({ triggering: false });
notify(ajv.errorsText(validate.errors), 'danger');
return;
}
}
TaskclusterModel.submit({
action,
actionTaskId: slugid(),
decisionTaskId,
taskId: originalTaskId,
task: originalTask,
input,
staticActionVariables,
currentRepo,
}).then(
taskId => {
this.setState({ triggering: false });
let message = 'Custom action request sent successfully:';
let url = tcLibUrls.ui(currentRepo.tc_root_url, `/tasks/${taskId}`);
// For the time being, we are redirecting specific actions to
// specific urls that are different than usual. At this time, we are
// only directing loaner tasks to the loaner UI in the tools site.
// It is possible that we may make this a part of the spec later.
return tcactions.load(decisionTaskId, $scope.job).then((results) => {
const actionTaskId = slugid();
if (results) {
const backfilltask = _.find(results.actions, { name: 'backfill' });
// We'll fall back to actions.yaml if this isn't true
if (backfilltask) {
return tcactions.submit({
action: backfilltask,
actionTaskId,
decisionTaskId,
taskId: results.originalTaskId,
task: results.originalTask,
input: {},
staticActionVariables: results.staticActionVariables,
}).then(function () {
$scope.$apply(thNotify.send(`Request sent to backfill job via actions.json (${actionTaskId})`, 'success'));
}, function (e) {
// The full message is too large to fit in a Treeherder
} catch (e) {
$scope.triggering = false;
thNotify.send(`YAML Error: ${e.message}`, 'danger');
return;
}
const valid = validate(input);
if (!valid) {
$scope.triggering = false;
thNotify.send(ajv.errorsText(validate.errors), 'danger');
return;
}
}
tcactions.submit({
action: $scope.input.selectedAction,
actionTaskId: slugid(),
decisionTaskId,
taskId: originalTaskId,
task: originalTask,
input,
staticActionVariables: $scope.staticActionVariables,
}).then(function (taskId) {
$scope.triggering = false;
let message = 'Custom action request sent successfully:';
let url = `https://tools.taskcluster.net/tasks/${taskId}`;
// For the time being, we are redirecting specific actions to
// specific urls that are different than usual. At this time, we are
// only directing loaner tasks to the loaner UI in the tools site.
// It is possible that we may make this a part of the spec later.
const loaners = ['docker-worker-linux-loaner', 'generic-worker-windows-loaner'];
if (loaners.indexOf($scope.input.selectedAction.name) !== -1) {
return taskclusterModel.load(decisionTaskId).then((results) => {
const actionTaskId = slugid();
// In this case we have actions.json tasks
if (results) {
const addjobstask = results.actions.find(action =>
action.name === 'add-new-jobs');
// We'll fall back to actions.yaml if this isn't true
if (addjobstask) {
return taskclusterModel.submit({
action: addjobstask,
actionTaskId,
decisionTaskId,
taskId: null,
task: null,
input: { tasks: tclabels },
staticActionVariables: results.staticActionVariables,
}).then(() => `Request sent to trigger new jobs via actions.json (${actionTaskId})`);
}
return taskclusterModel.load(decisionTaskId).then((results) => {
const actionTaskId = slugid();
// In this case we have actions.json tasks
if (results) {
const missingtask = results.actions.find(action =>
action.name === 'run-missing-tests');
// We'll fall back to actions.yaml if this isn't true
if (missingtask) {
return taskclusterModel.submit({
action: missingtask,
actionTaskId,
decisionTaskId,
taskId: null,
task: null,
input: {},
staticActionVariables: results.staticActionVariables,
}).then(() => `Request sent to trigger missing jobs via actions.json (${actionTaskId})`);
.then(async results => {
const actionTaskId = slugid();
const taskLabels = value.map(job => job.job_type_name);
let retriggerAction = results.actions.find(
action => action.name === 'retrigger-multiple',
);
let actionInput = {
requests: [{ tasks: taskLabels, times }],
};
if (!retriggerAction) {
// The `retrigger-multiple` action as introduced in Bug 1521032, to all the action
// to control whether new task are created, or existing ones re-run. We fall back
// to `add-new-jobs` to support pushing old revision to try, where the duplicating
// the release tasks impacted is unlikely to cause problems.
retriggerAction = getAction(results.actions, 'add-new-jobs');
actionInput = {
tasks: taskLabels,
results => {
const actionTaskId = slugid();
const addNewJobsTask = getAction(results.actions, 'add-new-jobs');
return TaskclusterModel.submit({
action: addNewJobsTask,
actionTaskId,
decisionTaskId,
taskId: null,
task: null,
input: { tasks: jobs },
staticActionVariables: results.staticActionVariables,
currentRepo,
}).then(
() =>
`Request sent to trigger new jobs via actions.json (${actionTaskId})`,
);
},