tpope / pickler

PIvotal traCKer Liaison to cucumbER
MIT License
299 stars 23 forks source link

Update to PivotalTracker API v5 #22

Open cantonic opened 10 years ago

cantonic commented 10 years ago

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 commented 10 years ago

👍

tpope commented 10 years ago

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 commented 10 years ago

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 commented 10 years ago

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

tpope commented 10 years ago

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 commented 10 years ago

yes that makes totally sense.

cantonic commented 10 years ago

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 commented 10 years ago

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 commented 10 years ago

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

mainephd commented 7 years ago

pull request submitted https://github.com/tpope/pickler/pull/25