Totally misleading error on non-string version

Bug #1815812 reported by Facundo Batista
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Snapcraft
Fix Released
Low
Facundo Batista

Bug Description

I had this in my snapcraft.yaml:

    version: 8.1

the error it gave me was:

Issues while validating snapcraft.yaml: The 'version' property does not match the required schema: 8.1 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.

However, my 8.1 totally matched what was described there!!!

Turns out (I guess) that the problem was that it was a number, I changed it to

    version: "8.1"

and it seems to work ok now.

So, snapcraft should first check if it's a string or not, and error out with something like "The 'version' property needs to be a string, found a float".

Changed in snapcraft:
assignee: nobody → Facundo Batista (facundo)
status: New → In Progress
Revision history for this message
Sergio Schvezov (sergiusens) wrote :
Changed in snapcraft:
milestone: none → 3.3
importance: Undecided → Low
summary: - Totally misleading error on 8.1 version
+ Totally misleading error on non-string version
Changed in snapcraft:
status: In Progress → Fix Committed
Changed in snapcraft:
status: Fix Committed → Fix Released
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.