gitea
gitea copied to clipboard
Package registry: add description from UI
This PR fix #20604
- The package has 2 new columns:
descriptionandreadme - Settings contains 2 new fields dedicated to the description (plain text) and the readme (markdown)
- Package page contains the description below the package name and the readme below the installation guide
- The packages list show descriptions below each package title



Some package types already contain a readme. (Pub (#20560), npm, PyPI)
All package types (except generic) have at minimum a description field which can be provided by the package. For your Docker case you can set the description with LABEL org.opencontainers.image.description=Your description of the image. So I don't think your description field is needed.
And keep in mind the readme may change from version to version. So it may be wrong to have the readme at the package level.
The built-in package description is mainly interesting when you use the package search system. The proposed description is supposed to describe the package inside gitea. Like docker hub, the readme is a global description which does not depend of the shown version. This proposal unifies the way to manage descriptions of all packages 📦
Could there be a conclusion from maintainers: go or no-go?
Feature-wise I think it's good
@KN4CK3R has your concern been addressed?
@KN4CK3R has your concern been addressed?
I'm still not sure if we should have the readme part because some packages already provide a readme and then there would be two readmes shown.

We could store the provided readme in the new readme field, but the provided readme may be version dependend. I don't know if thats really a problem. It may be needed to set/update the readme and description fields from the package metadata (which may again be version dependend).
Github simply shows the README.md file if the package is linked to a (git) repository (similar to the profile readme feature).
Then maybe it (this PR's proposal) needs some real cases for why a separate (non-package) README is needed, to see whether the separate README would be widely used and really needed.
Maybe it's like repository which has both description and README.md?
As I said the built-in package description is mainly interesting when you use the package search system. The proposed description is supposed to describe the package inside gitea. Like docker hub, the readme is a global description which does not depend of the shown version. This proposal unifies the way to manage descriptions of all packages package: a description shown in list, a readme/bigger description wrote in markdown to get more information (eg: overview of https://hub.docker.com/_/ubuntu).
Would it make sense to consider using the OCI annotation for docmentation -- org.opencontainers.image.documentation then it could be condition (display if the field is provided, don't if it is not)
ref: https://github.com/opencontainers/image-spec/blob/main/annotations.md