taskcluster / taskcluster-client-web

A Taskcluster client library for the browser
Mozilla Public License 2.0
3 stars 8 forks source link

Refactor client to support redeployability with TASKCLUSTER_ROOT_URL #32

Closed eliperelman closed 6 years ago

eliperelman commented 6 years ago

Apologies for the bulk of the changes being linting fixes.

djmitche commented 6 years ago

By the way, http://bugzil.la/1467210 is about serving a manifests.json file, and http://bugzil.la/1467480 is about having a fixed location for api-references.json and exchange-references.json. Neither of those should block this work, though.

edmorley commented 6 years ago

Hi! At first glance I'm struggling to tell if this is a breaking change for Treeherder using the NPM release of this library? Do we now need to set the root URL, or is that done in the release? Having this kind of thing be clearer either via a changelog/major version upgrade guide, or else just elaborated in PR descriptions would be really useful when evaluating Renovate PRs like mozilla/treeherder#3642.

edmorley commented 6 years ago

Trying v8 locally I get Missing required option "url" on the new login tab partway through the callback. However the main Treeherder tab does still end up logged in. Is this expected?

eliperelman commented 6 years ago

@edmorley sorry, just hadn't put any effort into a better changelog here yet, apologies.

The OIDC client now needs a full URL, see how we do it in tools:

https://github.com/taskcluster/taskcluster-tools/blob/1d1e1dc026a3bc3d93c6cdc1ba75a8b6072edf0c/src/auth/UserSession.js#L40-L43

This means you can also specify a full URL of https://login.taskcluster.net/v1/oidc-credentials/mozilla-auth0 if you want to hardcode it.

Using the taskcluster-client-web npm package means you'll need to pass a rootUrl as an option to every client constructor. The easiest way to continue to use the current production instance with the latest version is to use a rootUrl of https://taskcluster.net:

import { Queue } from 'taskcluster-client-web';

const queue = new Queue({ rootUrl: 'https://taskcluster.net' });

Let me know if that works.