You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "vy (via GitHub)" <gi...@apache.org> on 2023/01/22 19:59:28 UTC

[GitHub] [logging-log4j-tools] vy commented on a diff in pull request #13: Add schema file

vy commented on code in PR #13:
URL: https://github.com/apache/logging-log4j-tools/pull/13#discussion_r1083531299


##########
.gitignore:
##########
@@ -18,4 +18,8 @@ target/
 *.iml
 *.iws
 /out
-dependency-reduced-pom.xml
+.flattened-pom.xml

Review Comment:
   Is this necessary? I tried to make sure `flatten-maven-plugin` always outputs to `target`, have I missed something?



##########
log4j-changelog/src/main/resources/log4j-changelog.xsd:
##########
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements. See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License. You may obtain a copy of the License at
+
+      https://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+  targetNamespace="https://logging.apache.org/log4j/log4j-changelog"
+  xmlns:cl="https://logging.apache.org/log4j/log4j-changelog" elementFormDefault="qualified">
+
+  <element name="release">
+    <complexType>
+      <simpleContent>
+        <extension base="string">
+          <attribute name="version" use="required"/>
+          <attribute name="date" use="required">
+            <simpleType>
+              <union memberTypes="date cl:tbd"/>
+            </simpleType>
+          </attribute>
+        </extension>
+      </simpleContent>
+    </complexType>
+  </element>
+
+  <simpleType name="tbd">
+    <restriction base="string">
+      <enumeration value="TBD"/>
+    </restriction>
+  </simpleType>
+
+  <element name="entry">
+    <complexType>
+      <sequence>
+        <element name="issue" type="cl:issueType" minOccurs="0" maxOccurs="unbounded"/>
+        <element name="author" type="cl:authorType" maxOccurs="unbounded"/>
+        <element name="description" type="cl:descriptionType"/>
+      </sequence>
+      <attribute name="type" type="cl:changeType" use="required"/>
+    </complexType>
+  </element>
+
+  <complexType name="issueType">
+    <simpleContent>
+      <extension base="string">
+        <attribute name="id" type="ID" use="required"/>

Review Comment:
   Judging from our conversation with you, `type` needs to be replaced with `string` here, since IDs in GitHub Issues are positive integers.
   
   ```suggestion
           <attribute name="id" type="string" use="required"/>
   ```



##########
log4j-changelog/src/main/resources/log4j-changelog.xsd:
##########
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements. See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License. You may obtain a copy of the License at
+
+      https://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+  targetNamespace="https://logging.apache.org/log4j/log4j-changelog"
+  xmlns:cl="https://logging.apache.org/log4j/log4j-changelog" elementFormDefault="qualified">

Review Comment:
   We better have some versioning:
   
   ```suggestion
                    targetNamespace="https://logging.apache.org/log4j/changelog/1.0.0"
                    xmlns:cl="https://logging.apache.org/log4j/changelog/1.0.0"
                    elementFormDefault="qualified">
   ```



##########
log4j-changelog/src/main/resources/log4j-changelog.xsd:
##########
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements. See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License. You may obtain a copy of the License at
+
+      https://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+  targetNamespace="https://logging.apache.org/log4j/log4j-changelog"
+  xmlns:cl="https://logging.apache.org/log4j/log4j-changelog" elementFormDefault="qualified">
+
+  <element name="release">
+    <complexType>
+      <simpleContent>
+        <extension base="string">
+          <attribute name="version" use="required"/>
+          <attribute name="date" use="required">
+            <simpleType>
+              <union memberTypes="date cl:tbd"/>
+            </simpleType>
+          </attribute>
+        </extension>
+      </simpleContent>
+    </complexType>
+  </element>
+
+  <simpleType name="tbd">
+    <restriction base="string">
+      <enumeration value="TBD"/>
+    </restriction>
+  </simpleType>
+
+  <element name="entry">
+    <complexType>
+      <sequence>
+        <element name="issue" type="cl:issueType" minOccurs="0" maxOccurs="unbounded"/>
+        <element name="author" type="cl:authorType" maxOccurs="unbounded"/>
+        <element name="description" type="cl:descriptionType"/>
+      </sequence>
+      <attribute name="type" type="cl:changeType" use="required"/>
+    </complexType>
+  </element>
+
+  <complexType name="issueType">
+    <simpleContent>
+      <extension base="string">
+        <attribute name="id" type="ID" use="required"/>
+        <attribute name="link" type="anyURI" use="required"/>
+      </extension>
+    </simpleContent>
+  </complexType>
+
+  <simpleType name="changeType">
+    <restriction base="string">
+      <enumeration value="added"/>
+      <enumeration value="changed"/>
+      <enumeration value="deprecated"/>
+      <enumeration value="removed"/>
+      <enumeration value="fixed"/>

Review Comment:
   Let's stick to the Keep-a-changelog spec for the time being. I will discuss this further in the `dev@` mailing list.
   ```suggestion
         <enumeration value="fixed"/>
         <enumeration value="security"/>
   ```



