Skip to content

Commit

Permalink
docs: Split releases specification into its own section
Browse files Browse the repository at this point in the history
It is a lot easier to read this way, and we would need to split it out
anyway in order to make external release descriptions work.
  • Loading branch information
ximion committed Sep 29, 2022
1 parent 6987efd commit d8578e4
Show file tree
Hide file tree
Showing 5 changed files with 239 additions and 177 deletions.
1 change: 1 addition & 0 deletions docs/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ as_doc_src = [
'xml/metainfo-runtime.xml',
'xml/metainfo-service.xml',
'xml/metainfo-webapp.xml',
'xml/releases-data.xml',
'xml/Miscellaneous.xml',
'xml/misc-vercmp.xml',
'xml/misc-urihandler.xml',
Expand Down
2 changes: 2 additions & 0 deletions docs/xml/MetaInfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
</para>

<xi:include href="metainfo-component.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="releases-data.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />

<xi:include href="metainfo-desktopapp.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="metainfo-consoleapp.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="metainfo-webapp.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
Expand Down
2 changes: 1 addition & 1 deletion docs/xml/metainfo-addon.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</para>
</section>

<section id="spec-addoncdata-example">
<section id="spec-addondata-example">
<title>Example file</title>
<para>
A addon metainfo file should look like this:
Expand Down
180 changes: 4 additions & 176 deletions docs/xml/metainfo-component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -499,183 +499,11 @@
<term>&lt;releases/&gt;</term>
<listitem>
<para>
The <code><![CDATA[<releases>]]></code> tag contains <code>&lt;release/&gt;</code> child tags which
describe some metainformation about the current release of the described software.
Each release of the software component should have a <code>&lt;release/&gt;</code> tag describing it,
but at least one <literal>release</literal> child must be present for the current release of the software.
The <literal>release</literal> children should be sorted in a latest-to-oldest order to simplify reading
the metadata file.
The <code><![CDATA[<releases>]]></code> tag contains multiple <literal>release</literal> children that contain
metadata about releases made for this software component.
The release information XML is described in-depth in <xref linkend="sect-Metadata-Releases"/>,
examples for a valid <literal>releases</literal> tag with artifacts are also provided there.
</para>
<para>
A <literal>release</literal> tag can have the properties <literal>version</literal>, <literal>date</literal> and <literal>timestamp</literal>.
The <literal>date</literal> property can have any time in <ulink url="https://en.wikipedia.org/wiki/ISO_8601">ISO 8601</ulink> format as its value and
should be present for every release. At least day-level granularity is required, which means that the ISO 8601 string must contain at least a full date (e.g. 2020-08-12).
The <literal>timestamp</literal> tag contains the release time in the form of a UNIX epoch. This tag should not be used in metainfo files in newly
written metadata, but will still be parsed in case it is present. The <literal>timestamp</literal> property is mainly used in generated distro-metadata.
In case both release-time tags are present, the <literal>timestamp</literal> tag will take precedence over <literal>date</literal>.
</para>
<para>
The algorithm used for comparing version numbers is described at <xref linkend="sect-AppStream-Misc-VerCmp"/>.
</para>
<para>
A <literal>release</literal> tag may also have a <literal>date_eol</literal> property that denotes the date when the release stops to receive
support from the software developers (end-of-life). Its value can be any complete date or time in <ulink url="https://en.wikipedia.org/wiki/ISO_8601">ISO 8601</ulink>.
</para>
<para>
Optionally, the <code>&lt;release/&gt;</code> tag may also have an <literal>urgency</literal> property, having one of the following values:
</para>
<itemizedlist>
<listitem><para><literal>low</literal></para></listitem>
<listitem><para><literal>medium</literal></para></listitem>
<listitem><para><literal>high</literal></para></listitem>
<listitem><para><literal>critical</literal></para></listitem>
</itemizedlist>
<para>
The <literal>urgency</literal> defines how important it is to install the new release as an update. This is especially important for <literal>type=firmware</literal>
components.
If no urgency is defined, a <code>medium</code> urgency is implicitly assumed.
The urgency defines how the update will be presented to the user, and sometimes if it will be installed automatically and immediately, or delayed.
</para>
<para>
A <literal>release</literal> tag may have a <literal>type</literal> property
to classify releases with one of the following values:
</para>
<itemizedlist>
<listitem><para><literal>stable</literal></para></listitem>
<listitem><para><literal>development</literal></para></listitem>
</itemizedlist>
<para>
By default, if no release type is defined, <code>stable</code> is assumed.
A software displaying a listing of releases should only show stable releases and
discard any development release if the current version is itself stable. It can
show all versions when development versions of the software are also distributed.
</para>

<para>
Each <literal>release</literal> tag may have a <literal>description</literal> tag as child, containing a brief description of what is new in the release.
The <literal>description</literal> tag is structured as described in <xref linkend="tag-description"/>.
</para>

<para>
A release may also have a <literal>url</literal> tag as child.
The release url should point to detailed release notes that explain the changes made in this particular release.
The <literal>url</literal> tag may have a <literal>type</literal> property with <code>details</code> as the only currently
allowed value. If the <literal>type</literal> is missing, a URL type of <code>details</code> is implicitly assumed.
</para>

<para>
In order to mention issues that were resolved in a release, and especially reference <ulink url="https://en.wikipedia.org/wiki/Common_Vulnerabilities_and_Exposures">CVE</ulink> IDs,
<literal>issue</literal> tags can be used as children of one <literal>issues</literal> tag within a <literal>release</literal>.
The value of an <literal>issue</literal> tag must be the bug number, ticket name, or CVE ID and is typically displayed to the user, but may also in case of CVE IDs be read by
machines. If the value is a CVE ID, the <literal>type</literal> property of the <literal>issue</literal> tag must be set to <code>cve</code>.
If the <literal>type</literal> property is missing, an issue type of <code>generic</code> is assumed. The <literal>url</literal> property can be used to provide
a web URL to a details page on the respective issue. It is required for all issue types, except for the <code>cve</code> type, where it is optional.
</para>

<para>
To denote release artifacts, the <literal>artifacts</literal> child tag can be used. It itself contains the artifacts as <literal>artifact</literal> children.
Each artifact tag must have a <literal>type</literal> property with the value of either <code>binary</code> or <code>source</code> to indicate whether the
artifact is the releases' source-code or a binary distribution.
</para>
<para>
In case of a <code>binary</code> type, an optional <literal>platform</literal> property may
also be set, containing a platform triplet (also known as normalized GNU triplet), such as <code>x86_64-linux-gnu</code>. Refer to
<ulink url="https://wiki.debian.org/Multiarch/Tuples#Used_solution">Debian multiarch tuples</ulink> for more information on normalized GNU triplets, and
<ulink url="https://github.com/ximion/appstream/blob/master/data/platforms.yml">AppStream's platforms.yml</ulink> for the triplet parts AppStream currently recognizes.
Note that AppStream only supports strictly three-part triplets in the form of <code>arch-oskernel-osenvironment</code>. Parts of the triplets which do not apply can be
replaced with <code>any</code>.
</para>
<para>
Binary artifacts may also have a <literal>bundle</literal> property to indicate the bundling system the binary distribution is made for. Refer to
the bundle types in <xref linkend="tag-ct-bundle"/> for a list of possible values.
Each <literal>artifact</literal> can have a number of children:
</para>

<variablelist>
<varlistentry>
<term>location</term>
<listitem>
<para>
Each artifact must have a <literal>location</literal> child, denoting the web location (HTTP or HTTPS) where it can be downloaded from.
Multiple location tags are allowed to make it possible to have mirror options to download the same artifact from.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>checksum</term>
<listitem>
<para>
At least one <literal>checksum</literal> child must be present to contain the checksum of the released artifact.
The <code>&lt;checksum/&gt;</code> tag has a <code>type</code> attribute, containing the name of the hash function that was used to create it.
Currently aupported values (and hash sums) are: <literal>sha1</literal>, <literal>sha256</literal>, <literal>blake2b</literal> and <literal>blake2s</literal>.
For most purposes (on 64-bit machines), using <ulink url="https://blake2.net">BLAKE2b</ulink> via the <command>b2sum</command> utility from GNU Coreutils is a good choice.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>size</term>
<listitem>
<para>
One or multiple <literal>size</literal> tags may also be present, which define the installed and download size
of this component release artifact.
The size type is defined via a <literal>type</literal> property on the <literal>size</literal> tag, and may assume the value <code>download</code> or <code>installed</code>.
The size itself is set as the value and must be given in bytes.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term>filename</term>
<listitem>
<para>
An artifact may have a <literal>filename</literal> child, containing a non-absolute filename that the artifact may be stored under. The file name is only a naming hint and
applications are not required to follow it when downloading the file. If no <literal>filename</literal> tag is present, a file name may be generated from the artifact
<literal>location</literal> URL.
This tag must only appear once.
</para>
</listitem>
</varlistentry>

</variablelist>

<para>
Examples for a valid releases tag with artifacts:
</para>
<programlisting language="XML"><![CDATA[<releases>
<release version="1.2" date="2014-04-12" urgency="high">
<description>
<p>This stable release fixes bugs.</p>
</description>
<url>https://example.org/releases/version-1.2.html</url>
<issues>
<issue url="https://example.com/bugzilla/12345">bz#12345</issue>
<issue type="cve">CVE-2019-123456</issue>
</issues>
<artifacts>
<artifact type="binary" platform="x86_64-linux-gnu">
<location>https://example.com/mytarball.bin.tar.xz</location>
<checksum type="sha256">....</checksum>
<checksum type="blake2b">....</checksum>
<size type="download">12345678</size>
<size type="installed">42424242</size>
</artifact>
<artifact type="binary" platform="x86_64-windows-msvc">
<location>https://example.com/mytarball.bin.exe</location>
</artifact>
<artifact type="source">
<location>https://example.com/mytarball.tar.xz</location>
<checksum type="sha256">....</checksum>
</artifact>
</artifacts>
</release>
<release version="1.1" type="development" date="2013-10-20" />
<release version="1.0" date="2012-08-26" />
</releases>]]></programlisting>
</listitem>
</varlistentry>

Expand Down
Loading

0 comments on commit d8578e4

Please sign in to comment.