I’m trying to understand the channel information as returned by snapd to help document it and make an appropriate API in snapd-glib.
If I do a GET /v2/find?q=moon-buggy
I get the following (unrelated fields omitted):
{
"channel": "beta", // Is this deprecated for channels["latest/stable"].channel?
"channels": {
"latest/stable": {
"revision": "12",
"confinement": "strict",
"version": "1.0.51.11",
"channel": "stable", // Is this better known as "risk"?
"epoch": "0", // This is essentially an integer?
"size": 90112
}
},
"confinement": "strict", // Is this deprecated for channels["latest/stable"].confinement?
"download-size": 90112, // Is this deprecated for channels["latest/stable"].size?
"revision": "12", // Is this deprecated for channels["latest/stable"].revision?
"version": "1.0.51.11" // Is this deprecated for channels["latest/stable"].version?
}
Questions:
- Are the top-level fields
channel
/confinement
/download-size
/revision
/version
obsolete now we havechannels
? Should the snapd-glib API for this be marked as deprecated? - Is the
channel
field the risk field from https://snapcraft.io/docs/reference/channels? Would it be better exposed in the snapd-glib API as snapd_channel_get_risk()? - Is the
channel
(risk) field an enumeration, i.e. only the valuesstable
,candidate
,beta
andedge
are allowed? - For an installed snap, how do we know what channel track we are following? No fields seem to refer to “latest/stable”? What happens if we have “latest/stable” and “xenial/stable”?
- The epoch is passed as a string but the validation code suggests only integer values are allowed. Should I expose it as a string or any integer in the snapd-glib API?
Bonus question:
Why does moon-buggy show the channel as beta
when then there is no channel that provides beta…