How to use the taskcluster-lib-urls.ui function in taskcluster-lib-urls

To help you get started, we’ve selected a few taskcluster-lib-urls 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 taskcluster / taskcluster / services / notify / src / handler.js View on Github external
async onMessage(message) {
    let {status} = message.payload;

    // If task was canceled, we don't send a notification since this was a deliberate user action
    if (status.state === 'exception') {
      if (this.ignoreTaskReasonResolved.includes((_.last(status.runs) || {}).reasonResolved)) {
        return null;
      }
    }

    // Load task definition
    let taskId = status.taskId;
    let task = await this.queue.task(taskId);
    let href = libUrls.ui(this.rootUrl, `tasks/${taskId}`);
    let groupHref = libUrls.ui(this.rootUrl, `groups/${taskId}/tasks`);
    let runCount = status.runs.length;

    return Promise.all(message.routes.map(entry => {
      let route = entry.split('.');

      // convert from on- syntax to state. e.g. on-exception -> exception
      let decider = _.join(_.slice(route[route.length - 1], 3), '');
      if (decider !== 'any' && status.state !== decider) {
        return null;
      }

      let ircMessage = `Task "${task.metadata.name}" complete with status '${status.state}'. Inspect: ${href}`;

      switch (route[1]) {
        case 'irc-user': {
          if (_.has(task, 'extra.notify.ircUserMessage')) {
github taskcluster / taskcluster / services / notify / src / handler.js View on Github external
async onMessage(message) {
    let {status} = message.payload;

    // If task was canceled, we don't send a notification since this was a deliberate user action
    if (status.state === 'exception') {
      if (this.ignoreTaskReasonResolved.includes((_.last(status.runs) || {}).reasonResolved)) {
        return null;
      }
    }

    // Load task definition
    let taskId = status.taskId;
    let task = await this.queue.task(taskId);
    let href = libUrls.ui(this.rootUrl, `tasks/${taskId}`);
    let groupHref = libUrls.ui(this.rootUrl, `groups/${taskId}/tasks`);
    let runCount = status.runs.length;

    return Promise.all(message.routes.map(entry => {
      let route = entry.split('.');

      // convert from on- syntax to state. e.g. on-exception -> exception
      let decider = _.join(_.slice(route[route.length - 1], 3), '');
      if (decider !== 'any' && status.state !== decider) {
        return null;
      }

      let ircMessage = `Task "${task.metadata.name}" complete with status '${status.state}'. Inspect: ${href}`;

      switch (route[1]) {
        case 'irc-user': {
github mozilla / treeherder / ui / helpers / url.js View on Github external
export const getInspectTaskUrl = function getInspectTaskUrl(
  taskId,
  rootUrl,
  timestamp,
) {
  // 1573257600 is the timestamp for the 2019-11-09 taskcluster migration date
  const _rootUrl = timestamp < 1573257600 ? 'https://taskcluster.net' : rootUrl;
  return tcLibUrls.ui(_rootUrl, `tasks/${taskId}`);
};
github mozilla / treeherder / ui / job-view / CustomJobActions.jsx View on Github external
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.
        const loaners = [
          'docker-worker-linux-loaner',
          'generic-worker-windows-loaner',
        ];
        if (loaners.includes(action.name)) {
          message = 'Visit Taskcluster site to access loaner:';
          url = `${url}/connect`;
        }
        notify(message, 'success', { linkText: 'Open in Taskcluster', url });
        this.close();
      },
github taskcluster / taskcluster / services / github / src / handlers.js View on Github external
const taskGroupUI = (rootUrl, taskGroupId) =>
  libUrls.ui(rootUrl, `${rootUrl === 'https://taskcluster.net' ? '' : '/tasks'}/groups/${taskGroupId}`);
github taskcluster / taskcluster / services / github / src / handlers.js View on Github external
const taskUI = (rootUrl, taskGroupId, taskId) =>
  libUrls.ui(rootUrl, rootUrl === 'https://taskcluster.net' ? `/groups/${taskGroupId}/tasks/${taskId}/details` : `/tasks/${taskId}`);
const taskGroupUI = (rootUrl, taskGroupId) =>

taskcluster-lib-urls

Build urls for taskcluster resources.

MPL-2.0
Latest version published 4 years ago

Package Health Score

54 / 100
Full package analysis

Similar packages