Re: [PR] SLING-10288 - FelixFrameworkScanner sets framework properties always for current Java version [sling-org-apache-sling-feature-analyser]
rombert merged PR #47: URL: https://github.com/apache/sling-org-apache-sling-feature-analyser/pull/47 -- 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-10288 - FelixFrameworkScanner sets framework properties always for current Java version [sling-org-apache-sling-feature-analyser]
sonarcloud[bot] commented on PR #47: URL: https://github.com/apache/sling-org-apache-sling-feature-analyser/pull/47#issuecomment-2173938846 ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-feature-analyser=47) **Quality Gate failed** Failed conditions ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [66.3% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-analyser=47=new_coverage=list) (required ≥ 80%) [See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-feature-analyser=47) -- 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-10288 - FelixFrameworkScanner sets framework properties always for current Java version [sling-org-apache-sling-feature-analyser]
rombert commented on PR #47: URL: https://github.com/apache/sling-org-apache-sling-feature-analyser/pull/47#issuecomment-2165813375 For now we can't merge as-is. Existing analysers will because they will be unable to parse the "system.bundle" entry, which is not a valid artifact id. I need to find a solution that allows working with older versions. Options (untested): - use "org.apache.felix:org.apache.felix.framework:0" key, because that one is never listed as a bundle - use a "reserved:system.bundle:0.0.0" value (or similar), to make it clear that this is not an actual artifact id, but an "extension" -- 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-10288 - FelixFrameworkScanner sets framework properties always for current Java version [sling-org-apache-sling-feature-analyser]
sonarcloud[bot] commented on PR #47: URL: https://github.com/apache/sling-org-apache-sling-feature-analyser/pull/47#issuecomment-2165167175 ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-feature-analyser=47) **Quality Gate failed** Failed conditions ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [41.5% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-analyser=47=new_coverage=list) (required ≥ 80%) [See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-feature-analyser=47) -- 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-10288 - FelixFrameworkScanner sets framework properties always for current Java version [sling-org-apache-sling-feature-analyser]
sonarcloud[bot] commented on PR #47: URL: https://github.com/apache/sling-org-apache-sling-feature-analyser/pull/47#issuecomment-2165535521 ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-feature-analyser=47) **Quality Gate failed** Failed conditions ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [63.6% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-analyser=47=new_coverage=list) (required ≥ 80%) [See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-feature-analyser=47) -- 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-10288 - FelixFrameworkScanner sets framework properties always for current Java version [sling-org-apache-sling-feature-analyser]
rombert commented on PR #47: URL: https://github.com/apache/sling-org-apache-sling-feature-analyser/pull/47#issuecomment-2165453415 I think this is ready for review. I performed some manual tests in the following way: **Patched Sling Starter** ```patchdiff --git a/pom.xml b/pom.xml index da6dfa7..9350d1c 100644 --- a/pom.xml +++ b/pom.xml @@ -93,6 +93,13 @@ slingfeature-maven-plugin 1.8.2 true + + +org.apache.sling + org.apache.sling.feature.analyser +2.0.5-SNAPSHOT + + asm.version,jackrabbit.version,groovy.version,oak.version,slf4j.version,composum.nodes.version,jackson.version @@ -102,6 +109,7 @@ oak/*.json oak/persistence/oak_persistence_sns.json app/*.json + metadata/metadata.json Sling With Oak Segment NS Persistence @@ -110,12 +118,14 @@ oak/*.json oak/persistence/oak_persistence_mongods.json app/*.json + metadata/metadata.json Sling With Oak Document NS Mongo Persistence nosample_base *.json oak/*.json + metadata/metadata.json Sling With No Samples and No Persistence diff --git a/src/main/features/base.json b/src/main/features/base.json index 3ed7dfd..c2360c7 100644 --- a/src/main/features/base.json +++ b/src/main/features/base.json @@ -3,8 +3,9 @@ "execution-environment:JSON|false":{ "framework":{ "id":"org.apache.felix:org.apache.felix.framework:7.0.5" -} -}, +}, +"javaVersion": "21" +}, "bundles":[ { "id":"org.owasp.encoder:encoder:1.2.3", diff --git a/src/main/features/metadata/metadata.json b/src/main/features/metadata/metadata.json new file mode 100644 index 000..ba2927f --- /dev/null +++ b/src/main/features/metadata/metadata.json @@ -0,0 +1,13 @@ +{ +"analyser-metadata:JSON|true": +{ + ".*" : { +"manifest": null, +"report": { + "error": false, + "warning": false +} + }, + "system.bundle": { } +} +} \ No newline at end of file ``` This way we record the execution metadata **Sample Sling bundle** Configured a Sling bundle to output Java 17 bytecode ```xml org.apache.maven.plugins maven-compiler-plugin 17 17 ``` **Sample Sling Launcher** Configured a Sling launcher to include the above bundle and to extend from the Sling Starter, so that the system bundle metadata is read. The launcher includes the above bundle, to make sure the checks work as expected. 1. When the Starter is built with Java 11 and the launcher is built with Java 11, the build fails ( Artifact com.example:core:1.0-SNAPSHOT requires [com.example.core/1.0.0.SNAPSHOT] osgi.ee; filter:="(&(osgi.ee=JavaSE)(version=17))" in start level 20 but no artifact is providing a matching capability in this start level. ) 2. When the Starter is built with Java 17 or 21 and the launcher is built with Java 11, the build passes -- 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-10288 - FelixFrameworkScanner sets framework properties always for current Java version [sling-org-apache-sling-feature-analyser]
sonarcloud[bot] commented on PR #47: URL: https://github.com/apache/sling-org-apache-sling-feature-analyser/pull/47#issuecomment-2165172323 ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-feature-analyser=47) **Quality Gate failed** Failed conditions ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [46.3% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-analyser=47=new_coverage=list) (required ≥ 80%) [See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-feature-analyser=47) -- 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-10288 - FelixFrameworkScanner sets framework properties always for current Java version [sling-org-apache-sling-feature-analyser]
sonarcloud[bot] commented on PR #47: URL: https://github.com/apache/sling-org-apache-sling-feature-analyser/pull/47#issuecomment-2163602568 ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-feature-analyser=47) **Quality Gate failed** Failed conditions ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [39.4% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-analyser=47=new_coverage=list) (required ≥ 80%) [See analysis details on SonarCloud](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-feature-analyser=47) -- 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-10288 - FelixFrameworkScanner sets framework properties always for current Java version [sling-org-apache-sling-feature-analyser]
kwin commented on code in PR #47: URL: https://github.com/apache/sling-org-apache-sling-feature-analyser/pull/47#discussion_r1636650096 ## readme.md: ## @@ -138,9 +147,19 @@ A typical configuration for platform applications is: "error": false, "warning": false } - } + }, + "system.bundle": {} +}, + "framework":{ + "id":"org.apache.felix:org.apache.felix.framework:7.0.5" + }, + "javaVersion": "21" } } ``` -This ensures that warnings related to the platform are not reported when the feature is aggregated with downstream (consumer) applications. The manifests should not be inlined under normal circumstances, since it greatly increases the size of the resulting features. +This ensures that + +- warnings related to the platform are not reported when the feature is aggregated with downstream (consumer) applications. The manifests should not be inlined under normal circumstances, since it greatly increases the size of the resulting features. +- metadata related to the system bundle is recorded at the Java 21 compatibility level Review Comment: Sorry, I missed the right context here. This refers to the concrete example so is totally fine -- 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-10288 - FelixFrameworkScanner sets framework properties always for current Java version [sling-org-apache-sling-feature-analyser]
rombert commented on code in PR #47: URL: https://github.com/apache/sling-org-apache-sling-feature-analyser/pull/47#discussion_r1636574972 ## readme.md: ## @@ -138,9 +147,19 @@ A typical configuration for platform applications is: "error": false, "warning": false } - } + }, + "system.bundle": {} +}, + "framework":{ + "id":"org.apache.felix:org.apache.felix.framework:7.0.5" + }, + "javaVersion": "21" } } ``` -This ensures that warnings related to the platform are not reported when the feature is aggregated with downstream (consumer) applications. The manifests should not be inlined under normal circumstances, since it greatly increases the size of the resulting features. +This ensures that + +- warnings related to the platform are not reported when the feature is aggregated with downstream (consumer) applications. The manifests should not be inlined under normal circumstances, since it greatly increases the size of the resulting features. +- metadata related to the system bundle is recorded at the Java 21 compatibility level Review Comment: This is a recommentation for platforms, like the Sling Starter. Perhaps it would be better worded as an example, because we now define Java 21 and that may not be the case for everyone. The metadata is recorded with the Java 21 level because that is what is defined in the execution-environment extension. If the aggregation is executed with Java 11 then it will fail. Note that we have two phases in which the analyser metadata comes into play: - aggregation, when the metadata is recorded - validation, when the metadata is used On aggregation this sample configuration _requires_ Java 21. On validation this configuration will make sure that bundle requirements are validated against Java 21. Following up on the Sling Starter, this would be applicable when building a project that imports a Sling Starter aggregated feature (like oak_tar ) and building with a Java version != 21. At that point the validators will use the Java 21 metadata. -- 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-10288 - FelixFrameworkScanner sets framework properties always for current Java version [sling-org-apache-sling-feature-analyser]
kwin commented on code in PR #47: URL: https://github.com/apache/sling-org-apache-sling-feature-analyser/pull/47#discussion_r1636549320 ## readme.md: ## @@ -138,9 +147,19 @@ A typical configuration for platform applications is: "error": false, "warning": false } - } + }, + "system.bundle": {} +}, + "framework":{ + "id":"org.apache.felix:org.apache.felix.framework:7.0.5" + }, + "javaVersion": "21" } } ``` -This ensures that warnings related to the platform are not reported when the feature is aggregated with downstream (consumer) applications. The manifests should not be inlined under normal circumstances, since it greatly increases the size of the resulting features. +This ensures that + +- warnings related to the platform are not reported when the feature is aggregated with downstream (consumer) applications. The manifests should not be inlined under normal circumstances, since it greatly increases the size of the resulting features. +- metadata related to the system bundle is recorded at the Java 21 compatibility level Review Comment: why is that? Depends on where the feature is being executed, isn't 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
[PR] SLING-10288 - FelixFrameworkScanner sets framework properties always for current Java version [sling-org-apache-sling-feature-analyser]
rombert opened a new pull request, #47: URL: https://github.com/apache/sling-org-apache-sling-feature-analyser/pull/47 First draft of the fix for SLING-102888, up for discussion. There are some implementations improvements that still need to to be applied ( testing, duplication, unintended reformatting ), but I wanted to check if I'm going in the right direction, at least with regards to: - using the `system.bundle` key for configuration / storage; I am trying to keep compatibility with metadata extensions that are already generated - using info from the execution-environment to configure the system bundle metadata - the way the capabilities and exported packages are persisted and read; I already wrote off `org.apache.felix.utils.manifest.Parser.parseHeader` (as inlined in the feature analyser ) as not preserving the type information for versions. -- 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