mesonwrap icon indicating copy to clipboard operation
mesonwrap copied to clipboard

Descriptive text for wraps

Open jpakkane opened this issue 5 years ago • 10 comments

I got a feedback comment that the project pages on wrapdb are a bit spartan. Perhaps a description could be added to each package. It does not have to be long just a sentence or two. So for example Lame could be described as "An MP3 sound file encoder and decoder."

jpakkane avatar Jun 07 '20 15:06 jpakkane

Sounds like a good idea, @jpakkane do you mean this page: https://wrapdb.mesonbuild.com/catch?

legeana avatar Jun 07 '20 16:06 legeana

Generally a project description is a global thing that probably belongs to the master branch and can be sourced from there. We already have a mechanism to ignore certain files such as readme.txt so we can either introduce a new file with a description or reuse readme.txt. A separate file with a bunch of metainformation might be quite nice, I am thinking a metadata.ini file with some fields that can be filled on the repo creation. I already fill in upstream URL, but this is a github only thing, we can also have it stored in git to make git repos more self sufficient.

legeana avatar Jun 07 '20 16:06 legeana

That page is exactly what I was thinking of, but if we ever redesign the landing page, they might also be printed on that.

jpakkane avatar Jun 07 '20 16:06 jpakkane

Sounds good, this is more of a UX than a data problem though, so we can do that separately. So my idea is, we can introduce a metadata.ini which will have a description. Other potential uses of this file can be ACLs for the project maintainers, I imagine in the future we will want to have less centralized control over individual repositories. Plus any other per-project settings. WDYT @jpakkane ?

legeana avatar Jun 07 '20 17:06 legeana

Seems reasonable, but maybe it should be json instead?

jpakkane avatar Jun 07 '20 17:06 jpakkane

INI is fairly simple and easy to read, but not extensible. I suppose this is the reason you are not in favor of it. Another benefit of INI is that we already use it in our upstream.wrap and other configuration files. Consistency is nice.

[metadata]
description = "This is a nice package"

JSON is more extensible but has quite a few limitations:

  • it's harder to read than INI
  • it's different from the other configuration files
  • trailing comma is an annoying issue, parsers do not consistently handle it
{
  "metadata": {
    "description": "This is a nice package"
  }
}

There is also another option, textproto, which enables automated format verification.

  • clean and readable
  • *.proto documents it better than a wrapper class
  • yet another format to have, and we can't migrate upstream.wrap to textproto because of the meson core restriction on external dependencies
metadata {
  description: "This is a nice package"
}

legeana avatar Jun 07 '20 21:06 legeana

After thinking for a while I believe the best name should be either mesonwrap.* or wrapdb.*, where suffix depends on the chosen format, e.g. mesonwrap.ini.

legeana avatar Jun 19 '20 12:06 legeana

The original reason I thought of JSON was that if the description gets longer than 80 characters, it gets a bit ugly as INI files do not do wrapping. But then I remembered that JSON does not do it either. :)

jpakkane avatar Jun 19 '20 13:06 jpakkane

I started working on wrapdb.ini. This name seems to be the best as we describe the package in WrapDB, which is what we advertise.

legeana avatar Jun 20 '20 03:06 legeana

I added description support to the backend. Now it will look like this, notice metadata

Getting info about project

/v1/projects/<project>

{
  "name": "zlib",
  "output": "ok",
  "metadata": {
    "homepage": "http://zlib.net",
    "description": "Wrap definitions for the zlib library"
  },
  "versions": [
    {
      "branch": "1.2.8",
      "revision": 1
    }
  ]
}

We need to start adding metadata.wrap files to the root directory of the repositories to support this and some rendering.

legeana avatar Nov 16 '20 01:11 legeana