It is possible to release a devel snap to candidate and stable

Bug #1619819 reported by Leo Arias
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
Invalid
Undecided
Unassigned
Software Center Agent
Fix Released
High
Unassigned

Bug Description

With snapcraft, I can release a snap with devel grade to the candidate and stable channel.
This is not possible from the website because only edge and beta appear as options.

To reproduce, write the following yaml to a file.
(replace the name to a snap registered on your account)

name: $name
version: 0.1
summary: Summary of the most simple snap
description: Description of the most simple snap
architectures: [all]
confinement: strict
grade: devel

parts:
  dummy-part:
    plugin: nil

$ snapcraft login
$ snapcraft
$ snapcraft push *.snap
This works and returns the $revision of the snap.
$ snapcraft release $name $revision stable
This works, but should fail.

Tags: store
Celso Providelo (cprov)
Changed in software-center-agent:
status: New → Fix Committed
assignee: nobody → Michael Nelson (michael.nelson)
Celso Providelo (cprov)
Changed in software-center-agent:
status: Fix Committed → Fix Released
Revision history for this message
Leo Arias (elopio) wrote :

Thanks for the fix! I tested it today, and now snapcraft prints:

Revision 11 (strict) cannot target a stable channel (stable, grade: devel)

Changed in snapcraft:
status: New → Invalid
Revision history for this message
Guillaume Beuzeboc (gbeuzeboc) wrote :

This seems to be possible again. Should I open a new ticket?

Revision history for this message
Daniel Manrique (roadmr) wrote :

No, let's just reopen this one.

Changed in software-center-agent:
assignee: Michael Nelson (michael.nelson) → nobody
status: Fix Released → Confirmed
importance: Undecided → High
Revision history for this message
Daniel Manrique (roadmr) wrote :

test_upload_not_ready_devel_grade says this should not be happening.

Revision history for this message
Guillaume Beuzeboc (gbeuzeboc) wrote :

# Very inspired from the previous message
# snapcraft.yaml
name: gb-test
version: "0.1"
summary: Summary of the most simple snap
description: Description of the most simple snap
architectures: [all]

base: core20
confinement: strict
grade: devel

parts:
  dummy-part:
    plugin: nil

$ snapcraft
$ snapcraft upload gb-test_0.1_all.snap --release stable
> Revision 1 created for 'gb-test' and released to 'stable'

Revision history for this message
Guillermo Gonzalez (verterok) wrote (last edit ):

We found that the API is not releasing the revision, but snapcraft is wrongly reporting success on release when only the upload was OK.

snapcraft code seems to be using the `processed` field in the response as a flag to mark things as successful, but that's not correct as it only marks the snap was processed.
When snapcraft polls the API, it should take other fields into account like `code` and `channels`

e.g:

upload with --release to stable using grade: devel, the status endpoint reports:

{"code": "ready_to_release", "processed": true, "can_release": true, "url": "https://dashboard.staging.snapcraft.io/snaps/hello-roadmr-1/revisions/207/", "revision": 207}

upload with --release to stable using grade: stable, status endpoint reports:

{"code": "released", "processed": true, "can_release": true, "url": "https://dashboard.staging.snapcraft.io/snaps/hello-roadmr-1/revisions/208/", "revision": 208, "channels": ["stable", "candidate", "beta"]}

I think a bug should be opened against snapcraft itself to improve the message

Changed in software-center-agent:
status: Confirmed → 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.