How to use the taskcluster-client-web.slugid function in taskcluster-client-web

To help you get started, we’ve selected a few taskcluster-client-web examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mozilla / treeherder / ui / job-view / CustomJobActions.jsx View on Github external
} 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.
github mozilla / treeherder / ui / plugins / controller.js View on Github external
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
github mozilla / treeherder / ui / js / controllers / tcjobactions.js View on Github external
} 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) {
github mozilla / treeherder / ui / js / models / resultset.js View on Github external
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})`);
                            }
github mozilla / treeherder / ui / js / models / resultset.js View on Github external
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})`);
github mozilla / treeherder / ui / models / job.js View on Github external
.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,
github mozilla / treeherder / ui / models / push.js View on Github external
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})`,
        );
      },

taskcluster-client-web

[![Download](https://img.shields.io/badge/yarn-taskcluster--client--web-brightgreen)](https://yarnpkg.com/en/package/taskcluster-client-web) [![License](https://img.shields.io/badge/license-MPL%202.0-orange.svg)](http://mozilla.org/MPL/2.0)

MPL-2.0
Latest version published 9 days ago

Package Health Score

66 / 100
Full package analysis

Similar packages