-
Notifications
You must be signed in to change notification settings - Fork 254
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
Context in requests - beginning of a breaking change discussion #5
Comments
From @dlebech on June 11, 2018 20:27 @orian This is a good suggestion. I'm curious what you mean by "The go' standard way is to pass context as first argument.". As far as I know, the standard way is to call Here's a suggestion in the meantime: If you want to specify e.g. a timeout globally for all your Shopify requests, then you could look into replacing the |
From @orian on June 12, 2018 10:54 Thanks. I'm aware about client method. By "standard" I mean that at least few |
From @dlebech on June 14, 2018 19:32 I understand your point about the "official" recommendation being to always add the Perhaps you have some suggestions on how to best manage a breaking change like this? |
From @orian on June 15, 2018 9:41 I think using: http://labix.org/gopkg.in would make the most sense. Or we can break the API and provide instructions for current users to switch to gopkg.in/getconversio/go-shopify.v1 and move master forward. Moving master forward is good idea for future so dep and other more advanced tools always fetch the most recent version. |
From @dlebech on June 15, 2018 19:45 I'll be honest and say that I haven't followed the progress on this front, so I'm not familiar with the Reading the documentation for What do you think? Is this similar to what you had in mind as well? Ideally, I would like to follow official guidelines about dependency management, so focusing on supporting PS. I changed the title of this issue to better reflect this is now kind of a discussion topic. 🍻 |
@gordcurrie are you open to breaking changes on this? I am working on adding Would you be open to potentially doing a v4? I am thinking this + fixing #85 by switching everything from |
Hello @epelc thank you for the interest in resolving this issue. In general we try and not make breaking changes when it can be avoided, but at the same time we aren't afraid to do a major version bump if the benefits outweigh the cost and it is a change that that makes things better for the consumers of the library. That being said, what are the cost and benefits of your proposed changes? From the above thread, I'm understanding benefits would be the ability to set timeouts and cancel the requests as well as being more consistent with a normal Go pattern of passing the context. The cost would be having to update all calls using the library to be updated to pass the context along? Am I missing anything on either front? Thanks again for your work on this. |
Hi @gordcurrie that is the gist of it for the context update. It should be a simple update for most people especially since you can defer it by using I'm working on some other things which could maybe be bundle with this to make it a more worthwhile update. |
@oliver006 Hi |
No plans right now to implement this myself but a PR with the change is welcome. If you intend to submit a PR it might make sense to outline and agree on the change first before starting the actual implementation. |
@oliver006 just hit the same issue as @shuqingzai (sort of). Happy to work on the changes on a PR. In terms of changes, I'd expect that Lines 617 to 623 in 6898174
which will pass it in the call stack until this point, where the Lines 230 to 233 in 6898174
Pretty straightforward I would say. Any concerns? |
For your consideration, I've made the changes in #257. |
@ar3s3ru - this is great, thanks for the PR, let's get this done! I think the path forward for a release of a new major version should be
What do you think? |
@oliver006 thanks for reviewing the PR 🙏🏻 The plan you outlined sounds great. Especially your last point, if you still want to consider other breaking changes before cutting the first |
From @orian on June 8, 2018 7:59
It should be possible to add
context.Context
to requests. It's particularly useful for a request we want to control a timeout, so one can usecontext.WithTimeout()
.Not sure about how to make it as the current implementation assumes that options is just
query.Values
.The go' standard way is to pass context as first argument.
Copied from original issue: getconversio#93
The text was updated successfully, but these errors were encountered: