You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by GitBox <gi...@apache.org> on 2021/01/21 14:22:15 UTC

[GitHub] [sling-org-apache-sling-feature] bosschaert opened a new pull request #23: SLING-10084 Prevent the creation of features with multiple identical …

bosschaert opened a new pull request #23:
URL: https://github.com/apache/sling-org-apache-sling-feature/pull/23


   …Configuration PIDs


----------------------------------------------------------------
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.

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



[GitHub] [sling-org-apache-sling-feature] rombert commented on a change in pull request #23: SLING-10084 Prevent the creation of features with multiple identical …

Posted by GitBox <gi...@apache.org>.
rombert commented on a change in pull request #23:
URL: https://github.com/apache/sling-org-apache-sling-feature/pull/23#discussion_r561919270



##########
File path: src/test/java/org/apache/sling/feature/io/json/ConfigurationJSONWriterTest.java
##########
@@ -0,0 +1,49 @@
+/*
+ * 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
+ *
+ *      http://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.
+ */
+package org.apache.sling.feature.io.json;
+
+import org.apache.sling.feature.Configuration;
+import org.apache.sling.feature.Configurations;
+import org.junit.Test;
+
+import java.io.CharArrayWriter;
+import java.io.IOException;
+import java.util.Arrays;
+
+import static org.junit.Assert.fail;
+
+public class ConfigurationJSONWriterTest {
+    @Test

Review comment:
       Maybe use `@Test(expected = IOException.class)` ? Makes the code clearer IMO.




----------------------------------------------------------------
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.

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



[GitHub] [sling-org-apache-sling-feature] bosschaert closed pull request #23: SLING-10084 Prevent the creation of features with multiple identical …

Posted by GitBox <gi...@apache.org>.
bosschaert closed pull request #23:
URL: https://github.com/apache/sling-org-apache-sling-feature/pull/23


   


----------------------------------------------------------------
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.

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



[GitHub] [sling-org-apache-sling-feature] sonarcloud[bot] commented on pull request #23: SLING-10084 Prevent the creation of features with multiple identical …

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on pull request #23:
URL: https://github.com/apache/sling-org-apache-sling-feature/pull/23#issuecomment-764677065


   Kudos, SonarCloud Quality Gate passed!
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature&pullRequest=23&resolved=false&types=BUG) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature&pullRequest=23&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature&pullRequest=23&resolved=false&types=BUG)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature&pullRequest=23&resolved=false&types=VULNERABILITY) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature&pullRequest=23&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature&pullRequest=23&resolved=false&types=VULNERABILITY)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' />](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature&pullRequest=23&resolved=false&types=SECURITY_HOTSPOT) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature&pullRequest=23&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature&pullRequest=23&resolved=false&types=SECURITY_HOTSPOT)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature&pullRequest=23&resolved=false&types=CODE_SMELL) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature&pullRequest=23&resolved=false&types=CODE_SMELL) [1 Code Smell](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature&pullRequest=23&resolved=false&types=CODE_SMELL)
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/60.png' alt='80.0%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature&pullRequest=23&metric=new_coverage&view=list) [80.0% Coverage](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature&pullRequest=23&metric=new_coverage&view=list)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3.png' alt='0.0%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature&pullRequest=23&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature&pullRequest=23&metric=new_duplicated_lines_density&view=list)
   
   


----------------------------------------------------------------
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.

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



[GitHub] [sling-org-apache-sling-feature] rombert commented on a change in pull request #23: SLING-10084 Prevent the creation of features with multiple identical …

Posted by GitBox <gi...@apache.org>.
rombert commented on a change in pull request #23:
URL: https://github.com/apache/sling-org-apache-sling-feature/pull/23#discussion_r561919270



##########
File path: src/test/java/org/apache/sling/feature/io/json/ConfigurationJSONWriterTest.java
##########
@@ -0,0 +1,49 @@
+/*
+ * 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
+ *
+ *      http://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.
+ */
+package org.apache.sling.feature.io.json;
+
+import org.apache.sling.feature.Configuration;
+import org.apache.sling.feature.Configurations;
+import org.junit.Test;
+
+import java.io.CharArrayWriter;
+import java.io.IOException;
+import java.util.Arrays;
+
+import static org.junit.Assert.fail;
+
+public class ConfigurationJSONWriterTest {
+    @Test

Review comment:
       Maybe use `@Test(expected = IOException.class)` ? Makes the code clearer IMO.




----------------------------------------------------------------
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.

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



[GitHub] [sling-org-apache-sling-feature] cziegeler commented on pull request #23: SLING-10084 Prevent the creation of features with multiple identical …

Posted by GitBox <gi...@apache.org>.
cziegeler commented on pull request #23:
URL: https://github.com/apache/sling-org-apache-sling-feature/pull/23#issuecomment-764781758


   @bosschaert After reading the spec again, I can't find that pids are used case-insensitive. Properties are


----------------------------------------------------------------
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.

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



[GitHub] [sling-org-apache-sling-feature] bosschaert commented on pull request #23: SLING-10084 Prevent the creation of features with multiple identical …

Posted by GitBox <gi...@apache.org>.
bosschaert commented on pull request #23:
URL: https://github.com/apache/sling-org-apache-sling-feature/pull/23#issuecomment-764680208






----------------------------------------------------------------
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.

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



[GitHub] [sling-org-apache-sling-feature] sonarcloud[bot] commented on pull request #23: SLING-10084 Prevent the creation of features with multiple identical …

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on pull request #23:
URL: https://github.com/apache/sling-org-apache-sling-feature/pull/23#issuecomment-764677065


   Kudos, SonarCloud Quality Gate passed!
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature&pullRequest=23&resolved=false&types=BUG) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature&pullRequest=23&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature&pullRequest=23&resolved=false&types=BUG)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature&pullRequest=23&resolved=false&types=VULNERABILITY) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature&pullRequest=23&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature&pullRequest=23&resolved=false&types=VULNERABILITY)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' />](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature&pullRequest=23&resolved=false&types=SECURITY_HOTSPOT) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature&pullRequest=23&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature&pullRequest=23&resolved=false&types=SECURITY_HOTSPOT)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature&pullRequest=23&resolved=false&types=CODE_SMELL) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature&pullRequest=23&resolved=false&types=CODE_SMELL) [1 Code Smell](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature&pullRequest=23&resolved=false&types=CODE_SMELL)
   
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/60.png' alt='80.0%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature&pullRequest=23&metric=new_coverage&view=list) [80.0% Coverage](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature&pullRequest=23&metric=new_coverage&view=list)  
   [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3.png' alt='0.0%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature&pullRequest=23&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature&pullRequest=23&metric=new_duplicated_lines_density&view=list)
   
   


----------------------------------------------------------------
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.

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



[GitHub] [sling-org-apache-sling-feature] cziegeler edited a comment on pull request #23: SLING-10084 Prevent the creation of features with multiple identical …

Posted by GitBox <gi...@apache.org>.
cziegeler edited a comment on pull request #23:
URL: https://github.com/apache/sling-org-apache-sling-feature/pull/23#issuecomment-764781758


   @bosschaert After reading the spec again, I can't find that pids are used case-insensitive. Properties are
   And the config admin implementation compares pids case-sensitive, so I think we should not add this logic


----------------------------------------------------------------
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.

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



[GitHub] [sling-org-apache-sling-feature] cziegeler edited a comment on pull request #23: SLING-10084 Prevent the creation of features with multiple identical …

Posted by GitBox <gi...@apache.org>.
cziegeler edited a comment on pull request #23:
URL: https://github.com/apache/sling-org-apache-sling-feature/pull/23#issuecomment-764781758


   @bosschaert After reading the spec again, I can't find that pids are used case-insensitive. Properties are
   And the config admin implementation compares pids case-sensitive, so I think we should not add this logic


----------------------------------------------------------------
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.

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



[GitHub] [sling-org-apache-sling-feature] bosschaert commented on pull request #23: SLING-10084 Prevent the creation of features with multiple identical …

Posted by GitBox <gi...@apache.org>.
bosschaert commented on pull request #23:
URL: https://github.com/apache/sling-org-apache-sling-feature/pull/23#issuecomment-764680208


   I understand that at least there is also an issue about duplicate keys within a single PID. Will update the PR for that shortly.


----------------------------------------------------------------
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.

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



[GitHub] [sling-org-apache-sling-feature] bosschaert commented on pull request #23: SLING-10084 Prevent the creation of features with multiple identical …

Posted by GitBox <gi...@apache.org>.
bosschaert commented on pull request #23:
URL: https://github.com/apache/sling-org-apache-sling-feature/pull/23#issuecomment-764794306


   You are right @cziegeler, I thought that PIDs were also case-insensitive, but I checked the spec too and could not find this mentioned. As you say it's only the property keys that are case-insensitive.
   I'll close this PR so.


----------------------------------------------------------------
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.

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



[GitHub] [sling-org-apache-sling-feature] bosschaert closed pull request #23: SLING-10084 Prevent the creation of features with multiple identical …

Posted by GitBox <gi...@apache.org>.
bosschaert closed pull request #23:
URL: https://github.com/apache/sling-org-apache-sling-feature/pull/23


   


----------------------------------------------------------------
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.

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



[GitHub] [sling-org-apache-sling-feature] cziegeler commented on pull request #23: SLING-10084 Prevent the creation of features with multiple identical …

Posted by GitBox <gi...@apache.org>.
cziegeler commented on pull request #23:
URL: https://github.com/apache/sling-org-apache-sling-feature/pull/23#issuecomment-764779734






----------------------------------------------------------------
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.

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



[GitHub] [sling-org-apache-sling-feature] cziegeler commented on pull request #23: SLING-10084 Prevent the creation of features with multiple identical …

Posted by GitBox <gi...@apache.org>.
cziegeler commented on pull request #23:
URL: https://github.com/apache/sling-org-apache-sling-feature/pull/23#issuecomment-764779734


   Patch looks good to me, not sure if this is part of this issue or another one, but we should handle this when reading from a feature file as well and fail reading on duplicate keys 


----------------------------------------------------------------
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.

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