Skip to content

Disallow empty string rootURL #23

@petemoore

Description

@petemoore

For functions that take a root URL (which is possibly all of them), we should throw an exception / panic / do-language-appropriate-thing if the empty string is passed. This can be a common failure case, because if e.g. TASKCLUSTER_ROOT_URL environment variable isn't set for some program that requires it, requests could reach taskcluster-lib-urls with the empty string ("") for rootURL. This is always invalid, and it is easy to check for, so we should handle it upfront, to avoid unexpected downstream behaviour. This has already hit our systems, e.g. with invalid references being generated, such as the following from https://references.taskcluster.net/queue/v1/api.json:

{
  "$schema": "/schemas/common/api-reference-v0.json#",
  "title": "Queue API Documentation",
  ....
}

Here we see the value returned by the apiReferenceSchema method must have been generated using an empty rootUrl, since the value of property $schema does not include the root URL (it should have been "$schema": "https://schemas.taskcluster.net/common/api-reference-v0.json").

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions