acs-aem-commons icon indicating copy to clipboard operation
acs-aem-commons copied to clipboard

Set web console name hints for all configuration factories

Open kwin opened this issue 6 years ago • 7 comments

All the @Designate annotations with factory=true attribute should be accompanied by an according property named webconsole.configurationFactory.nameHint. Otherwise the individual instances cannot be easily distinguished in the Felix Web Console. For further information look at http://felix.apache.org/documentation/subprojects/apache-felix-web-console.html#configuration-factories.

This currently affects the following classes

  1. CombinedCacheConfigExtension.java - acs-aem-commons-bundle/src/main/java/com/adobe/acs/commons/httpcache/config/impl
  2. DelegatingServletFactoryImpl.java - acs-aem-commons-bundle/src/main/java/com/adobe/acs/commons/util/impl (non-existing property {prop.target-resource-type} referenced)
  3. DispatcherFlushRulesImpl.java - acs-aem-commons-bundle/src/main/java/com/adobe/acs/commons/replication/dispatcher/impl (non-existing property {prop.replication-action-type} referenced)
  4. EnsureOakIndex.java - acs-aem-commons-bundle/src/main/java/com/adobe/acs/commons/oak/impl (non-existing property {ensure-definitions.path} referenced)
  5. GroupHttpCacheConfigExtension.java - acs-aem-commons-bundle/src/main/java/com/adobe/acs/commons/httpcache/config/impl (non-existing property {httpcache.config.extension.user-groups.allowed} referenced, also the meaning of property "configName" is unclear)
  6. HealthCheckStatusEmailer.java - acs-aem-commons-bundle/src/main/java/com/adobe/acs/commons/hc/impl (non-existing property {recipients.email-addresses} referenced)
  7. HttpCacheConfigImpl.java - acs-aem-commons-bundle/src/main/java/com/adobe/acs/commons/httpcache/config/impl
  8. HttpClientFactoryImpl.java - acs-aem-commons-bundle/src/main/java/com/adobe/acs/commons/http/impl
  9. MonthlyExpiresHeaderFilter.java - acs-aem-commons-bundle/src/main/java/com/adobe/acs/commons/http/headers/impl (non-existing property {expires.day-of-month} referenced)
  10. PageRootProviderConfig.java - acs-aem-commons-bundle/src/main/java/com/adobe/acs/commons/wcm/impl
  11. ResourceTypeHttpCacheConfigExtension.java - acs-aem-commons-bundle/src/main/java/com/adobe/acs/commons/httpcache/config/impl (non-existing property {httpcache.config.extension.resource-types.allowed} referenced)
  12. WeeklyExpiresHeaderFilter.java - acs-aem-commons-bundle/src/main/java/com/adobe/acs/commons/http/headers/impl (non-existing property {expires.day-of-week} referenced)

kwin avatar Jan 28 '19 14:01 kwin

It would be nice if these would be caught by the upcoming version of the osgicheck-maven-plugin. I opened https://issues.apache.org/jira/browse/FELIX-6039 to track that.

kwin avatar Jan 28 '19 14:01 kwin

Closing as we are reverting back to SCR: https://github.com/Adobe-Consulting-Services/acs-aem-commons/issues/1741

davidjgonzalez avatar Feb 08 '19 16:02 davidjgonzalez

@davidjgonzalez Even with Felix SCR annotations not all configuration factories have proper name hints. Can you please reopen?

kwin avatar Feb 11 '19 08:02 kwin

@kwin as far as I can tell, the only open issues are the Combined* HttpCache features, and it looks like those are going to be removed. Do you see any other cases of missing/invalid name hints?

justinedelson avatar Feb 11 '19 12:02 justinedelson

@justinedelson @kwin - I fixed a test for HttpCache on https://github.com/Adobe-Consulting-Services/acs-aem-commons/pull/1749 and just removed the Combined* code for 4.0.0 and logged https://github.com/Adobe-Consulting-Services/acs-aem-commons/issues/1750 to re-add later.

You can see the name hints on the HttpCache extensions in the screenshots in https://github.com/Adobe-Consulting-Services/acs-aem-commons/pull/1749

davidjgonzalez avatar Feb 11 '19 14:02 davidjgonzalez

I've also added some code to the ScrMetadataIT that tests that (a) all factories set a nameHint and (b) all variables referred to by the nameHint are defined.

justinedelson avatar Feb 11 '19 17:02 justinedelson

The test added in https://github.com/Adobe-Consulting-Services/acs-aem-commons/commit/4b3da3f5fdf0b59049b966bea9306d24c87d0293 does not work for component descriptors being generated by the Felix SCR generator, as those always contain Designate elements with both attributes pid and factoryPid e.g.

<Designate pid="com.adobe.acs.commons.http.impl.HttpClientFactoryImpl" factoryPid="com.adobe.acs.commons.http.impl.HttpClientFactoryImpl">
        <Object ocdref="com.adobe.acs.commons.http.impl.HttpClientFactoryImpl"/>
    </Designate>

while in fact only factoryPid should be generated. That leads to the fact that those are not detected as factories properly by the ScrMetadataIT. Most are still missing the nameHint property

kwin avatar Nov 10 '23 20:11 kwin