Merge lp://qastaging/~mvo/snappy/unexport-more into lp://qastaging/~snappy-dev/snappy/snappy-moved-to-github

Proposed by Michael Vogt
Status: Work in progress
Proposed branch: lp://qastaging/~mvo/snappy/unexport-more
Merge into: lp://qastaging/~snappy-dev/snappy/snappy-moved-to-github
Diff against target: 1041 lines (+162/-157)
11 files modified
cmd/snappy-go/cmd_booted.go (+1/-6)
cmd/snappy-go/cmd_info.go (+1/-1)
snappy/click_test.go (+3/-3)
snappy/config.go (+1/-1)
snappy/helpers.go (+1/-1)
snappy/helpers_test.go (+1/-1)
snappy/parts.go (+10/-10)
snappy/snapp.go (+67/-67)
snappy/snapp_test.go (+11/-11)
snappy/systemimage.go (+58/-48)
snappy/systemimage_test.go (+8/-8)
To merge this branch: bzr merge lp://qastaging/~mvo/snappy/unexport-more
Reviewer Review Type Date Requested Status
Sergio Schvezov Needs Information
Review via email: mp+249793@code.qastaging.launchpad.net

Commit message

unexport implementation details for snap repositories and snap types

Description of the change

This branch unexports more implementation details inside snappy/. The
different repository and snap implementations are hidden. The exported
API for this is the "Part" interface and the "MetaRepository" plus
the various query helpers (like ActiveSnapByName).

If that turns out to be not sufficient we can export more API, but I
would like to provide only a minimal version for now so that we can
change the way we handle the repositories internally easily.

To post a comment you must log in.
Revision history for this message
Sergio Schvezov (sergiusens) wrote :

I'm all for this, but not sure how this impacts the webdm work; can MetaRepository be setup to only search locally?

In the case of implementing "Ports" for installed packages we'd need to infer the real Part to be able to call it's .Ports() receiver (which is not written yet); will this still work?

review: Needs Information
Revision history for this message
Sergio Schvezov (sergiusens) wrote :

or maybe .Ports could be part of the generic interface and if it's in the store one day, it's all good and calling it for the system just panics.

Revision history for this message
Michael Vogt (mvo) wrote :

What kind of search do you need in the MetaRepository for local snaps? Is there a "search local snaps" feature in webdm? I guess we can simply extend Search() to Search(flags int) and add snapp.LocalOnly or something to the flags. Is there a list of use-cases or mockups for webdm to get a feel what kind of api it needs?

Revision history for this message
Sergio Schvezov (sergiusens) wrote :

> What kind of search do you need in the MetaRepository for local snaps? Is
> there a "search local snaps" feature in webdm? I guess we can simply extend
> Search() to Search(flags int) and add snapp.LocalOnly or something to the
> flags. Is there a list of use-cases or mockups for webdm to get a feel what
> kind of api it needs?

I might have confused the webdm proposed api (https://gist.github.com/sergiusens/15949095c52a83a46c6b) with what is here; but the idea is that it is easier on the javascript side if a default package listing returns a consolidated view of what is on the store and locally; when filtering is done (aka search), it would do the same.

This doesn't need to be done on the snappy api side; it's a presentation layer issue, it just needs to be doable in some way.

I'm only worried that if important types are unexported I won't be able to do

if localSnap, ok := metaSnap.(*LocalSnap); ok {
    localSnap.Ports()
}

but if .Ports() becomes a generic interface it's all fine.

Also, I'm being lazy here, I could as well read the full code as I wasn't involved in this refactor and don't have it in my groins yet (hence the Needs Information).

179. By Michael Vogt

merged lp:snappy and resolve conflicts

Revision history for this message
Michael Vogt (mvo) wrote :

I set this back to WIP, I would love to get it merge still, but I don't know enough yet about webdm and its needs. I certainly hope we export all interfaces that are useful and would love to hide implementation details like that ubuntu-core is a special snap.

Unmerged revisions

179. By Michael Vogt

merged lp:snappy and resolve conflicts

178. By Michael Vogt

unexport implementation details of repositories and individual snap types. MetaRepository and the Part interface are the only exported API (for now)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches