If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

display docs link in default 404 handler for services

NEW
Unassigned

Status

Taskcluster
General
2 years ago
a year ago

People

(Reporter: pmoore, Unassigned, Mentored)

Tracking

(Blocks: 1 bug)

Details

(Whiteboard: [good-first-bug])

Sometimes people will stumble on scripts that connect to taskcluster APIs. They might not know about taskcluster, and may instinctively visit the top level domain. Currently, if they visit one of them, they will get a HTTP 404 with a payload "Cannot GET /".

Since we have docs for each service, it would make sense, at least from the top level path, to redirect to those docs.

Explicitly, let's set up the following HTTP 302 redirects:

http(s)://auth.taskcluster.net/             -> http://docs.taskcluster.net/auth/api-docs
http(s)://aws-provisioner.taskcluster.net/  -> http://docs.taskcluster.net/aws-provisioner/api-docs
http(s)://hooks.taskcluster.net/            -> http://docs.taskcluster.net/services/hooks
http(s)://index.taskcluster.net/            -> http://docs.taskcluster.net/services/index
http(s)://purge-cache.taskcluster.net/      -> http://docs.taskcluster.net/services/purge-cache
http(s)://queue.taskcluster.net/            -> http://docs.taskcluster.net/queue/api-docs
http(s)://scheduler.taskcluster.net/        -> http://docs.taskcluster.net/scheduler/api-docs
http(s)://secrets.taskcluster.net/          -> http://docs.taskcluster.net/services/secrets
http(s)://taskcluster-github.herokuapp.com/ -> http://docs.taskcluster.net/services/taskcluster-github

We could also consider redirecting from /v1 to the same docs location on all of the above domains.

This brings us a lot closer to the concept of "self describing apis", although of course not all the way.

Originally proposed here:
  * https://github.com/taskcluster/taskcluster-secrets/pull/6/files#r48695860
N.B. I've raised bug 1237585 to rename `taskcluster-github.herokuapp.com` to `github.taskcluster.net`.
See Also: → bug 1237585
I like this, but I'd like to rename the docs first (bug 1056282) which would change the redirect locations, so if you don't mind holding off that'd be great.
This should not be a 302 redirect!
It should be a 404, with HTML body that shows a link to the docs site.
If you want redirection from browser perspective use a meta-tag.

I want an API call that misses it's target to get a 404, that's a lot better than a redirect.
Blocks: 1238108
Duplicate of this bug: 1238108
While we're at it, the error pages should include Access-Control-Allow-Origin headers.  Right now if you get the API endpoints wrong in a browser, you just get a slew of same-origin failures, rather than a 404.
Updated title to be more accurate:
  Display link to docs in default 404 handler.
Summary: 302 redirect from top level url path to our online docs for each service → display docs link in default 404 handler for services
Blocks: 1238149
Could we implement this now that bug 1056282 is closed?
Assignee: nobody → dustin
Assignee: dustin → nobody
Mentor: dustin@mozilla.com
Whiteboard: [good-first-bug]
You need to log in before you can comment on or make changes to this bug.