-
Notifications
You must be signed in to change notification settings - Fork 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
client-go needs backwards compatibility test #234
Comments
cc @lavalamp @mbohlool @ericchiang @hongchaodeng Do you know if there is an existing tool that checks for changes in public interfaces? I couldn't find any. |
If repos were split I would instead want to solve this via requiring |
The |
I agree. An automated process makes more sense. Given that the stable API surface is smaller than all packages, I think I would pursue the idea of labeling certain packages as exported (similar to an osgi bundle). Then a tool could check
I think that identification of those cases is necessary no matter how we decide to handle such changes. @kubernetes/sig-api-machinery-misc @sttts |
👍 for the labeling idea |
An automated process can require the release note. This is how it works in the main repo. We need to duplicate this functionality for each library. If someone wants to write a tool that walks back the import tree from the perspective of each library and requires a release-note-xxx for each staging/xxx whose public interface is affected, I'm fine with that. If we stay in the main repo a single change might require a release note / changelog entry for 5 different libraries. |
Could you elaborate on what packages should be excluded from the API surface? The packages that don't have public functions/variables? @deads2k |
In this short program, changes to k8s.io/argle potentially affect the public interface of this package, but changes to k8s.io/flunder don't. (It may still require certain versions of the flunder library to compile or work correctly, of course.) |
As another example, I consider many of the util/ packages as not part of the API surface. E.g. To make that clear, we should move everything that is not part of the API surface to pkg/. And IMO we should be very strict about what we leave in the API. |
@caesarxuchao Go has some internal tooling used to track the standard library API https://github.com/golang/go/tree/master/api I whipped up some tooling that mimics that, maybe that'd be a good place to start? https://github.com/ericchiang/gopkgapi edit: here's an example document for k8s.io/client-go/rest https://gist.github.com/ericchiang/5667fdab28a8d6c01d0a656fad34f88c |
This issue turned out to be bigger than client-go. @lavalamp opened up kubernetes/test-infra#3415. I'll keep this issue open until kubernetes/test-infra#3415 has an owner. Thanks @ericchiang. That's a good start. I'll mention it in kubernetes/test-infra#3415. |
I do not agree that we can make things not part of the public interface by putting them under pkg/. We can use go's |
@lavalamp technically this is true. But nothing stops us from declaring conventions. It's more about pragmatism in the light of Golang's limited visibility features and our bad history of maintaining any kind of compatibility. I would pretty much prefer to have a limited set of packages declared stable and maintained stable than going the extreme way considering every small bit of code as stable and increasing the major version on every release. |
The deliverable here is, when do users have to change their code to upgrade? We cannot stop them from referencing items in /pkg, therefore if we don't increment the major version number on changes there we are basically falsely claiming that their code needn't change, and they will be in for an unpleasant surprise. (I am a consequentialist, so the fact that it would be their own damn fault doesn't move me at all--it certainly wouldn't stop them from filing support issues.) We can either put such code in TL;DR: the problem isn't the frequency with which we increment the version number. The problem is the frequency at which folks have to change their code on upgrades. |
cc @jennybuckley @roycaihw who might be interested in expanding the tool Eric built. |
Issues go stale after 90d of inactivity. Prevent issues from auto-closing with an If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or |
/lifecycle frozen |
/remove-help |
/remove-lifecycle stale |
I'm working on a tool to check Go APIs compatibility. It still lacks some important features, such as saving the API data at a given point for later comparison, it currently compares two git references, but I'll be working on expanding this. If this looks like something useful to you, I'll be glad to receive feedback about your use case: |
https://github.com/golang/exp/blob/master/apidiff might be a possibility as well |
sample verify script with API package compatibility checks here: https://github.com/liggitt/kubernetes/commits/apidiff-master comparison of master against 1.14 and 1.15:
|
Client-go needs backwards compatibility test, i.e, checking if a PR changes the public interfaces of client-go. The benefits are:
The backwards compatibility test is useful no matter if we develop client-go in the kubernetes repo or in this repo.
Special requirements:
Action items:
The text was updated successfully, but these errors were encountered: