[jira] [Updated] (SLING-12346) Create service-user-mapping analyser

2024-06-05 Thread Angela Schreiber (Jira)


 [ 
https://issues.apache.org/jira/browse/SLING-12346?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Angela Schreiber updated SLING-12346:
-
Affects Version/s: Feature Model Analyser 2.0.2

> Create service-user-mapping analyser
> 
>
> Key: SLING-12346
> URL: https://issues.apache.org/jira/browse/SLING-12346
> Project: Sling
>  Issue Type: New Feature
>  Components: Feature Model, Maven Plugins and Archetypes
>Affects Versions: Feature Model Analyser 2.0.2
>Reporter: Angela Schreiber
>Assignee: Angela Schreiber
>Priority: Major
> Fix For: Feature Model Analyser 2.0.4
>
>
> based on a discussion with [~joerghoh], i would like to suggest that we 
> create a dedicated analyser for service-user-mappings.
> This feature would include the following 2 checks:
> - validity of service-user-mapping 
> - usage of deprecated service user mapping format 
> The second part should be enabled through configuration.
> [~cziegeler], [~kpauls], i would give it a try borrowing from existing 
> analysers but i will likely need input from your side to not spend too much 
> time on figuring out details i might have missed.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Resolved] (SLING-12346) Create service-user-mapping analyser

2024-06-05 Thread Angela Schreiber (Jira)


 [ 
https://issues.apache.org/jira/browse/SLING-12346?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Angela Schreiber resolved SLING-12346.
--
Fix Version/s: Feature Model Analyser 2.0.4
   Resolution: Fixed

> Create service-user-mapping analyser
> 
>
> Key: SLING-12346
> URL: https://issues.apache.org/jira/browse/SLING-12346
> Project: Sling
>  Issue Type: New Feature
>  Components: Feature Model, Maven Plugins and Archetypes
>Reporter: Angela Schreiber
>Assignee: Angela Schreiber
>Priority: Major
> Fix For: Feature Model Analyser 2.0.4
>
>
> based on a discussion with [~joerghoh], i would like to suggest that we 
> create a dedicated analyser for service-user-mappings.
> This feature would include the following 2 checks:
> - validity of service-user-mapping 
> - usage of deprecated service user mapping format 
> The second part should be enabled through configuration.
> [~cziegeler], [~kpauls], i would give it a try borrowing from existing 
> analysers but i will likely need input from your side to not spend too much 
> time on figuring out details i might have missed.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (SLING-10288) FelixFrameworkScanner sets framework properties always for current Java version

2024-06-05 Thread Robert Munteanu (Jira)


[ 
https://issues.apache.org/jira/browse/SLING-10288?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852508#comment-17852508
 ] 

Robert Munteanu commented on SLING-10288:
-

I am going to give this a shot. I would like to start some experiments on the 
Sling Starter, but I am not sure how to generate a feature model that includes 
the analyser-metadata. I was looking into the {{apis-jar}} mojo but that does 
not look to be the case.

[~kwin] / [~kpauls] - any hints on how to generate a feature model that 
includes the analyser-metadata section?

> FelixFrameworkScanner sets framework properties always for current Java 
> version
> ---
>
> Key: SLING-10288
> URL: https://issues.apache.org/jira/browse/SLING-10288
> Project: Sling
>  Issue Type: Bug
>  Components: Feature Model Analyser
>Reporter: Konrad Windszus
>Assignee: Robert Munteanu
>Priority: Major
>
> Sometimes the analyser is executed with a different java version than the one 
> executing the actual OSGi container. There should be a possibility to 
> explicitly set a Java version.
> Currently the framework properties are gathered in a dedicated java process 
> executing 
> https://github.com/apache/sling-org-apache-sling-feature-analyser/blob/730b7d3297ab9f17f484e7b557e4ec47c3d9b3e9/src/main/java/org/apache/sling/feature/scanner/impl/fwk/FrameworkPropertiesGatherer.java#L41.
>  That new process always takes the current  {{java.home}} which therefore 
> returns the wrong properties (i.e. the ones for the current  java version 
> instead of the one used to execute the framework).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Re: [PR] SLING-12346 : Create service-user-mapping analyser [sling-org-apache-sling-feature-analyser]

2024-06-05 Thread via GitHub


anchela merged PR #45:
URL: https://github.com/apache/sling-org-apache-sling-feature-analyser/pull/45


-- 
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: dev-unsubscr...@sling.apache.org

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



[jira] [Assigned] (SLING-10288) FelixFrameworkScanner sets framework properties always for current Java version

2024-06-05 Thread Robert Munteanu (Jira)


 [ 
https://issues.apache.org/jira/browse/SLING-10288?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Robert Munteanu reassigned SLING-10288:
---

Assignee: Robert Munteanu

> FelixFrameworkScanner sets framework properties always for current Java 
> version
> ---
>
> Key: SLING-10288
> URL: https://issues.apache.org/jira/browse/SLING-10288
> Project: Sling
>  Issue Type: Bug
>  Components: Feature Model Analyser
>Reporter: Konrad Windszus
>Assignee: Robert Munteanu
>Priority: Major
>
> Sometimes the analyser is executed with a different java version than the one 
> executing the actual OSGi container. There should be a possibility to 
> explicitly set a Java version.
> Currently the framework properties are gathered in a dedicated java process 
> executing 
> https://github.com/apache/sling-org-apache-sling-feature-analyser/blob/730b7d3297ab9f17f484e7b557e4ec47c3d9b3e9/src/main/java/org/apache/sling/feature/scanner/impl/fwk/FrameworkPropertiesGatherer.java#L41.
>  That new process always takes the current  {{java.home}} which therefore 
> returns the wrong properties (i.e. the ones for the current  java version 
> instead of the one used to execute the framework).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Re: [PR] SLING-12346 : Create service-user-mapping analyser [sling-org-apache-sling-feature-analyser]

2024-06-05 Thread via GitHub


sonarcloud[bot] commented on PR #45:
URL: 
https://github.com/apache/sling-org-apache-sling-feature-analyser/pull/45#issuecomment-2150393767

   ## [![Quality Gate 
Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png
 'Quality Gate 
Passed')](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-feature-analyser=45)
 **Quality Gate passed**  
   Issues  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [0 New 
issues](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-analyser=45=false=true)
  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png
 '') [0 Accepted 
issues](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-analyser=45=WONTFIX)
   
   Measures  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [0 Security 
Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature-analyser=45=false=true)
  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [96.4% Coverage on New 
Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-analyser=45=new_coverage=list)
  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [0.0% Duplication on New 
Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-analyser=45=new_duplicated_lines_density=list)
  
 
   [See analysis details on 
SonarCloud](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-feature-analyser=45)
   
   


-- 
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: dev-unsubscr...@sling.apache.org

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



Re: [PR] SLING-12346 : Create service-user-mapping analyser [sling-org-apache-sling-feature-analyser]

2024-06-05 Thread via GitHub


anchela commented on code in PR #45:
URL: 
https://github.com/apache/sling-org-apache-sling-feature-analyser/pull/45#discussion_r1628016847


##
pom.xml:
##
@@ -173,6 +179,12 @@
 1.9.0
 provided
 
+
+org.apache.sling
+org.apache.sling.serviceusermapper
+1.5.8
+provided
+

Review Comment:
   removed. thanks for spotting. that's awesome.



-- 
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: dev-unsubscr...@sling.apache.org

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



Re: [PR] SLING-12346 : Create service-user-mapping analyser [sling-org-apache-sling-feature-analyser]

2024-06-05 Thread via GitHub


anchela commented on code in PR #45:
URL: 
https://github.com/apache/sling-org-apache-sling-feature-analyser/pull/45#discussion_r1628013962


##
pom.xml:
##
@@ -173,6 +179,12 @@
 1.9.0
 provided
 
+
+org.apache.sling
+org.apache.sling.serviceusermapper
+1.5.8
+provided
+

Review Comment:
   no i don't think so.  will check and remove it



-- 
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: dev-unsubscr...@sling.apache.org

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



[jira] [Assigned] (SLING-12348) update to parent 60

2024-06-05 Thread Joerg Hoh (Jira)


 [ 
https://issues.apache.org/jira/browse/SLING-12348?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Joerg Hoh reassigned SLING-12348:
-

Assignee: Joerg Hoh

> update to parent 60
> ---
>
> Key: SLING-12348
> URL: https://issues.apache.org/jira/browse/SLING-12348
> Project: Sling
>  Issue Type: Task
>  Components: Repoinit
>Reporter: Joerg Hoh
>Assignee: Joerg Hoh
>Priority: Major
> Fix For: Repoinit JCR 1.1.52
>
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Created] (SLING-12348) update to parent 60

2024-06-05 Thread Joerg Hoh (Jira)
Joerg Hoh created SLING-12348:
-

 Summary: update to parent 60
 Key: SLING-12348
 URL: https://issues.apache.org/jira/browse/SLING-12348
 Project: Sling
  Issue Type: Task
  Components: Repoinit
Reporter: Joerg Hoh
 Fix For: Repoinit JCR 1.1.52






--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Re: [PR] SLING-12347 apply spotless formatting [sling-org-apache-sling-jcr-repoinit]

2024-06-05 Thread via GitHub


joerghoh merged PR #55:
URL: https://github.com/apache/sling-org-apache-sling-jcr-repoinit/pull/55


-- 
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: dev-unsubscr...@sling.apache.org

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



[jira] [Commented] (SLING-11906) Migrate to slf4j 2.x

2024-06-05 Thread Robert Munteanu (Jira)


[ 
https://issues.apache.org/jira/browse/SLING-11906?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852420#comment-17852420
 ] 

Robert Munteanu commented on SLING-11906:
-

[~reschke] - we don't have any other ticket besides this one.

> Migrate to slf4j 2.x
> 
>
> Key: SLING-11906
> URL: https://issues.apache.org/jira/browse/SLING-11906
> Project: Sling
>  Issue Type: Improvement
>Reporter: Eric Norman
>Assignee: Eric Norman
>Priority: Major
> Fix For: Commons Log 6.0.0
>
>
> Increasingly more libraries have been migrating to slf4j 2.x (for example 
> logback 1.3+, tika 2.5+ and jetty 10+)
> To be compatible with those, the sling commons log bundle should migrate to 
> slf4j v2.x (and logback v1.4.x or v1.3.x?)
> It looks like slf4j 2.x exports both 2.x and 1.7.36 versions of the exported 
> packages, so it should hopefully be compatible with existing bundles that are 
> importing the 1.x version of the slf4j packages.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Re: [PR] SLING-12346 : Create service-user-mapping analyser [sling-org-apache-sling-feature-analyser]

2024-06-05 Thread via GitHub


cziegeler commented on code in PR #45:
URL: 
https://github.com/apache/sling-org-apache-sling-feature-analyser/pull/45#discussion_r1627625668


##
pom.xml:
##
@@ -173,6 +179,12 @@
 1.9.0
 provided
 
+
+org.apache.sling
+org.apache.sling.serviceusermapper
+1.5.8
+provided
+

Review Comment:
   do you still need that dependency?



-- 
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: dev-unsubscr...@sling.apache.org

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



[jira] [Created] (SLING-12347) Apply spotless formatting

2024-06-05 Thread Joerg Hoh (Jira)
Joerg Hoh created SLING-12347:
-

 Summary: Apply spotless formatting
 Key: SLING-12347
 URL: https://issues.apache.org/jira/browse/SLING-12347
 Project: Sling
  Issue Type: Task
  Components: Repoinit
Reporter: Joerg Hoh
Assignee: Joerg Hoh
 Fix For: Repoinit JCR 1.1.52


as preparation for the update to parent 60



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (SLING-12262) Repoinit: report failures via metrics

2024-06-05 Thread Joerg Hoh (Jira)


 [ 
https://issues.apache.org/jira/browse/SLING-12262?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Joerg Hoh updated SLING-12262:
--
Fix Version/s: Repoinit JCR 1.1.52

> Repoinit: report failures via metrics
> -
>
> Key: SLING-12262
> URL: https://issues.apache.org/jira/browse/SLING-12262
> Project: Sling
>  Issue Type: Task
>  Components: Repoinit
>Affects Versions: Repoinit JCR 1.1.46
>Reporter: Joerg Hoh
>Assignee: Joerg Hoh
>Priority: Major
> Fix For: Repoinit JCR 1.1.52
>
>
> When a repoinit statement fails (and for that reason the SlingRepository 
> service cannot be started, repoinit should expose this as a metric.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (SLING-12264) check save() operations

2024-06-05 Thread Joerg Hoh (Jira)


 [ 
https://issues.apache.org/jira/browse/SLING-12264?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Joerg Hoh updated SLING-12264:
--
Fix Version/s: Repoinit JCR 1.1.52

> check save() operations
> ---
>
> Key: SLING-12264
> URL: https://issues.apache.org/jira/browse/SLING-12264
> Project: Sling
>  Issue Type: Task
>  Components: Repoinit
>Affects Versions: Repoinit JCR 1.1.46
>Reporter: Joerg Hoh
>Priority: Major
> Fix For: Repoinit JCR 1.1.52
>
>
> Before doing a session.save() operation, it should always be checked if there 
> is something to save at all. 
> This can speed up the execution of individual repoinit statements if the 
> repoinit statement does not need to be applied.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Re: [PR] SLING-12264 only call save() if there's something to save [sling-org-apache-sling-jcr-repoinit]

2024-06-05 Thread via GitHub


joerghoh merged PR #52:
URL: https://github.com/apache/sling-org-apache-sling-jcr-repoinit/pull/52


-- 
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: dev-unsubscr...@sling.apache.org

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



[jira] [Commented] (SLING-12264) check save() operations

2024-06-05 Thread Joerg Hoh (Jira)


[ 
https://issues.apache.org/jira/browse/SLING-12264?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17852396#comment-17852396
 ] 

Joerg Hoh commented on SLING-12264:
---

I created OAK-10862 for it, but for the time being I add this improvement.

> check save() operations
> ---
>
> Key: SLING-12264
> URL: https://issues.apache.org/jira/browse/SLING-12264
> Project: Sling
>  Issue Type: Task
>  Components: Repoinit
>Affects Versions: Repoinit JCR 1.1.46
>Reporter: Joerg Hoh
>Priority: Major
>
> Before doing a session.save() operation, it should always be checked if there 
> is something to save at all. 
> This can speed up the execution of individual repoinit statements if the 
> repoinit statement does not need to be applied.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


Re: [PR] SLING-12262 use a metric to indicate repoinit failures [sling-org-apache-sling-jcr-repoinit]

2024-06-05 Thread via GitHub


joerghoh merged PR #51:
URL: https://github.com/apache/sling-org-apache-sling-jcr-repoinit/pull/51


-- 
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: dev-unsubscr...@sling.apache.org

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



Re: [PR] SLING-12346 : Create service-user-mapping analyser [sling-org-apache-sling-feature-analyser]

2024-06-05 Thread via GitHub


anchela commented on PR #45:
URL: 
https://github.com/apache/sling-org-apache-sling-feature-analyser/pull/45#issuecomment-2149398028

   @cziegeler , i did a few test with snapshot bundle in AEM verifying that an 
invalid mapping is always spotted and deprecated mapping is spotted if 
warn-only flag is false.
   
   i simplified the mapping parsing as the import of the utility method from 
o.a.s.serviceusermapper bundle cause an exception and is not needed today.
   
   let me know if there is anything else you can see with the patch. feedback 
is very much appreciated as i am not super familiar with the analyse code base.


-- 
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: dev-unsubscr...@sling.apache.org

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



Re: [PR] SLING-12346 : Create service-user-mapping analyser [sling-org-apache-sling-feature-analyser]

2024-06-05 Thread via GitHub


sonarcloud[bot] commented on PR #45:
URL: 
https://github.com/apache/sling-org-apache-sling-feature-analyser/pull/45#issuecomment-2149323620

   ## [![Quality Gate 
Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png
 'Quality Gate 
Passed')](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-feature-analyser=45)
 **Quality Gate passed**  
   Issues  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [0 New 
issues](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-analyser=45=false=true)
  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png
 '') [0 Accepted 
issues](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-analyser=45=WONTFIX)
   
   Measures  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [0 Security 
Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature-analyser=45=false=true)
  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [96.4% Coverage on New 
Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-analyser=45=new_coverage=list)
  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [0.0% Duplication on New 
Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-analyser=45=new_duplicated_lines_density=list)
  
 
   [See analysis details on 
SonarCloud](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-feature-analyser=45)
   
   


-- 
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: dev-unsubscr...@sling.apache.org

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



Re: [PR] SLING-12346 : Create service-user-mapping analyser [sling-org-apache-sling-feature-analyser]

2024-06-05 Thread via GitHub


sonarcloud[bot] commented on PR #45:
URL: 
https://github.com/apache/sling-org-apache-sling-feature-analyser/pull/45#issuecomment-2149095776

   ## [![Quality Gate 
Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png
 'Quality Gate 
Passed')](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-feature-analyser=45)
 **Quality Gate passed**  
   Issues  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [3 New 
issues](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-analyser=45=false=true)
  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png
 '') [0 Accepted 
issues](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-analyser=45=WONTFIX)
   
   Measures  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [0 Security 
Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature-analyser=45=false=true)
  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [96.9% Coverage on New 
Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-analyser=45=new_coverage=list)
  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [0.0% Duplication on New 
Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-analyser=45=new_duplicated_lines_density=list)
  
 
   [See analysis details on 
SonarCloud](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-feature-analyser=45)
   
   


-- 
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: dev-unsubscr...@sling.apache.org

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



Re: [PR] SLING-12346 : Create service-user-mapping analyser [sling-org-apache-sling-feature-analyser]

2024-06-05 Thread via GitHub


sonarcloud[bot] commented on PR #45:
URL: 
https://github.com/apache/sling-org-apache-sling-feature-analyser/pull/45#issuecomment-2149093778

   ## [![Quality Gate 
Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png
 'Quality Gate 
Passed')](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-feature-analyser=45)
 **Quality Gate passed**  
   Issues  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [3 New 
issues](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-analyser=45=false=true)
  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png
 '') [0 Accepted 
issues](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-analyser=45=WONTFIX)
   
   Measures  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [0 Security 
Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature-analyser=45=false=true)
  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [96.9% Coverage on New 
Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-analyser=45=new_coverage=list)
  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [0.0% Duplication on New 
Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-analyser=45=new_duplicated_lines_density=list)
  
 
   [See analysis details on 
SonarCloud](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-feature-analyser=45)
   
   


-- 
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: dev-unsubscr...@sling.apache.org

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



Re: [PR] SLING-12346 : Create service-user-mapping analyser [sling-org-apache-sling-feature-analyser]

2024-06-05 Thread via GitHub


anchela commented on PR #45:
URL: 
https://github.com/apache/sling-org-apache-sling-feature-analyser/pull/45#issuecomment-2149092105

   @cziegeler , thanks for the review. i refactored the code accordingly.


-- 
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: dev-unsubscr...@sling.apache.org

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



Re: [PR] SLING-12346 : Create service-user-mapping analyser [sling-org-apache-sling-feature-analyser]

2024-06-05 Thread via GitHub


anchela commented on code in PR #45:
URL: 
https://github.com/apache/sling-org-apache-sling-feature-analyser/pull/45#discussion_r1627157822


##
src/main/java/org/apache/sling/feature/analyser/task/impl/CheckServiceUserMapping.java:
##
@@ -0,0 +1,161 @@
+/*
+ * 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.analyser.task.impl;
+
+import org.apache.sling.feature.Configuration;
+import org.apache.sling.feature.Configurations;
+import org.apache.sling.feature.analyser.task.AnalyserTask;
+import org.apache.sling.feature.analyser.task.AnalyserTaskContext;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.osgi.util.converter.Converters;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Set;
+
+public class CheckServiceUserMapping implements AnalyserTask {
+
+static final String SERVICE_USER_MAPPING_PID = 
"org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl";
+
+static final String FACTORY_PID = 
"org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended";
+
+static final String USER_MAPPING = "user.mapping";
+
+static final String CFG_WARN_ONLY_FOR_DEPRECATED_MAPPINGS = 
"warnOnlyForDeprecatedMappings";
+static final String CFG_WARN_ONLY_FOR_DEPRECATED_MAPPINGS_DEFAULT = 
Boolean.FALSE.toString();
+
+private static final Logger log = 
LoggerFactory.getLogger(CheckServiceUserMapping.class);
+
+@Override
+public String getName() {
+return "Service User Mapping Check";
+}
+
+@Override
+public String getId() {

Review Comment:
   ok thanks. i replace it with "serviceusermapping" as the task itself and the 
name uses mapping in singular.



-- 
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: dev-unsubscr...@sling.apache.org

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



Re: [PR] SLING-12346 : Create service-user-mapping analyser [sling-org-apache-sling-feature-analyser]

2024-06-05 Thread via GitHub


anchela commented on code in PR #45:
URL: 
https://github.com/apache/sling-org-apache-sling-feature-analyser/pull/45#discussion_r1627144277


##
src/main/java/org/apache/sling/feature/analyser/task/impl/CheckServiceUserMapping.java:
##
@@ -0,0 +1,161 @@
+/*
+ * 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.analyser.task.impl;
+
+import org.apache.sling.feature.Configuration;
+import org.apache.sling.feature.Configurations;
+import org.apache.sling.feature.analyser.task.AnalyserTask;
+import org.apache.sling.feature.analyser.task.AnalyserTaskContext;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.osgi.util.converter.Converters;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Set;
+
+public class CheckServiceUserMapping implements AnalyserTask {
+
+static final String SERVICE_USER_MAPPING_PID = 
"org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl";
+
+static final String FACTORY_PID = 
"org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended";
+
+static final String USER_MAPPING = "user.mapping";
+
+static final String CFG_WARN_ONLY_FOR_DEPRECATED_MAPPINGS = 
"warnOnlyForDeprecatedMappings";
+static final String CFG_WARN_ONLY_FOR_DEPRECATED_MAPPINGS_DEFAULT = 
Boolean.FALSE.toString();
+
+private static final Logger log = 
LoggerFactory.getLogger(CheckServiceUserMapping.class);
+
+@Override
+public String getName() {
+return "Service User Mapping Check";
+}
+
+@Override
+public String getId() {
+return SERVICE_USER_MAPPING_PID;
+}
+
+@Override
+public void execute(final AnalyserTaskContext ctx) {
+final boolean warnOnlyForDeprecation = 
Boolean.parseBoolean(ctx.getConfiguration().getOrDefault(CFG_WARN_ONLY_FOR_DEPRECATED_MAPPINGS,
 CFG_WARN_ONLY_FOR_DEPRECATED_MAPPINGS_DEFAULT));
+
+// configuration
+Configurations configurations = ctx.getFeature().getConfigurations();
+final Configuration cfg = 
configurations.getConfiguration(SERVICE_USER_MAPPING_PID);
+if (cfg != null) {
+check(ctx, cfg, warnOnlyForDeprecation);
+}
+for (final Configuration c : 
configurations.getFactoryConfigurations(FACTORY_PID)) {
+check(ctx, c, warnOnlyForDeprecation);
+}
+}
+
+private static void check(final AnalyserTaskContext ctx, final 
Configuration cfg, final boolean warnOnlyForDeprecation) {
+final Object val = cfg.getConfigurationProperties().get(USER_MAPPING);
+if (val != null) {
+final String[] mappings = 
Converters.standardConverter().convert(val).to(String[].class);
+for (final String spec : mappings) {
+check(ctx, cfg, spec, warnOnlyForDeprecation);
+}
+}
+}
+
+private static void check(final @NotNull AnalyserTaskContext ctx, final 
@NotNull Configuration cfg, final @Nullable String spec, final boolean 
warnOnlyForDeprecation) {
+final String id = cfg.getPid();
+if (spec == null || spec.trim().isEmpty()) {
+log.warn("Ignoring empty mapping in {}", id);

Review Comment:
   good point! thanks. i replaced all usages of the logger with configuration 
warning. so for the invalid mappings there will be a warning elaborating why 
the mapping is invalid followed by an error that the mapping statement in 
configuration x for pid y is invalid



-- 
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: dev-unsubscr...@sling.apache.org

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



Re: [PR] SLING-12346 : Create service-user-mapping analyser [sling-org-apache-sling-feature-analyser]

2024-06-05 Thread via GitHub


cziegeler commented on PR #45:
URL: 
https://github.com/apache/sling-org-apache-sling-feature-analyser/pull/45#issuecomment-2149040568

   PR looks good to me, I added two minor comments


-- 
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: dev-unsubscr...@sling.apache.org

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



Re: [PR] SLING-12346 : Create service-user-mapping analyser [sling-org-apache-sling-feature-analyser]

2024-06-05 Thread via GitHub


cziegeler commented on code in PR #45:
URL: 
https://github.com/apache/sling-org-apache-sling-feature-analyser/pull/45#discussion_r1627109054


##
src/main/java/org/apache/sling/feature/analyser/task/impl/CheckServiceUserMapping.java:
##
@@ -0,0 +1,161 @@
+/*
+ * 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.analyser.task.impl;
+
+import org.apache.sling.feature.Configuration;
+import org.apache.sling.feature.Configurations;
+import org.apache.sling.feature.analyser.task.AnalyserTask;
+import org.apache.sling.feature.analyser.task.AnalyserTaskContext;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.osgi.util.converter.Converters;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Set;
+
+public class CheckServiceUserMapping implements AnalyserTask {
+
+static final String SERVICE_USER_MAPPING_PID = 
"org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl";
+
+static final String FACTORY_PID = 
"org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended";
+
+static final String USER_MAPPING = "user.mapping";
+
+static final String CFG_WARN_ONLY_FOR_DEPRECATED_MAPPINGS = 
"warnOnlyForDeprecatedMappings";
+static final String CFG_WARN_ONLY_FOR_DEPRECATED_MAPPINGS_DEFAULT = 
Boolean.FALSE.toString();
+
+private static final Logger log = 
LoggerFactory.getLogger(CheckServiceUserMapping.class);
+
+@Override
+public String getName() {
+return "Service User Mapping Check";
+}
+
+@Override
+public String getId() {
+return SERVICE_USER_MAPPING_PID;
+}
+
+@Override
+public void execute(final AnalyserTaskContext ctx) {
+final boolean warnOnlyForDeprecation = 
Boolean.parseBoolean(ctx.getConfiguration().getOrDefault(CFG_WARN_ONLY_FOR_DEPRECATED_MAPPINGS,
 CFG_WARN_ONLY_FOR_DEPRECATED_MAPPINGS_DEFAULT));
+
+// configuration
+Configurations configurations = ctx.getFeature().getConfigurations();
+final Configuration cfg = 
configurations.getConfiguration(SERVICE_USER_MAPPING_PID);
+if (cfg != null) {
+check(ctx, cfg, warnOnlyForDeprecation);
+}
+for (final Configuration c : 
configurations.getFactoryConfigurations(FACTORY_PID)) {
+check(ctx, c, warnOnlyForDeprecation);
+}
+}
+
+private static void check(final AnalyserTaskContext ctx, final 
Configuration cfg, final boolean warnOnlyForDeprecation) {
+final Object val = cfg.getConfigurationProperties().get(USER_MAPPING);
+if (val != null) {
+final String[] mappings = 
Converters.standardConverter().convert(val).to(String[].class);
+for (final String spec : mappings) {
+check(ctx, cfg, spec, warnOnlyForDeprecation);
+}
+}
+}
+
+private static void check(final @NotNull AnalyserTaskContext ctx, final 
@NotNull Configuration cfg, final @Nullable String spec, final boolean 
warnOnlyForDeprecation) {
+final String id = cfg.getPid();
+if (spec == null || spec.trim().isEmpty()) {
+log.warn("Ignoring empty mapping in {}", id);

Review Comment:
   while its not wrong to use a normal logger, I suggest to log this as a 
warning via the context. This gives the full information in one place



-- 
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: dev-unsubscr...@sling.apache.org

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



Re: [PR] SLING-12346 : Create service-user-mapping analyser [sling-org-apache-sling-feature-analyser]

2024-06-05 Thread via GitHub


sonarcloud[bot] commented on PR #45:
URL: 
https://github.com/apache/sling-org-apache-sling-feature-analyser/pull/45#issuecomment-2149034404

   ## [![Quality Gate 
Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png
 'Quality Gate 
Passed')](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-feature-analyser=45)
 **Quality Gate passed**  
   Issues  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [3 New 
issues](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-analyser=45=false=true)
  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png
 '') [0 Accepted 
issues](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-analyser=45=WONTFIX)
   
   Measures  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [0 Security 
Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature-analyser=45=false=true)
  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [97.0% Coverage on New 
Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-analyser=45=new_coverage=list)
  
   
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png
 '') [0.0% Duplication on New 
Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-analyser=45=new_duplicated_lines_density=list)
  
 
   [See analysis details on 
SonarCloud](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-feature-analyser=45)
   
   


-- 
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: dev-unsubscr...@sling.apache.org

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



Re: [PR] SLING-12346 : Create service-user-mapping analyser [sling-org-apache-sling-feature-analyser]

2024-06-05 Thread via GitHub


cziegeler commented on code in PR #45:
URL: 
https://github.com/apache/sling-org-apache-sling-feature-analyser/pull/45#discussion_r1627106283


##
src/main/java/org/apache/sling/feature/analyser/task/impl/CheckServiceUserMapping.java:
##
@@ -0,0 +1,161 @@
+/*
+ * 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.analyser.task.impl;
+
+import org.apache.sling.feature.Configuration;
+import org.apache.sling.feature.Configurations;
+import org.apache.sling.feature.analyser.task.AnalyserTask;
+import org.apache.sling.feature.analyser.task.AnalyserTaskContext;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.osgi.util.converter.Converters;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Set;
+
+public class CheckServiceUserMapping implements AnalyserTask {
+
+static final String SERVICE_USER_MAPPING_PID = 
"org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl";
+
+static final String FACTORY_PID = 
"org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended";
+
+static final String USER_MAPPING = "user.mapping";
+
+static final String CFG_WARN_ONLY_FOR_DEPRECATED_MAPPINGS = 
"warnOnlyForDeprecatedMappings";
+static final String CFG_WARN_ONLY_FOR_DEPRECATED_MAPPINGS_DEFAULT = 
Boolean.FALSE.toString();
+
+private static final Logger log = 
LoggerFactory.getLogger(CheckServiceUserMapping.class);
+
+@Override
+public String getName() {
+return "Service User Mapping Check";
+}
+
+@Override
+public String getId() {

Review Comment:
   The id is usually a short name that is used to reference the analyser, e.g. 
in a maven pom, e.g. "serviceusermappings"



-- 
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: dev-unsubscr...@sling.apache.org

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



[PR] SLING-12346 : Create service-user-mapping analyser [sling-org-apache-sling-feature-analyser]

2024-06-05 Thread via GitHub


anchela opened a new pull request, #45:
URL: https://github.com/apache/sling-org-apache-sling-feature-analyser/pull/45

   hi @cziegeler , @karlpauls , i gave it a try to implement a feature analyser 
for service user mapping configurations. that allows to spot invalid and 
deprecated mappings. for the latter the idea would be to have a configuration 
option to either report an error or only a warning.
   
   since i have very limited experience with the feature analysers, i would 
appreciate if you could take a close look and let me know if anything is 
missing/wrong.
   in particular, i didn't find where the configuration option for the 
deprecated mappings would be set in the context of AEM. in the feature analyser 
I concluded that it's through config properties on AnalyserTaskContextImpl. 


-- 
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: dev-unsubscr...@sling.apache.org

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



[jira] [Assigned] (SLING-12346) Create service-user-mapping analyser

2024-06-05 Thread Angela Schreiber (Jira)


 [ 
https://issues.apache.org/jira/browse/SLING-12346?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Angela Schreiber reassigned SLING-12346:


Assignee: Angela Schreiber

> Create service-user-mapping analyser
> 
>
> Key: SLING-12346
> URL: https://issues.apache.org/jira/browse/SLING-12346
> Project: Sling
>  Issue Type: New Feature
>  Components: Feature Model, Maven Plugins and Archetypes
>Reporter: Angela Schreiber
>Assignee: Angela Schreiber
>Priority: Major
>
> based on a discussion with [~joerghoh], i would like to suggest that we 
> create a dedicated analyser for service-user-mappings.
> This feature would include the following 2 checks:
> - validity of service-user-mapping 
> - usage of deprecated service user mapping format 
> The second part should be enabled through configuration.
> [~cziegeler], [~kpauls], i would give it a try borrowing from existing 
> analysers but i will likely need input from your side to not spend too much 
> time on figuring out details i might have missed.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)