-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Minimize API surface in anticipation of gorelease #1146
Conversation
163813b
to
d788dcf
Compare
I'm extremely supportive of this change. Thank you for taking the initiative |
I am basically ok with this. Some tests are failing. I'll try to review this some time this week. Poke me using some out-of-band channel if I forget about it. |
9e8cc3c
to
44ae41b
Compare
This is necessary as part of adding gorelease to our CI. These packages could otherwise be considered part of our public API. This will break users who are importing these examples in their own projects.
This helps remove public API surface
This reduces our API surface
a8ef22f
to
7e41527
Compare
Codecov Report
@@ Coverage Diff @@
## master #1146 +/- ##
==========================================
- Coverage 53.78% 53.74% -0.05%
==========================================
Files 42 42
Lines 4211 4211
==========================================
- Hits 2265 2263 -2
- Misses 1698 1701 +3
+ Partials 248 247 -1
Continue to review full report at Codecov.
|
There seems to be a consensus that we should try this and see if it angers any users. Here goes! |
why did not this is why I agree with the reason of doing this (reducing the public API), but it should change major version and thus import path when doing it |
see https://blog.golang.org/v2-go-modules and https://github.com/golang/go/wiki/Modules - modules should be backwards compatible or change import path I realize this is why this PR exists in the first place (to be able to track breaking changes), but it is still a massive breaking change in itself :( |
@johanbrandhorst hey sorry for the little confrontational tone at first, it was a bit angry at first :) but makes sense, and it's not that popular import so I get it anyway I made an issue |
* Move examples under internal to avoid importing This is necessary as part of adding gorelease to our CI. These packages could otherwise be considered part of our public API. This will break users who are importing these examples in their own projects. * Rename imports and regenerate files * Make generator internals private This helps remove public API surface * Move codegenerator package to internal This reduces our API surface
* Move examples under internal to avoid importing This is necessary as part of adding gorelease to our CI. These packages could otherwise be considered part of our public API. This will break users who are importing these examples in their own projects. * Rename imports and regenerate files * Make generator internals private This helps remove public API surface * Move codegenerator package to internal This reduces our API surface
The grpc-gateway was created long before things like go modules semver and with little concern for internal package management. This unfortunately means that technically the API surface is enormous, however most of these packages are not really considered part of the public API.
This change moves everything that isn't part of the public API under various
internal
folder structures. This is obviously technically a breaking change, but I'm hoping we can get away with saying that our users really shouldn't have been importing these things anyway if any of them have been. I'm happy to discuss any concerns.The end goal of this migration is to be able to use https://godoc.org/golang.org/x/exp/cmd/gorelease to ensure API stability across minor patches. The current structure prohibits this (because we make breaking changes to the examples all the time).
CC @achew22 @tmc @ivucica