snapcraft validate does not work with snaps in stores other than Global

Bug #1902913 reported by Natalia Bidart
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
Fix Released
High
Sergio Schvezov

Bug Description

A customer is trying to issue a validation assertion using snapcraft, and one of the snaps being added as gated snap is not available in public searches.

So when running, for example, the following command:

nessita@dali:~$ snapcraft validate nessita-gating snapd=1255 caracalla-kernel=136 --key-name=validations-test
Getting details for snapd
Signing validations assertion for snapd=1255
Getting details for caracalla-kernel
Snap 'caracalla-kernel' was not found.

Recommended resolution:
Ensure you have proper access rights for 'caracalla-kernel'.

I can't issue the validation though my account does have access to that snap.

Revision history for this message
Natalia Bidart (nataliabidart) wrote :

After reviewing the snapcraft code, I believe this is a bug in the implementation of:

     71 def get_info(self, snap_name: str, *, arch: str = None) -> SnapInfo:

This method is used to get the snap IDs for the given gated snap name, but it does not support getting information for snaps in stores other than Global (this bug report) and it also does not support getting info for snaps that were never released to stable (see LP: #1775658).

What I believe would a simple and doable fix is to allow the user to pass explicitly the snap IDs in the validate call so snapcraft does not need to search for the snap ID.

summary: - snapcraft validate does not work with non public snaps
+ snapcraft validate does not work with snaps in stores other than Global
Revision history for this message
Sergio Schvezov (sergiusens) wrote :
Changed in snapcraft:
status: New → In Progress
importance: Undecided → High
assignee: nobody → Sergio Schvezov (sergiusens)
Changed in snapcraft:
status: In Progress → Fix Committed
Revision history for this message
Sergio Schvezov (sergiusens) wrote :

Released in 4.4.1

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.