"version: 0.2" returns confusing error message (trunk)

Bug #1813925 reported by Gerry Boland
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
New
Undecided
Unassigned

Bug Description

I'm using snapcraft trunk. Since https://github.com/snapcore/snapcraft/pull/2334 landed, my old snapcraft files cause this error:

Issues while validating snapcraft.yaml: The 'version' property does not match the required schema: 2.11 is not a valid snap version string. Snap versions consist of upper- and lower-case alphanumeric characters, as well as periods, colons, plus signs, tildes, and hyphens. They cannot begin with a period, colon, plus sign, tilde, or hyphen. They cannot end with a period, colon, or hyphen.

The message appears contradictory, as "2.11" does fulfil the requirements mentioned.

It was non-obvious to figure out that

  version: 2.11

is incorrect, but

  version: "2.11"

is considered correct.

If I stumble on this, many others will, as lot of existing docs refer to the non-quoted style:

https://github.com/ubuntu-core/snapcraft-examples/blob/master/05-hello-world-combined/snapcraft.yaml
https://docs.snapcraft.io/snapcraft-yaml-reference/4276

Can the old non-quoted style be made acceptable again? Just to keep backward compatibility?

At the very least, can you make the error message more suitable?

Revision history for this message
Gerry Boland (gerboland) wrote :

Note, I was testing snapcraft against older yaml files I'd made which worked before. I did not add a "base" specifier or anything

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.