codemeta / codemeta-generator

This repository contains a (client-side) web application to generate Codemeta documents (aka. codemeta.json).
https://codemeta.github.io/codemeta-generator/
GNU Affero General Public License v3.0
8 stars 5 forks source link

General bug when filling SEVERAL input area #56

Open Slookeur opened 4 weeks ago

Slookeur commented 4 weeks ago

Hello, I noticed some issues when creating the Json file for my program, the generator does not handle properly some information in a input area, I first noticed the issue when I was trying to fill the "Other software requirements" area:

For example the input:

libgtk+3.0 or ligtk4: https://www.gtk.org libepoxy: https://github.com/anholt/libepoxy libglu (Linux only): https://gitlab.freedesktop.org/mesa/glu libpangoft2: https://docs.gtk.org/PangoFT2 libxml-2.0: https://github.com/GNOME/libxml2 libavutil: https://www.ffmpeg.org libavodec: https://www.ffmpeg.org libavformat: https://www.ffmpeg.org libswscale: https://www.ffmpeg.org

Will be transformed in:

    "softwareRequirements": [
        "libgtk+3.0 or ligtk4: https://www.gtk.org",
        " https://github.com/anholt/libepoxy",
        "libglu (Linux only): https://gitlab.freedesktop.org/mesa/glu",
        " https://docs.gtk.org/PangoFT2",
        " https://github.com/GNOME/libxml2",
        " https://www.ffmpeg.org",
        " https://www.ffmpeg.org",
        " https://www.ffmpeg.org",
        " https://www.ffmpeg.org"
    ],

And for some reason a lot of information is lost, this happens for several other input area (ex: description) and need to be fixed. I noticed that It does not happen for the "Release notes" area that behaves as expected.

Regards.

Sébastien Le Roux

progval commented 4 weeks ago

It's because this field accepts both a list of URIs and plain text, and libswscale: is interpreted as the beginning of URI except it's invalid so it gets stripped out somehow.

I can't reproduce this issue in the description though. Do you have an example?

Slookeur commented 4 weeks ago

Hi, and thanks for the quick reply. Well somehow I am not able to reproduce the issue in the "Description" anymore, not sure what I did back then, I might have misread something, sorry, the way the description is printed out in the Json file is not really convenient to read as is (single line) ... so my bad I guess.

S.

progval commented 4 weeks ago

@Slookeur I have a fix, but I'm afraid you aren't going to like it.

I almost had the code to fix the libepoxy: part being stripped, and when I realized that Codemeta actually requires this field to contain only URIs.

So instead I am going to make generator enforce this restriction: https://github.com/codemeta/codemeta-generator/pull/57

In your case it shouldn't be too hard to fix as you already have URIs for most projects; you'll just need to find most specific ones for the projects under ffmpeg.

Slookeur commented 4 weeks ago

Good that I am not supposed to like it :-) Note the text in grey that appears when the area is empty is:

Python 3.4
https://github.com/psf/requests

And there you have both standard text and URL, so I figured I could used both, and I tried, and it failed ... You might want to correct this message as well to make the rule clear and avoid future disagreements :-)

Again thank you !

progval commented 4 weeks ago

Yeah I'm going to fix it too