Update dependency taskcluster-client-web to v8 (#3642)

This commit is contained in:
renovate[bot] 2018-08-16 14:45:46 -07:00 коммит произвёл Cameron Dawson
Родитель a99730b644
Коммит 2b908cede1
8 изменённых файлов: 89 добавлений и 54 удалений

Просмотреть файл

@ -72,7 +72,7 @@
"redux": "4.0.0",
"redux-debounce": "1.0.1",
"redux-thunk": "2.3.0",
"taskcluster-client-web": "7.0.0",
"taskcluster-client-web": "8.0.4",
"taskcluster-lib-scopes": "10.0.1"
},
"devDependencies": {

Просмотреть файл

@ -1,4 +1,5 @@
import { OIDCCredentialAgent, fromNow } from 'taskcluster-client-web';
import { OIDCCredentialAgent, fromNow, Queue } from 'taskcluster-client-web';
import { tcRootUrl, getUserSessionUrl } from './url';
const taskcluster = (() => {
let credentialAgent = null;
@ -10,11 +11,14 @@ const taskcluster = (() => {
}
const userSession = localStorage.getItem('userSession');
const oidcProvider = 'mozilla-auth0';
if (userSession) {
credentialAgent = new OIDCCredentialAgent({
accessToken: JSON.parse(userSession).accessToken,
oidcProvider: 'mozilla-auth0',
oidcProvider,
url: getUserSessionUrl(oidcProvider),
rootUrl: tcRootUrl,
});
}
@ -24,6 +28,12 @@ const taskcluster = (() => {
return {
getAgent: tcAgent,
// When the access token is refreshed, simply update it on the credential agent
getQueue: () => (
new Queue({
credentialAgent: tcAgent(),
rootUrl: tcRootUrl,
})
),
updateAgent: () => {
const userSession = localStorage.getItem('userSession');

Просмотреть файл

@ -1,5 +1,3 @@
import { Queue } from 'taskcluster-client-web';
import taskcluster from './taskcluster';
import { getUrlParam, getAllUrlParams } from './location';
@ -11,6 +9,12 @@ export const hgBaseUrl = 'https://hg.mozilla.org/';
export const dxrBaseUrl = 'https://dxr.mozilla.org/';
export const tcRootUrl = 'https://taskcluster.net';
export const getUserSessionUrl = function getUserSessionUrl(oidcProvider) {
return `https://login.taskcluster.net/v1/oidc-credentials/${oidcProvider}`;
};
export const createQueryParams = function createQueryParams(params) {
const query = new URLSearchParams(params);
return `?${query.toString()}`;
@ -43,7 +47,7 @@ export const getReftestUrl = function getReftestUrl(logUrl) {
};
export const getWorkerExplorerUrl = async function getWorkerExplorerUrl(taskId) {
const queue = new Queue({ credentialAgent: taskcluster.getAgent() });
const queue = taskcluster.getQueue();
const { status } = await queue.status(taskId);
const { provisionerId, workerType } = status;
const { workerGroup, workerId } = status.runs[status.runs.length - 1];

Просмотреть файл

@ -1,6 +1,6 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Queue, slugid } from 'taskcluster-client-web';
import { slugid } from 'taskcluster-client-web';
import $ from 'jquery';
import jsyaml from 'js-yaml';
@ -164,7 +164,7 @@ export default class ActionBar extends React.Component {
}
// Otherwise we'll figure things out with actions.yml
const queue = new Queue({ credentialAgent: taskcluster.getAgent() });
const queue = taskcluster.getQueue();
// buildUrl is documented at
// https://github.com/taskcluster/taskcluster-client-web#construct-urls

Просмотреть файл

@ -20,6 +20,7 @@ export const userSessionFromAuthResult = (authResult) => {
fullName: authResult.idTokenPayload.nickname,
picture: authResult.idTokenPayload.picture,
oidcSubject: authResult.idTokenPayload.sub,
url: authResult.url,
// expiresAt is used by the django backend to expire the user session
expiresAt,
// per https://wiki.mozilla.org/Security/Guidelines/OpenID_connect#Session_handling

Просмотреть файл

@ -1,7 +1,7 @@
import _ from 'lodash';
import angular from 'angular';
import jsyaml from 'js-yaml';
import { Queue, slugid } from 'taskcluster-client-web';
import { slugid } from 'taskcluster-client-web';
import treeherder from '../treeherder';
import taskcluster from '../../helpers/taskcluster';
@ -239,7 +239,7 @@ treeherder.factory('ThResultSetModel', ['$http', '$location',
}
// Otherwise we'll figure things out with actions.yml
const queue = new Queue({ credentialAgent: taskcluster.getAgent() });
const queue = taskcluster.getQueue();
const url = queue.buildUrl(queue.getLatestArtifact, decisionTaskId, 'public/action.yml');
return $http.get(url).then(function (resp) {
let action = resp.data;
@ -257,7 +257,7 @@ treeherder.factory('ThResultSetModel', ['$http', '$location',
},
triggerNewJobs: function (buildernames, decisionTaskId) {
const queue = new Queue({ credentialAgent: taskcluster.getAgent() });
const queue = taskcluster.getQueue();
const url = queue.buildUrl(
queue.getLatestArtifact,
decisionTaskId,

Просмотреть файл

@ -1,9 +1,10 @@
import _ from 'lodash';
import jsone from 'json-e';
import { Queue, Auth, Hooks } from 'taskcluster-client-web';
import { Auth, Hooks } from 'taskcluster-client-web';
import { satisfiesExpression } from 'taskcluster-lib-scopes';
import taskcluster from '../helpers/taskcluster';
import { tcRootUrl } from '../helpers/url';
export default class TaskclusterModel {
constructor(notify) {
@ -28,7 +29,7 @@ export default class TaskclusterModel {
taskId: taskId || null,
input,
}, staticActionVariables);
const queue = new Queue({ credentialAgent: taskcluster.getAgent() });
const queue = taskcluster.getQueue();
if (action.kind === 'task') {
context.task = task;
@ -45,8 +46,11 @@ export default class TaskclusterModel {
if (action.kind === 'hook') {
const hookPayload = jsone(action.hookPayload, context);
const { hookId, hookGroupId } = action;
const auth = new Auth();
const hooks = new Hooks({ credentialAgent: taskcluster.getAgent() });
const auth = new Auth({ rootUrl: tcRootUrl });
const hooks = new Hooks({
credentialAgent: taskcluster.getAgent(),
rootUrl: tcRootUrl,
});
const decisionTask = await queue.task(decisionTaskId);
const expansion = await auth.expandScopes({
scopes: decisionTask.scopes,
@ -75,7 +79,7 @@ export default class TaskclusterModel {
return;
}
const queue = new Queue({ credentialAgent: taskcluster.getAgent() });
const queue = taskcluster.getQueue();
const actionsUrl = queue.buildUrl(
queue.getLatestArtifact,
decisionTaskID,

Просмотреть файл

@ -1333,22 +1333,23 @@ boolbase@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e"
boom@4.x.x:
version "4.3.1"
resolved "https://registry.yarnpkg.com/boom/-/boom-4.3.1.tgz#4f8a3005cb4a7e3889f749030fd25b96e01d2e31"
boom@7.x.x:
version "7.2.0"
resolved "https://registry.yarnpkg.com/boom/-/boom-7.2.0.tgz#2bff24a55565767fde869ec808317eb10c48e966"
dependencies:
hoek "4.x.x"
boom@5.x.x:
version "5.2.0"
resolved "https://registry.yarnpkg.com/boom/-/boom-5.2.0.tgz#5dd9da6ee3a5f302077436290cb717d3f4a54e02"
dependencies:
hoek "4.x.x"
hoek "5.x.x"
bootstrap@4.1.3:
version "4.1.3"
resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-4.1.3.tgz#0eb371af2c8448e8c210411d0cb824a6409a12be"
bounce@1.x.x:
version "1.2.0"
resolved "https://registry.yarnpkg.com/bounce/-/bounce-1.2.0.tgz#e3bac68c73fd256e38096551efc09f504873c8c8"
dependencies:
boom "7.x.x"
hoek "5.x.x"
bowser@^1.7.3:
version "1.9.4"
resolved "https://registry.yarnpkg.com/bowser/-/bowser-1.9.4.tgz#890c58a2813a9d3243704334fa81b96a5c150c9a"
@ -2016,11 +2017,11 @@ create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4:
safe-buffer "^5.0.1"
sha.js "^2.4.8"
cryptiles@3.x.x:
version "3.1.2"
resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-3.1.2.tgz#a89fbb220f5ce25ec56e8c4aa8a4fd7b5b0d29fe"
cryptiles@4.x.x:
version "4.1.2"
resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-4.1.2.tgz#363c9ab5c859da9d2d6fb901b64d980966181184"
dependencies:
boom "5.x.x"
boom "7.x.x"
crypto-browserify@^3.11.0:
version "3.12.0"
@ -3776,14 +3777,14 @@ hash.js@^1.0.0, hash.js@^1.0.3:
inherits "^2.0.3"
minimalistic-assert "^1.0.1"
hawk@^6.0.2:
version "6.0.2"
resolved "https://registry.yarnpkg.com/hawk/-/hawk-6.0.2.tgz#af4d914eb065f9b5ce4d9d11c1cb2126eecc3038"
hawk@^7.0.7:
version "7.0.7"
resolved "https://registry.yarnpkg.com/hawk/-/hawk-7.0.7.tgz#a1eb89793f1a464c271f68e0f9eeedc910ed0e90"
dependencies:
boom "4.x.x"
cryptiles "3.x.x"
hoek "4.x.x"
sntp "2.x.x"
boom "7.x.x"
cryptiles "4.x.x"
hoek "5.x.x"
sntp "3.x.x"
he@1.1.1, he@1.1.x:
version "1.1.1"
@ -3811,9 +3812,9 @@ hmac-drbg@^1.0.0:
minimalistic-assert "^1.0.0"
minimalistic-crypto-utils "^1.0.1"
hoek@4.x.x:
version "4.2.1"
resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.1.tgz#9634502aa12c445dd5a7c5734b572bb8738aacbb"
hoek@5.x.x:
version "5.0.3"
resolved "https://registry.yarnpkg.com/hoek/-/hoek-5.0.3.tgz#b71d40d943d0a95da01956b547f83c4a5b4a34ac"
hoist-non-react-statics@^2.5.0:
version "2.5.5"
@ -6233,13 +6234,12 @@ query-string@^4.1.0:
object-assign "^4.1.0"
strict-uri-encode "^1.0.0"
query-string@^5.0.0:
version "5.1.1"
resolved "https://registry.yarnpkg.com/query-string/-/query-string-5.1.1.tgz#a78c012b71c17e05f2e3fa2319dd330682efb3cb"
query-string@^6.1.0:
version "6.1.0"
resolved "https://registry.yarnpkg.com/query-string/-/query-string-6.1.0.tgz#01e7d69f6a0940dac67a937d6c6325647aa4532a"
dependencies:
decode-uri-component "^0.2.0"
object-assign "^4.1.0"
strict-uri-encode "^1.0.0"
strict-uri-encode "^2.0.0"
querystring-es3@^0.2.0:
version "0.2.1"
@ -7045,11 +7045,14 @@ snapdragon@^0.8.1:
source-map-resolve "^0.5.0"
use "^3.1.0"
sntp@2.x.x:
version "2.1.0"
resolved "https://registry.yarnpkg.com/sntp/-/sntp-2.1.0.tgz#2c6cec14fedc2222739caf9b5c3d85d1cc5a2cc8"
sntp@3.x.x:
version "3.0.1"
resolved "https://registry.yarnpkg.com/sntp/-/sntp-3.0.1.tgz#1aa9088d3eb844ea8c0980fce1877884d4117d09"
dependencies:
hoek "4.x.x"
boom "7.x.x"
bounce "1.x.x"
hoek "5.x.x"
teamwork "3.x.x"
socket.io-adapter@0.5.0:
version "0.5.0"
@ -7280,6 +7283,10 @@ strict-uri-encode@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713"
strict-uri-encode@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz#b9c7330c7042862f6b142dc274bbcc5866ce3546"
string-width@^1.0.1, string-width@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3"
@ -7431,17 +7438,26 @@ tar@^4:
safe-buffer "^5.1.2"
yallist "^3.0.2"
taskcluster-client-web@7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/taskcluster-client-web/-/taskcluster-client-web-7.0.0.tgz#a05a4c7f629fee2f5472e499c16dedb78781ff54"
taskcluster-client-web@8.0.4:
version "8.0.4"
resolved "https://registry.yarnpkg.com/taskcluster-client-web/-/taskcluster-client-web-8.0.4.tgz#928e0c95644a1730c493e7f396197800bc942784"
dependencies:
hawk "^6.0.2"
query-string "^5.0.0"
hawk "^7.0.7"
query-string "^6.1.0"
taskcluster-lib-urls "^10.0.0"
taskcluster-lib-scopes@10.0.1:
version "10.0.1"
resolved "https://registry.yarnpkg.com/taskcluster-lib-scopes/-/taskcluster-lib-scopes-10.0.1.tgz#f3921b2b86e7c09581b045b9b880a4c35fd243e0"
taskcluster-lib-urls@^10.0.0:
version "10.0.0"
resolved "https://registry.yarnpkg.com/taskcluster-lib-urls/-/taskcluster-lib-urls-10.0.0.tgz#ee4c687b4539171d8aef39b38a63c8b9bc82f82e"
teamwork@3.x.x:
version "3.0.1"
resolved "https://registry.yarnpkg.com/teamwork/-/teamwork-3.0.1.tgz#ff38c7161f41f8070b7813716eb6154036ece196"
text-table@~0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4"