Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to PivotalTracker API v5 #22

Open
cantonic opened this issue Aug 5, 2014 · 10 comments
Open

Update to PivotalTracker API v5 #22

cantonic opened this issue Aug 5, 2014 · 10 comments

Comments

@cantonic
Copy link
Contributor

cantonic commented Aug 5, 2014

I am currently working on upgrading pickler to use PivotalTracker API v5 instead v3.
When starting on it I thought it would be pretty straight forward, but it turns out there is a lot of stuff to do

So there are a lot of changes to be made. The tests would have to be changes. Especially the saves responses from using fakeweb since they are all in XML.

I am not sure what they have changed regarding the Endpoints/Resources, but this could also lead to some extra work.

The API calls are all hard coded. So if we want to use API features of v5 which haven't been in v3 we will have to add more hard coded API calls.

Therefore I am considering using https://github.com/dashofcode/tracker_api for the job. Using tracker_api we can easily add new features since it covers all (or most) of the endpoints/resources available in v5 and I guess this would encourage more developers to contribute and add features to pickler.

@ryan-mars
Copy link

👍

@tpope
Copy link
Owner

tpope commented Aug 5, 2014

SSL was trivial. JSON's challenging just because you have to add it at the same time as the rest of the v5 upgrade (thanks Pivotal), but if the responses are similar, I'm not worried about converting a whopping 3 xml files to json.

According to the README, tracker_api doesn't support create, update, or delete. Sounds like a complete deal breaker to me.

@cantonic
Copy link
Contributor Author

cantonic commented Aug 5, 2014

hmm... that's a pitty. But alright, I will go ahead and make a fresh API request to get new dummy data. Would you mind when I use VCR or Webmock instead of Fakeweb? The last release of Fakeweb was 3 years ago. VCR and Webmock are developed and maintained actively.

@tpope
Copy link
Owner

tpope commented Aug 5, 2014

That would be fine. Just make it as a separate change.

@tpope
Copy link
Owner

tpope commented Aug 5, 2014

My general strategy would be to add a v5_request method, and then port the requests one by one. That way you're not stuck trying to fix a half dozen requests at once.

@cantonic
Copy link
Contributor Author

cantonic commented Aug 5, 2014

yes that makes totally sense.

@cantonic
Copy link
Contributor Author

cantonic commented Aug 5, 2014

uhm... sorry for asking again... I thought I got what you mean, but looks like I didn't :(
Where should I create a v5_request method?
I would just convert the XML requests to JSON now and make according changes to spec_helper.rb to use v5 and try to get all tests passing and after that I would move from Fakeweb to VCR. is that what you mean?

@tpope
Copy link
Owner

tpope commented Aug 5, 2014

Basically take this, change xml to json, and BASE_PATH to V5_BASE_PATH (which you'll of course have to define). Next step will probably be making _json methods to go with the _xml methods in that file. Don't worry about a bit of duplication; we'll delete the old methods when we're done.

I mean you should convert from Fakeweb to VCR in a separate commit from any other change. I would think you would want to do it early, but whenever you see fit is fine.

@cantonic
Copy link
Contributor Author

cantonic commented Aug 5, 2014

okay now I got it. Then I will install VCR first and follow your guidelines. Thanks for them

@mainephd
Copy link
Contributor

pull request submitted #25

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

No branches or pull requests

4 participants