Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
interfaces: ensure that legacy interface methods are unused #3284
+201
−8
Conversation
zyga
added some commits
Apr 6, 2017
stolowski
approved these changes
May 9, 2017
That's super-useful to have, thank you! One minor nitpick, please address before merging. Approving right away.
| + bogus := true | ||
| + for _, definer := range allGoodDefiners { | ||
| + if reflect.TypeOf(iface).Implements(definer) { | ||
| + bogus = false |
zyga
added some commits
May 9, 2017
zyga
referenced this pull request
May 9, 2017
Merged
interfaces: API additions for interface hooks #3119
mvo5
merged commit 5ced19c
into
snapcore:master
May 10, 2017
7 checks passed
artful-amd64
autopkgtest finished (success)
Details
continuous-integration/travis-ci/pr
The Travis CI build passed
Details
xenial-amd64
autopkgtest finished (success)
Details
xenial-i386
autopkgtest finished (success)
Details
xenial-ppc64el
autopkgtest finished (success)
Details
yakkety-amd64
autopkgtest finished (success)
Details
zesty-amd64
autopkgtest finished (success)
Details
zyga
deleted the
zyga:feature/no-funny-interfaces
branch
May 10, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
zyga commentedMay 9, 2017
The snapd tree has seen several iteration of the interface code. Each
iteration brought changes to how interfaces are written. Up until now
interfaces were strongly typed, with each interface method being defined
in the Interface go interface. For a few months though they became
loosely typed as each security back-end detects and uses a subset of
methods that are specific to itself.
As another change is approaching, the interface methods will change
again. The way some of the unit tests are written may allow tests to
pass as the existing method are tested. At runtime those methods would
not be used though, and this is certainly undesired.
To avoid potential issues this patch adds a new unit test that looks at
all the known interfaces and makes sure that none of them define any of
the unused methods. This way each API transition can be accompanied by a
simple test extension. This should ensure that no merged pull request
(especially an older one) accidentally brings stale APIs into the tree.
Signed-off-by: Zygmunt Krynicki zygmunt.krynicki@canonical.com