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

appstreamcli validate erroneously represents deprecation warning as validation failure

Open marcusmueller opened this issue 4 years ago • 1 comments

We're using appstreamcli validate in our CI. False positives hence eat FOSS volunteer developer efficiency.

<url type="contact">mailto:[email protected]</url>

is deprecated:

In the past, mailto: URL schemas to link to email addresses were also supported for this URL type. It is recommended to not use them in new metadata, as they provide poor usability on most systems when users click on such a link and no local email client is configured.

(emphasis mine)

expected behaviour

A recommendation not to do something in a new file is certainly worth an informative output, or a warning, but not an error.

actual behaviour

$> appstreamcli validate --no-net /home/marcus/src/gnuradio/grc/scripts/freedesktop/org.gnuradio.grc.metainfo.xml || echo "returned error code"
E: org.gnuradio.grc:53: web-url-expected mailto:[email protected]

Validation failed: errors: 1
returned error code

appstreamcli fails to validate this valid file. Note that I'm not using --pedantic.

marcusmueller avatar Jun 20 '21 18:06 marcusmueller

this repo is appstream-glib, you want this one https://github.com/ximion/appstream

vchernin avatar Jan 06 '22 08:01 vchernin

This bug comes with libappstream-glib, as follows:

$ appstream-util validate-relax --nonet orig/emacs.metainfo.xml
orig/emacs.metainfo.xml: FAILED:
? tag-invalid           : <url> type invalid [unknown]
Validation of files failed
$ appstream-util validate-relax --nonet fixed/emacs.metainfo.xml
fixed/emacs.metainfo.xml: OK
$ diff {orig,fixed}/emacs.metainfo.xml 
35c35
<  <url type="contact">https://lists.gnu.org/mailman/listinfo/emacs-devel/</url>
---
>  <!-- url type="contact">https://lists.gnu.org/mailman/listinfo/emacs-devel/</url -->

$ yum whatprovides $(which appstream-util)
libappstream-glib-0.7.8-2.el7.x86_64 : Library for AppStream metadata
Repo        : @anaconda/7.9
Matched from:
Filename    : /usr/bin/appstream-util
...
$ 

This issue seems addressed since version 0.7.15, as seen in https://github.com/hughsie/appstream-glib/blob/c1b51dc28627efbe8ff0d48ecb70e45085a1a9f6/libappstream-glib/as-enums.h#L79 Too many dependencies make it difficult to build and verify on Centos 7.9.

McTrk avatar Apr 05 '23 21:04 McTrk

Too many dependencies make it difficult to build and verify on Centos 7.9.

I don't think that's an upstream issue.

hughsie avatar Apr 07 '23 08:04 hughsie

Too many dependencies make it difficult to build and verify on Centos 7.9.

I don't think that's an upstream issue.

Fair enough. Patched two files manually and rebuilt the rpm locally. No worries.

McTrk avatar Apr 08 '23 01:04 McTrk