Add 'snap info' command showing publisher, channel map

Bug #1628640 reported by Mark Shuttleworth
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snappy
Fix Released
Undecided
John Lenton
Software Center Agent
Fix Released
Undecided
Facundo Batista

Bug Description

Please add a new command, 'snap info <snap> [<snap> [...]]'

This should show:

 * the publisher of the snap
 * the channel map (revision you would get if you switched there)
 * any other relevant info for that snap

For example

  $ snap info hello-world etcd
  hello-world:
    publisher: canonical
    channels:
      - stable: 3.2 (58)
      - candidate: 3.2 (71)
      - beta: closed
      - edge: 3.3-daily (98)
  etcd:
    publisher: coreos
    ...

Revision history for this message
John Lenton (chipaca) wrote :

if the snap is installed, I'd like "snap info" to tell me the channel it's tracking, as well as a more verbose version of the 'notes'. I guess this could fall under "relevant info for that snap"

and if I do `snap info ./foo_1.snap`? should that work?

Revision history for this message
Mark Shuttleworth (sabdfl) wrote : Re: [Bug 1628640] Re: Add 'snap info' command showing publisher, channel map

On 28/09/16 21:18, John Lenton wrote:
> if the snap is installed, I'd like "snap info" to tell me the channel
> it's tracking, as well as a more verbose version of the 'notes'. I guess
> this could fall under "relevant info for that snap"

Yes please :)

> and if I do `snap info ./foo_1.snap`? should that work?

Great idea!

Mark

Changed in software-center-agent:
status: New → Triaged
assignee: nobody → Facundo Batista (facundo)
Revision history for this message
John Lenton (chipaca) wrote :

Facu, will your work only be on SCA or does it also reach CPI? Asking because snap doesn't talk to SCA (snapcraft does), just to CPI.

Revision history for this message
Facundo Batista (facundo) wrote :

John, my work will include changes in SCA and also in CPI, to fulfill the needs of this issue (and it's part of a big Channel 2.0 refactor I'm in charge with).

Revision history for this message
John Lenton (chipaca) wrote :

Excellent, thanks!

Changed in snappy:
status: New → In Progress
assignee: nobody → John Lenton (chipaca)
Revision history for this message
Michael Vogt (mvo) wrote :

This has landed in snapd 2.18

Changed in snappy:
status: In Progress → Fix Released
Revision history for this message
Facundo Batista (facundo) wrote :

Mark, question: why channel beta should present "closed" there?

From the end user POV, beta channel just has the same version/revision than candidate. Furthermore, if she does "snap install hello-world --beta", it will be installing v3.2 (revision 71).

If that is the case, shouldn't just say "beta: 3.2 (71)"? Aren't we otherwise leaking the concept of "tracking" from the developer to the end user?

Thanks!

Revision history for this message
Mark Shuttleworth (sabdfl) wrote :

On 05/01/17 18:39, Facundo Batista wrote:
> If that is the case, shouldn't just say "beta: 3.2 (71)"? Aren't we
> otherwise leaking the concept of "tracking" from the developer to the
> end user?

It's useful as an end-user to know if there is actually a beta in
progress or not. So please do show it as closed, explicitly, if its closed.

Mark

Revision history for this message
Facundo Batista (facundo) wrote :

John, from the Store part, we'll add a "channel_maps" field in the /details response, with the list of channel maps, being the first of that list the map for "latest".

Each map will be also a list, with each channel (in proper order) and their usual info: revision, confinement, version, epoch and binary_filesize, if "info" in "specific". Note that those fields won't be included if "info" in "none" (that channel doesn't have a specific revision released to it) or "tracking" (channel has nothing released but is tracking an upper channel).

Revision history for this message
Facundo Batista (facundo) wrote :

John, this is done now, but it's not "active" unless you ask for the channel_maps_list as a field when hitting the /details endpoint (if you don't ask for this info, it just will behave as before, so there's no compatibilities concern).

Example when asking for this field:

$ curl -H 'x-ubuntu-series: 16' -H 'x-ubuntu-architecture: amd64' https://search.apps.ubuntu.com/api/v1/snaps/details/foobar40?fields=name,revision,channel_maps_list | jq .

{
  "name": "foobar40.testuser",
  "package_name": "foobar40",
  "_links": {
    "curies": [
      {
        "href": "https://wiki.ubuntu.com/AppStore/Interfaces/ClickPackageIndex#reltype_{rel}",
        "name": "clickindex",
        "templated": true
      }
    ],
    "self": {
      "href": "https://search.apps.ubuntu.com/api/v1/snaps/details/foobar40?fields=name,revision,channel_maps_list"
    }
  },
  "channel_maps_list": [
    {
      "track": "latest",
      "map": [
        {
          "info": "released",
          "binary_filesize": 8192,
          "vesion": "4.1",
          "epoch": "0",
          "confinement": "strict",
          "channel": "stable",
          "revision": 2
        },
        {
          "info": null,
          "channel": "candidate"
        },
        {
          "info": "released",
          "binary_filesize": 8192,
          "vesion": "4.1",
          "epoch": "0",
          "confinement": "strict",
          "channel": "beta",
          "revision": 2
        },
        {
          "info": "released",
          "binary_filesize": 8192,
          "vesion": "4.0",
          "epoch": "0",
          "confinement": "strict",
          "channel": "edge",
          "revision": 1
        },
        {
          "info": "branch",
          "binary_filesize": 8192,
          "vesion": "4.1",
          "epoch": "0",
          "confinement": "strict",
          "channel": "stable/hotfix-2",
          "revision": 2
        }
      ]
    },
    {
      "track": "3.14",
      "map": [
        {
          "info": "released",
          "binary_filesize": 8192,
          "vesion": "4.0",
          "epoch": "0",
          "confinement": "strict",
          "channel": "3.14/stable",
          "revision": 1
        },
        {
          "info": null,
          "channel": "3.14/candidate"
        },
        {
          "info": null,
          "channel": "3.14/beta"
        },
        {
          "info": null,
          "channel": "3.14/edge"
        }
      ]
    }
  ],
  "revision": 2
}

Changed in software-center-agent:
status: Triaged → Fix Released
Revision history for this message
Daniel Manrique (roadmr) wrote :

Apologies, we've identified a typo in the channel_maps_list which needs to be fixed before this can be used by clients (or else we'll carry the typo into eternity). Setting to "In progress" on SCA side.

Changed in software-center-agent:
status: Fix Released → In Progress
Revision history for this message
Daniel Manrique (roadmr) wrote :

The typo has been fixed and channel_maps_list is now usable.

Changed in software-center-agent:
status: In Progress → Fix Released
Revision history for this message
Daniel Manrique (roadmr) wrote :

https://bugs.launchpad.net/snappy/+bug/1675054 covers the remaining work to show the detailed channel map with track information.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.