Background
The snap store is providing a richer framework for channels now. This allow publishers to go beyond the current 4 channels we offer and provide custom channels.
The schema for the channel name is track/risk/branch – where track and branch are optional. If track is not given “latest” is assumed (track is also called series sometimes, we need to agree on terminology here, happy to follow guidance).
The relevant bugs are: lp:1675054 (and lp:1628640).
Potential issues
snap info output
The current suggestion for the UX for the new channels is to change the output of snap info
from:
$ snap info etcd
name: etcd
channels:
stable: 3.1.5 (46) 7MB -
to
$ snap info etcd
channels:
- 2.3:
candidate: 2.3.8 (39) 5MB -
stable: 2.3.8 (22) 5MB -
This means the output will be incompatible with the previous output so we need to decide if we want to do this.
Approach The current implementation will change the output.
REST API
Related to the above is the question about the REST api. Currently we send the channel information as map[string]*ChannelSnapInfo
. We could add a new field tracks
and send a map[string]map[string]*ChannelSnapInfo
with “track” -> “channel” -> info. Alternatively we could flatten the tracks information so that it becomes “$track/$channel” and we send in the existing REST “channels” map. E.g. {channels: {"2.3/stable": {"version": "2.3.8"}, "2.3/beta": {"version":"2.3.9-beta1"}}
Approach The current implementation will use a flattened channel map to be compatible with the existing clients. In addition it will add a sorted list of track names (sorting will be the same as we get from the server). The client can then sort by tracks.
Store is not providing a channel map for existing apps
Right now the store is not sending the new channel_maps_list
for apps that don’t have custom channels (e.g. hello-world). This means we need to still build the fake channel map in the client. We need to clarify with the store if the plan is to send the map with “latest” for everyone.
Implementation
There is work in https://github.com/snapcore/snapd/pull/3141 to implement it.