pickler icon indicating copy to clipboard operation
pickler copied to clipboard

Update to PivotalTracker API v5

Open cantonic opened this issue 11 years ago • 10 comments

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

  • pickler currently allows to enable or disable SSL. In v5 you have to use SSL ( #20 )
  • the current version of pickler expects XML responses, but v5 only supports JSON ( #21 )

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.

cantonic avatar Aug 05 '14 03:08 cantonic

👍

ryan-mars avatar Aug 05 '14 03:08 ryan-mars

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.

tpope avatar Aug 05 '14 03:08 tpope

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.

cantonic avatar Aug 05 '14 03:08 cantonic

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

tpope avatar Aug 05 '14 03:08 tpope

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.

tpope avatar Aug 05 '14 03:08 tpope

yes that makes totally sense.

cantonic avatar Aug 05 '14 04:08 cantonic

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?

cantonic avatar Aug 05 '14 04:08 cantonic

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.

tpope avatar Aug 05 '14 04:08 tpope

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

cantonic avatar Aug 05 '14 04:08 cantonic

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

mainephd avatar Mar 15 '17 19:03 mainephd