repo: use PlugInfo and SlotInfo for permanent plugs/slots #4120

Merged
merged 6 commits into from Nov 14, 2017

Conversation

Projects
None yet
4 participants
Contributor

stolowski commented Nov 2, 2017

This is part of the changes outlined in the forum here: https://forum.snapcraft.io/t/preparing-the-interfaces-logic-for-connection-hooks/2184 (item no. 7). With this change all permanent plugs and slots method take PlugInfo and SlotInfo instead of Plug and Slot (which are going to be phased out as part of refactoring of interfaces code, a few more PRs will follow).

stolowski added some commits Oct 12, 2017

codecov-io commented Nov 2, 2017

Codecov Report

❗️ No coverage uploaded for pull request base (master@0dbad11). Click here to learn what that means.
The diff coverage is 68.14%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #4120   +/-   ##
=========================================
  Coverage          ?   75.72%           
=========================================
  Files             ?      437           
  Lines             ?    37867           
  Branches          ?        0           
=========================================
  Hits              ?    28674           
  Misses            ?     7192           
  Partials          ?     2001
Impacted Files Coverage Δ
interfaces/core.go 97.43% <ø> (ø)
interfaces/ifacetest/spec.go 5.88% <0%> (ø)
interfaces/builtin/bool_file.go 56.66% <0%> (ø)
interfaces/ifacetest/testiface.go 20.31% <0%> (ø)
interfaces/builtin/common.go 63.15% <0%> (ø)
interfaces/builtin/location_control.go 48.48% <0%> (ø)
interfaces/builtin/ubuntu_download_manager.go 31.25% <0%> (ø)
interfaces/builtin/location_observe.go 48.48% <0%> (ø)
interfaces/mount/spec.go 89.74% <100%> (ø)
interfaces/builtin/mir.go 80.55% <100%> (ø)
... and 28 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0dbad11...97d54dc. Read the comment docs.

zyga approved these changes Nov 2, 2017

LGTM

The bug in the ofono interface is something that needs to be fixed in 2.29. I'll propose a PR for that.

}
type snippetDefiner4 interface {
- PermanentSlotSnippet(slot *interfaces.Slot, sec interfaces.SecuritySystem) error
+ PermanentSlotSnippet(slot *snap.SlotInfo, sec interfaces.SecuritySystem) error
}
@zyga

zyga Nov 2, 2017

Contributor

All the changes above are ok. Can you add a test that checks we are not merging any new interfaces with the old signature methods please?

@zyga

zyga Nov 2, 2017

Contributor

On second thought #4124 ensures this directly so please just merge it here after it lands in master.

interfaces/builtin/ofono.go
spec.AddSnippet(ofonoPermanentSlotAppArmor)
return nil
}
-func (iface *ofonoInterface) DBusPermanentSlot(spec *dbus.Specification, plug *interfaces.Plug, slot *interfaces.Slot) error {
@zyga

zyga Nov 2, 2017

Contributor

Whoops, did this never work before!?
Perhaps we need a test that ensures that all of the known functions have the expected signatures.

@zyga

zyga Nov 2, 2017

Contributor

This is now addressed in #4124

Contributor

zyga commented Nov 2, 2017

Please land #4124 before merging this one.

@stolowski stolowski requested a review from niemeyer Nov 8, 2017

zyga added some commits Nov 10, 2017

Merge branch 'master' of github.com:snapcore/snapd into permanent-use…
…-plugslotinfo

I resolved all the conflicts related to plug/slot vs plugInfo slotInfo
that were caused by the recent merge of udev hook tagging.

mvo5 approved these changes Nov 14, 2017

This looks good (and quite mechanical). If this is the agreed direction we should land this to avoid conflicts (as it touches a lot of files).

@mvo5 mvo5 merged commit bec84ae into snapcore:master Nov 14, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@niemeyer niemeyer removed their request for review Nov 14, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment