appstream-glib icon indicating copy to clipboard operation
appstream-glib copied to clipboard

Confusing “release required” error

Open jtojnar opened this issue 5 years ago • 9 comments

Running appstream-util validate --nonet on https://gitlab.gnome.org/GNOME/buoh/-/blob/7f31a7722b2b1e6fc95c548459cdca033225b59c/data/org.gnome.buoh.appdata.xml.in complains:

• tag-missing           : <release> required

but the <release> tags are there.

jtojnar avatar Jul 13 '20 23:07 jtojnar

<releases> is the parent for <release> -- i.e. it's not a valid file.

hughsie avatar Jul 18 '20 11:07 hughsie

Yes, I discovered that later. The issue is that the error message is not really useful for determining that.

jtojnar avatar Jul 18 '20 11:07 jtojnar

Pull request welcome dude.

hughsie avatar Jul 18 '20 12:07 hughsie

Look like the validator does not work with the XML DOM but AsApp object:

https://github.com/hughsie/appstream-glib/blob/0306be0e508364eb7672bf9ba0d2d8541a4517e4/libappstream-glib/as-app-validate.c#L957-L963

Not sure how to do that nicely, other than adding a releases_present boolean field to AsAppPrivate and enabling it in the parser when releases is encountered:

https://github.com/hughsie/appstream-glib/blob/2733e9c2813f29a09ac5c57939475b74ac095894/libappstream-glib/as-app.c#L5759-L5768

jtojnar avatar Jul 18 '20 12:07 jtojnar

other than adding a releases_present boolean field to AsAppPrivate

I think that's probably fine, thanks.

hughsie avatar Jul 18 '20 12:07 hughsie

Looking into it more, maybe the problems field would be more suitable.

jtojnar avatar Jul 18 '20 18:07 jtojnar

I'm having this issue, except I don't have any <releases> nor <release> tags at all. From what I can tell they should be optional: https://www.freedesktop.org/software/appstream/docs/chap-Quickstart.html#qsr-app-contents-suggestions

What gives?

Here's the XML: https://github.com/Newbytee/mirage/blob/eb35114670699f7f1e29d22a8ff4106a6a361861/packaging/mirage.appdata.xml

Newbytee avatar Mar 31 '21 07:03 Newbytee

Maybe use validate-relax? Release notes are kinda important...

hughsie avatar Mar 31 '21 08:03 hughsie

Related to #457 perhaps?

I think it is odd that it checks for <url> and <releases> on the same level, as the specification separate those two under "recommended" and "suggested":

https://www.freedesktop.org/software/appstream/docs/chap-Quickstart.html

CendioOssman avatar Feb 01 '23 13:02 CendioOssman