-
Notifications
You must be signed in to change notification settings - Fork 314
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
add context.Context to all calls #113
Conversation
67b2600
to
8ebc64c
Compare
e25f50a
to
299c066
Compare
299c066
to
dc14e4b
Compare
LGTM on 💚 |
Doesn't this require rebase and update as many things has been changed since then? Other than that, it looks great! 👍 💯
|
@xmudrii rebase and update was done |
Oh, great. =)I was on mobile and didn't notice it, sorry. 👍
|
So does mean that you no longer support anyone building with golang < 1.7 ? I have a project that uses |
BTW, I'm mostly just curious if this was a conscious choice. I'm not stuck -- I just won't include the Digital Ocean driver when we build using 1.6. We didn't want to keep building with 1.6 either, but we had downstream users that do. |
@codenrhoden 1.6 wasn't taken in consideration, no. It's more because we need the context propagation ourselves. I didn't quite think of 1.6 lacking support for it when I submitted the PR. However, my personal point of view on Go 1.6 however is that it's a >2 release-old version and I think most projects supporting 2 versions behind is a fair tradeoff; hence that dropping support for 1.6 is ok. Many other packages follow this convention in the ecosystem. I'm not the biggest fan of back-porting That said, I'm not on the team that owns this package, so I'll leave it to those who do to make the call. |
@codenrhoden @aybabtme 1.6 was released year ago - it's not that old release.
However, I think drawbacks for supporting 1.6 at this point are not worth it. Personally I'm very against backporting code just to make something work on older versions.
IMO, it bit hurts project structure, readability and makes project much harder to maintain over time.
2 release "rule" seems pretty reasonable to me. In that case, developer have at least half year to migrate to newer version, in case something is bit changed. In some cases migrating would not be required but it's recommended. Beside so, I don't think that migrating in case of Go is very complicated but that depends on project.
This was my 2 cents. Note if needed - I'm just contributor here, not affiliated with project in any other way.
We will see what project maintainers have to say.
|
I wrote the patch to which @codenrhoden refers. I suggest everyone take a look. It's quite simple in nature, in large part to the existing organization of this package. That said, I also argued to @codenrhoden that libStorage and REX-Ray adheres to the previous two versions of Go mentality. However, at the same time what made me reintroduce support for Go 1.6 earlier this year are the following reasons:
As I said, please take a look at the patch. I simply centralized the Context-specific code into a package that uses build tags and copied the Context interface locally. It's what I do for libStorage as well as other platform packages such as GoIsilon, GoScaleIO, etc. I know plenty of other packages do this as well. It's one of the beautiful benefits of Go interfaces :) |
Hi all, I also just noticed that this project's
I've updated my PR to also build against Go 1.6.3 (with an allowed failure). I suggest updating the build to explicitly specify Go 1.7.5 as well. |
Hi all, One last thing. The PR just successfully built and tested with Go 1.6.3 :) |
Hi @xmudrii, I agree that 1.6 isn't that old. It was released a year ago last month and 1.7 was released last August. To your following concerns:
Nothing has been backported.
Thanks to the flat, simple structure of the Most of all, this PR was labelled a breaking change due to the use of Thank you! |
This adds
context.Context
to all the API calls. This allows us to insert thectx
in thehttp.Request.Context()
, so that calls can be traced and cancelled and so on.This is a breaking change.