Skip to content
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.

It should be more obvious that trailing slash in tracker URL isn't allowed #21

Open
jenspinney opened this issue Jan 24, 2018 · 0 comments

Comments

@jenspinney
Copy link

If a user sets tracker_url: https://www.pivotaltracker.com/ instead of tracker_url: https://www.pivotaltracker.com, the resource doesn't work and in a very non-obvious way.

Instead of failing immediately or silently removing the extra slash and proceeding normally, the resource appears to scan all accepted stories instead of finished stories, and thus will never find the story intended to be delivered.

To debug this, we built and docker-pushed our own fork of this repo with additional log lines in the underlying go code. We don't want someone else to need to do the same!

Suggested Fixes

We suggest that one of the following approaches are taken to lessen the pain/confusion for users in this case:

  1. Make it clear in the README that the tracker URL is not allowed to have a trailing slash.
  2. Detect any trailing slashes and fail immediately with a clear error message explaining that the user should remove the trailing slash.
  3. Strip any trailing slashes and proceed normally (i.e., successfully).

The last option seems like the nicest user experience, but any of the above would be helpful.

Implementation details

If you run

export TOKEN='your Pivotal Tracker API token'

export PROJECT_ID=99

curl -X GET -H "X-TrackerToken: $TOKEN" \ 
 "https://www.pivotaltracker.com/services/v5/projects/$PROJECT_ID/stories?with_state=finished"

You will get all the stories in the finished state (as expected). However, if you run the following (note the double slashes in the URL):

curl -X GET -H "X-TrackerToken: $TOKEN" \
 "https://www.pivotaltracker.com//services/v5/projects/$PROJECT_ID/stories?with_state=finished"

You will get a successful response code and body, but one that appears to contain all accepted stories (at least this is what we observed for our tracker project).

You could say this is a bug (or at least surprising behavior) from the tracker API itself, but the concourse resource should also prevent users from running into this.

Thanks,
Jen and @ablease

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants