charmhub install action of refresh returns track only for effective-channel

Bug #1986547 reported by Heather Lanigan
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Snap Store Server
New
Undecided
Unassigned

Bug Description

Charms without a default channel are returning a risk only for the effective-channel with the install action of refresh. This creates an ambiguous response.

$ curl -s https://api.snapcraft.io/v2/charms/refresh -H 'Content-type: application/json' -d '{"context":[],"actions":[{"action":"install","instance-key":"4c46917e-3006-4fec-8a06-5eba393fa4cd","name":"ubuntu","channel":"stable","base":{"architecture":"amd64","name":"ubuntu","channel":"20.04"}}],"fields":["bases","config-yaml","download","id","license","metadata-yaml","name","publisher","resources","revision","summary","type","version"]}' | jq
{
  "error-list": [],
  "results": [
...
      },
      "effective-channel": "stable",
      "id": "DksXQKAQTZfsUmBAGanZAhpoS4dpmXel",
      "instance-key": "4c46917e-3006-4fec-8a06-5eba393fa4cd",
      "name": "ubuntu",
      "released-at": "2022-06-30T17:12:55.757188+00:00",
      "result": "install"
    }
  ]
}

$ curl -s https://api.snapcraft.io/v2/charms/refresh -H 'Content-type: application/json' -d '{"context":[],"actions":[{"action":"install","instance-key":"4c46917e-3006-4fec-8a06-5eba393fa4cd","name":"ubuntu","channel":"latest/stable","base":{"architecture":"amd64","name":"ubuntu","channel":"20.04"}}],"fields":["bases","config-yaml","download","id","license","metadata-yaml","name","publisher","resources","revision","summary","type","version"]}' | jq
{
  "error-list": [],
  "results": [
    {
...
      "effective-channel": "latest/stable",
      "id": "DksXQKAQTZfsUmBAGanZAhpoS4dpmXel",
      "instance-key": "4c46917e-3006-4fec-8a06-5eba393fa4cd",
      "name": "ubuntu",
      "released-at": "2022-06-30T17:12:55.757188+00:00",
      "result": "install"
    }
  ]
}

Not a problem is the charm has a default channel:

curl -s https://api.snapcraft.io/v2/charms/refresh -H 'Content-type: application/json' -d '{"context":[],"actions":[{"action":"install","instance-key":"heather-testing","name":"mysql-router","base":{"architecture":"amd64","name":"ubuntu","channel":"20.04"},"channel":"8.0"}]}' | jq
{
  "error-list": [],
  "results": [
    {
...
      "effective-channel": "8.0/stable",
      "id": "CjjVf4bSJGT6rKjg7Qk3EZteCoEhKXHh",
      "instance-key": "heather-testing",
      "name": "mysql-router",
      "released-at": "2022-08-05T19:05:33.072115+00:00",
      "result": "install"
    }
  ]
}

Tags: charmhub
Daniel Manrique (roadmr)
tags: added: charmhub
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.