`snap info` hides useful information (issue tracker, source code links) behind --verbose

Bug #2064651 reported by James Carroll
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
snapd
New
Undecided
Unassigned

Bug Description

When running `snap info $SNAP`, a summary of output is presented to the user, including the `Contact:` field. Historically, there used to be less fields and `Contact:` was used from everything to personal email addresses to bug trackers.

Snapd now supports additional fields, such as `issues`, `source code`, etc, which are prominently displayed on snapcraft.io/$SNAP - but not shown by default in the CLI without running `snap info --verbose`.

Is this behaviour intentional? In my opinion, these links are prominent in the Web UI for a reason and should be similarly prominent on the CLI.

I'd believe the change would be removing the verbosity check here:

https://github.com/snapcore/snapd/blob/fe6e39a2bc9d5107a329eb967caf4a2d9c843ccf/cmd/snap/cmd_info.go#L389

And updating any failing tests to compensate for the new behaviour.

Would the snap gang be happy with me proposing a PR to remove the need for `--verbose` for these fields :)?

description: updated
Revision history for this message
Nathan Teodosio (nteodosio) wrote :

From the duplicate LP:2074171:

> Note that the `source-code` attribute is part of snapcraft.yaml, not the snap metadata file (meta/snap.yaml). Those attributes are converted into `links[<string>] = []string` in the snap metadata.
>
> Those are shown when you pass --verbose:
>
> ```
> $ snap info --verbose mesa-2404
> ...
> links:
> contact:
> - https://github.com/canonical/mesa-2404/issues
> source-code:
> - https://github.com/canonical/mesa-2404
> website:
> - https://github.com/canonical/mesa-2404
> ```
>
> Anyhow, I'll mark this as duplicate of #2064651 which requested to show some of the links by default if present.

Chromium defines[1] source-code but that is nowhere to be seen in snap info, but contact and website are although they are not defined. Something is off...

--->
% snap info --verbose chromium
name: chromium
summary: Chromium web browser, open-source version of Chrome
health:
  status: unknown
  message: health has not been set
publisher: Canonical✓
store-url: https://snapcraft.io/chromium
contact: https://bugs.launchpad.net/ubuntu/+source/chromium-browser/+bugs?field.tag=snap
links:
  contact:
    - https://bugs.launchpad.net/ubuntu/+source/chromium-browser/+bugs?field.tag=snap
  website:
    - https://code.launchpad.net/~chromium-team/chromium-browser/+git/snap-from-source
license: unset
<---

[1] https://git.launchpad.net/~chromium-team/chromium-browser/+git/snap-from-source/tree/snapcraft.yaml?h=stable#n4

Revision history for this message
Maciej Borzecki (maciek-borzecki) wrote :

Ok, I see what's going on. The links provided by store override local ones. They aren't merged as it's not clear which ones are more relevant (in case ones from the snap are different than what the store has sent).

In case of mesa-2404 it's even more complicated, as the store sends a link with key `source` apparently. However, snap.yaml in mesa-2404 snap blob actually has `source-code`. So there's likely no agreement as to which key is even correct to indicate source code location. I would suggest amending the store page perhaps to point to the right location?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.