##########
log4j-changelog/src/main/resources/log4j-changelog.xsd:
##########
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements. See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License. You may obtain a copy of the License at
+
+      https://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+  targetNamespace="https://logging.apache.org/log4j/log4j-changelog"
+  xmlns:cl="https://logging.apache.org/log4j/log4j-changelog" elementFormDefault="qualified">
+
+  <element name="release">
+    <complexType>
+      <simpleContent>
+        <extension base="string">
+          <attribute name="version" use="required"/>
+          <attribute name="date" use="required">
+            <simpleType>
+              <union memberTypes="date cl:tbd"/>
+            </simpleType>

Review Comment:
   No, a `.release.xml` cannot have a `TBD` date. It *must* be a valid date in `YYYY-mm-dd` format.



##########
log4j-changelog/src/main/resources/log4j-changelog.xsd:
##########
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements. See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License. You may obtain a copy of the License at
+
+      https://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+  targetNamespace="https://logging.apache.org/log4j/log4j-changelog"
+  xmlns:cl="https://logging.apache.org/log4j/log4j-changelog" elementFormDefault="qualified">
+
+  <element name="release">
+    <complexType>
+      <simpleContent>
+        <extension base="string">
+          <attribute name="version" use="required"/>
+          <attribute name="date" use="required">
+            <simpleType>
+              <union memberTypes="date cl:tbd"/>
+            </simpleType>
+          </attribute>
+        </extension>
+      </simpleContent>
+    </complexType>
+  </element>
+
+  <simpleType name="tbd">
+    <restriction base="string">
+      <enumeration value="TBD"/>
+    </restriction>
+  </simpleType>
+
+  <element name="entry">
+    <complexType>
+      <sequence>
+        <element name="issue" type="cl:issueType" minOccurs="0" maxOccurs="unbounded"/>
+        <element name="author" type="cl:authorType" maxOccurs="unbounded"/>
+        <element name="description" type="cl:descriptionType"/>
+      </sequence>
+      <attribute name="type" type="cl:changeType" use="required"/>
+    </complexType>
+  </element>
+
+  <complexType name="issueType">
+    <simpleContent>
+      <extension base="string">
+        <attribute name="id" type="ID" use="required"/>
+        <attribute name="link" type="anyURI" use="required"/>
+      </extension>
+    </simpleContent>
+  </complexType>
+
+  <simpleType name="changeType">
+    <restriction base="string">
+      <enumeration value="added"/>
+      <enumeration value="changed"/>
+      <enumeration value="deprecated"/>
+      <enumeration value="removed"/>
+      <enumeration value="fixed"/>
+    </restriction>
+  </simpleType>
+
+  <complexType name="authorType">
+    <simpleContent>
+      <extension base="string">
+        <attribute name="id" type="ID"/>

Review Comment:
   Question: How do `type="ID"` and `type="string"` differ in our context?



##########
log4j-changelog/src/main/resources/log4j-changelog.xsd:
##########
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements. See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License. You may obtain a copy of the License at
+
+      https://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<schema xmlns="http://www.w3.org/2001/XMLSchema"
+  targetNamespace="https://logging.apache.org/log4j/log4j-changelog"
+  xmlns:cl="https://logging.apache.org/log4j/log4j-changelog" elementFormDefault="qualified">
+
+  <element name="release">
+    <complexType>
+      <simpleContent>
+        <extension base="string">
+          <attribute name="version" use="required"/>
+          <attribute name="date" use="required">
+            <simpleType>
+              <union memberTypes="date cl:tbd"/>
+            </simpleType>
+          </attribute>
+        </extension>
+      </simpleContent>
+    </complexType>
+  </element>
+
+  <simpleType name="tbd">
+    <restriction base="string">
+      <enumeration value="TBD"/>
+    </restriction>
+  </simpleType>
+
+  <element name="entry">
+    <complexType>
+      <sequence>
+        <element name="issue" type="cl:issueType" minOccurs="0" maxOccurs="unbounded"/>
+        <element name="author" type="cl:authorType" maxOccurs="unbounded"/>
+        <element name="description" type="cl:descriptionType"/>
+      </sequence>
+      <attribute name="type" type="cl:changeType" use="required"/>
+    </complexType>
+  </element>
+
+  <complexType name="issueType">
+    <simpleContent>
+      <extension base="string">
+        <attribute name="id" type="ID" use="required"/>
+        <attribute name="link" type="anyURI" use="required"/>
+      </extension>
+    </simpleContent>
+  </complexType>
+
+  <simpleType name="changeType">
+    <restriction base="string">
+      <enumeration value="added"/>
+      <enumeration value="changed"/>
+      <enumeration value="deprecated"/>
+      <enumeration value="removed"/>
+      <enumeration value="fixed"/>
+    </restriction>
+  </simpleType>
+
+  <complexType name="authorType">
+    <simpleContent>
+      <extension base="string">
+        <attribute name="id" type="ID"/>
+        <attribute name="name"/>
+      </extension>
+    </simpleContent>
+  </complexType>
+
+  <complexType name="descriptionType">
+    <simpleContent>
+      <extension base="string">
+        <attribute name="type" use="required"/>

Review Comment:
   ```suggestion
           <attribute name="format" type="string" use="required" fixed="asciidoc"/>
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org