Serve snap.yaml description in find/info responses#6
Open
cyberb wants to merge 1 commit into
Open
Conversation
The cache already parsed the snap.yaml description into App, but App.ToInfo dropped it and the Snap model had no description field, so snapd's /v2/find and /v2/snaps/info responses carried an empty description. The platform app page (and App Center) therefore showed no description for not-yet-installed apps, while installed apps - sourced from snapd's local /v2/snaps - did. Add description to the Snap model and populate it from App.ToInfo so the store relays the published snap.yaml description, which is the intended source now that apps no longer rely on the index-v2 catalog. Assert it end to end: store /v2/snaps/info and snapd-relayed /v2/find both carry the fixture snap.yaml description.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Apps opened from the platform's App Center (not yet installed) show no description, while installed apps do. Root cause is in the store: snapd's
/v2/findand/v2/snaps/inforesponses carry an emptydescription.Root cause
The cache already parses
descriptionfrom each app'ssnap.yamlintomodel.App(fetchAppMetadata). But:model.Snap(the snapd-facing search/info result) had nodescriptionfield, andApp.ToInfo()copiedSummarybut droppedDescription.So the description never reached snapd. snapd itself already relays
description(itsstoreSnapreadsjson:"description"), which is why the platform sees the field present but empty.Fix
Description(json:"description") tomodel.Snap.App.ToInfo().This makes the store serve the published
snap.yamldescription — the intended source now that apps no longer rely on theindex-v2catalog.Tests
model.App.ToInfounit test asserts summary + description pass through.TestRest_SnapsInfo: store/v2/snaps/infobody contains the fixture description.TestFind: snapd-relayed/v2/findcontains the fixture description.