Closed svanharmelen closed 10 years ago
This unit test will break if I merge this: https://github.com/marpaia/chef-golang/blob/master/api_test.go#L225
@spheromak, we've gotten a bit of heat before for breaking the public API. what do you think?
Hi @marpaia,
Updating the unit test is of course no problem (should have probably done that together with my initial PR), but at this point it's maybe better to first hear the opinion of @spheromak about this change...
So that if we need to find another way to get this functionality, I don't have to rewrite the tests twice :wink:
So would love to hear what you think about this PR @spheromak?
Hi @marpaia and @spheromak, any update on your points of view over this one?
Thx!
In General I don't like how the backend for requests are crafted in the current codebase. I was working on making things better, but it would require all the current api methods change. For me personally I am 100% ok with breaking how POST works :+1:
@svanharmelen i'm cool with merging once the tests are modified
@marpaia I just got around to updating the tests. I also added a line of code so that you can also send an empty string as the content type. If you do so, the header will not be set which will give the same behaviour as before this commit.
Hi @marpaia and @spheromak, I would really love it if you can merge this PR now... I updated the tests as requested, so it seems there is no reason to not merge it now.
If anything changed and you do want me to update/change anything else, then please let me know so I can fix that and we can move ahead with this PR.
Thanks!
As this now has a merge conflict, I will close this PR and open a new clean one instead.
With this added code you can now post a cookbook to the community, or newly released supermarket, API. It does break backwards compatibility for post commands which with the current options seems the only way to make this work.
Please let's discus alternatives if this is not an acceptable approach. For example, one solution could be to make a PostCookbook method in addition to the Post method.
Cheers,
S.