snapcraft promote shows wrong version number

Bug #2024955 reported by Heinrich Schuchardt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
snapcraft (Ubuntu)
New
Undecided
Unassigned

Bug Description

I have uploaded version 4.10 of the sispmctl snap to the beta channel:

$ snap info sispmctl
...
snap-id: vldmxZW5Qjy6JEkA9ooEHXYIUO5gPJRJ
tracking: latest/beta
refresh-date: today at 11:26 CEST
channels:
  latest/stable: 4.9 2022-04-13 (3) 118kB -
  latest/candidate: ↑
  latest/beta: 4.10 2023-06-24 (9) 102kB -
  latest/edge: 4.9 2022-04-05 (3) 118kB -
installed: 4.10 (9) 102kB -

When trying to promote to the edge channel the version number is displayed as 4.1.

$ snapcraft promote --from-channel beta --to-channel edge sispmctl
snapcraft promote does not have a stable CLI interface. Use with caution in scripts.
Build set information for 'beta'
Arch Revision Version
amd64 9 4.1
arm64 8 4.1
armhf 7 4.1
riscv64 10 4.1
Do you want to promote the current set to the 'edge' channel? [y/N]:

Please, do not truncate version numbers.

Revision history for this message
Heinrich Schuchardt (xypron) wrote :

$ snap info snapcraft
installed: 7.4.3 (9362) 60MB classic

Revision history for this message
Callahan Kovacs (mr-cal) wrote :

If you have `version: 4.10` in your snapcraft.yaml, it is treated as a number by yaml and will be simplified to `4.1`.

If you have `version: "4.10"` (note the quotes), it will be treated as a string and not be modified.

If that is not your problem, then can you share your snapcraft.yaml?

Revision history for this message
Heinrich Schuchardt (xypron) wrote :

Dear Callahan,

thanks for looking into my problem.

The problem is specific to the promote subcommand. snap info sispmctl displays the version number as 4.10.

https://snapcraft.io/docs/snapcraft-yaml-reference defines that the field version is always a string and never a number.

My snapcraft.yaml has:
version: '4.10'
This is exactly the format that is suggested by the snapcraft.yaml reference for a version number.

The source code of the sispmctl snap is available at
https://sourceforge.net/p/sispmctl/git/

When I load my snapcraft.yaml using Pythons yaml.safe_load() I get a property version which is a string '4.10' and not a number.

Best regards

Heinrich

Revision history for this message
Heinrich Schuchardt (xypron) wrote :

The version number displayed by the promote sub-command is not taken from the snapcraft.yaml but from the snapstore using snap_status.get_channel_set(parsed_from_channel) and that store uses the value 4.10 and not 4.1.

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.