-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🚧🏗👷 Accept and deliver What's New information #580
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?xml version="1.0"?> | ||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" | ||
elementFormDefault="qualified" attributeFormDefault="unqualified"> | ||
<xs:element name="release"> | ||
<xs:complexType> | ||
<xs:sequence> | ||
<xs:element name="changelog" maxOccurs="1" minOccurs="1"> | ||
<xs:complexType> | ||
<xs:attribute name="href" type="xs:anyURI" use="required" /> | ||
</xs:complexType> | ||
</xs:element> | ||
<xs:element name="whatsNew" minOccurs="1" maxOccurs="unbounded"> | ||
<xs:complexType> | ||
<xs:sequence> | ||
<xs:element name="regular" type="whatsNewInfo" minOccurs="1" maxOccurs="1" /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What if there are only admin changes? like "ui for configuring additional mount type" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, we should consider that. Might make sense for the server, too, as the maintenance releases often don't have much to brag about, but subtle bug fixes. |
||
<xs:element name="admin" type="whatsNewInfo" minOccurs="0" maxOccurs="1" /> | ||
</xs:sequence> | ||
<xs:attribute name="lang" type="language" use="required" /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @MorrisJobke how would this interact with translation? Not sure what your plans are currently for translating xml contents. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We just put them in the same file: https://github.com/nextcloud/changelog_server/blob/master/data/14.0.0.xml#L16 |
||
</xs:complexType> | ||
</xs:element> | ||
</xs:sequence> | ||
<xs:attribute name="version" type="version" use="required" /> | ||
</xs:complexType> | ||
</xs:element> | ||
|
||
<xs:simpleType name="version"> | ||
<xs:restriction base="xs:string"> | ||
<xs:pattern value="(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)"/> | ||
<xs:minLength value="6"/> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd drop the min and max length requirements. min length of 6 makes 0.0.1 invalid btw. |
||
<xs:maxLength value="12"/> | ||
</xs:restriction> | ||
</xs:simpleType> | ||
|
||
<!-- based on xs:language, just uses _ as a separator between lang and region. --> | ||
<xs:simpleType name="language"> | ||
<xs:restriction base="xs:token"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should maybe consistent with https://github.com/nextcloud/appstore/blob/master/nextcloudappstore/api/v1/release/info.xsd#L136 |
||
<xs:pattern | ||
value="([a-zA-Z]{2}|[iI]-[a-zA-Z]+|[xX]-[a-zA-Z]{1,8})(_[a-zA-Z]{1,8})*" | ||
/> | ||
</xs:restriction> | ||
</xs:simpleType> | ||
|
||
<xs:complexType name="whatsNewInfo"> | ||
<xs:sequence> | ||
<xs:element name="item" minOccurs="1" maxOccurs="3"> | ||
<xs:simpleType> | ||
<xs:restriction base="xs:string"> | ||
<xs:minLength value="1"/> | ||
</xs:restriction> | ||
</xs:simpleType> | ||
</xs:element> | ||
</xs:sequence> | ||
</xs:complexType> | ||
|
||
</xs:schema> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?xml version="1.0"?> | ||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | ||
<xsl:template match="/release"> | ||
<release> | ||
<xsl:variable name="lowercase" select="'abcdefghijklmnopqrstuvwxyz'" /> | ||
<xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" /> | ||
|
||
<!-- reformat info.xml to have everything in order and excluded unknown elements --> | ||
<xsl:copy-of select="changelog"/> | ||
<xsl:apply-templates select="whatsNew"/> | ||
</release> | ||
</xsl:template> | ||
|
||
<xsl:template match="whatsNew"> | ||
<whatsNew> | ||
<xsl:if test="@lang"> | ||
<xsl:attribute name="lang"> | ||
<xsl:value-of select="@lang"/> | ||
</xsl:attribute> | ||
</xsl:if> | ||
<xsl:apply-templates select="regular"/> | ||
<xsl:apply-templates select="admin"/> | ||
</whatsNew> | ||
</xsl:template> | ||
|
||
<xsl:template match="regular"> | ||
<regular> | ||
<xsl:copy-of select="item"/> | ||
</regular> | ||
</xsl:template> | ||
|
||
<xsl:template match="admin"> | ||
<admin> | ||
<xsl:copy-of select="item"/> | ||
</admin> | ||
</xsl:template> | ||
</xsl:stylesheet> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,8 @@ | |
from nextcloudappstore.api.v1.release.downloader import \ | ||
AppReleaseDownloader | ||
from nextcloudappstore.api.v1.release.parser import \ | ||
GunZipAppMetadataExtractor, parse_app_metadata, parse_changelog, \ | ||
validate_database | ||
GunZipAppMetadataExtractor, parse_app_metadata, parse_app_whats_new, \ | ||
parse_changelog, validate_database | ||
|
||
|
||
class InvalidAppDirectoryException(ValidationError): | ||
|
@@ -35,6 +35,9 @@ def get_release_info(self, url: str, is_nightly: bool = False) -> Release: | |
info = parse_app_metadata(meta.info_xml, self.config.info_schema, | ||
self.config.pre_info_xslt, | ||
self.config.info_xslt) | ||
if meta.changes_xml: | ||
whats_new = parse_app_whats_new(meta.changes_xml, self.config.changes_schema, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like an unused variable. If it's just for validation simply remove the assignment There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. still WIP |
||
self.config.pre_changes_xslt) | ||
if meta.database_xml: | ||
validate_database(meta.database_xml, self.config.db_schema, | ||
self.config.pre_db_xslt) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<release xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://apps.nextcloud.com/schema/apps/changes.xsd" version="0.0.1"> | ||
<changelog href="" /> | ||
<whatsNew lang="en"> | ||
<regular> | ||
<item>First {{ app.name }} release!</item> | ||
</regular> | ||
<admin> | ||
<item>requires {{ app.nextcloud_version }}</item> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is redundant with the version in info.xml and probably a bad example for new developers. Better example or simply remove it? |
||
</admin> | ||
</whatsNew> | ||
</release> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
12 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be optional and re-use the CHANGELOG.md in the app folder by default
.