You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by gh...@apache.org on 2019/04/03 22:46:09 UTC

[sling-site] branch master updated: SLING-7980 improved documentation

This is an automated email from the ASF dual-hosted git repository.

ghenzler pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-site.git


The following commit(s) were added to refs/heads/master by this push:
     new c78d22e  SLING-7980 improved documentation
     new 4d6afb9  Merge branch 'master' of git@github.com:apache/sling-site.git
c78d22e is described below

commit c78d22e49a9210dc6561812daee6dbf6c036ef02
Author: georg.henzler <ge...@netcentric.biz>
AuthorDate: Wed Apr 3 20:32:51 2019 +0200

    SLING-7980 improved documentation
---
 .../bundles/sling-health-check-tool-deprecated.md  | 12 --------
 .../bundles/sling-health-check-tool.md             | 11 +++++--
 .../documentation/bundles/sling-health-checks.md   | 35 ++++++++++++++++++++++
 3 files changed, 43 insertions(+), 15 deletions(-)

diff --git a/src/main/jbake/content/documentation/bundles/sling-health-check-tool-deprecated.md b/src/main/jbake/content/documentation/bundles/sling-health-check-tool-deprecated.md
index 5964050..83109ec 100644
--- a/src/main/jbake/content/documentation/bundles/sling-health-check-tool-deprecated.md
+++ b/src/main/jbake/content/documentation/bundles/sling-health-check-tool-deprecated.md
@@ -216,15 +216,3 @@ Note that by design **the Health Checks Servlet doesn't do any access control by
 
 By default the HC servlet sends the CORS header `Access-Control-Allow-Origin: *` to allow for client-side browser integrations. The behaviour can be configured using the OSGi config property `cors.accessControlAllowOrigin` (a blank value disables the header).
 
-## Health Checks as server-side JUnit tests
-The `org.apache.sling.hc.junit.bridge` bundle makes selected Health Checks available as server-side JUnit tests. 
-
-It requires the `org.apache.sling.junit.core bundle` which provides the server-side JUnit tests infrastructure.
-
-The idea is to implement the smoke tests of your system, for example, as health checks. You can then run them
-as part of integration testing, using the  [Sling Testing Tools](/documentation/development/sling-testing-tools.html)  
-remote testing utilities, and also as plain Health Checks for monitoring or troubleshooting Sling instances.
-
-To use this module, configure sets of tags at `/system/console/configMgr/org.apache.sling.hc.junitbridge.HealthCheckTestsProvider`
-using the standard `includeThisTag,-omitThatTag` syntax, and JUnit tests will be available at /system/sling/junit/HealthChecks.html 
-to run the corresponding Health Checks.
diff --git a/src/main/jbake/content/documentation/bundles/sling-health-check-tool.md b/src/main/jbake/content/documentation/bundles/sling-health-check-tool.md
index 50acdb1..0dc2720 100644
--- a/src/main/jbake/content/documentation/bundles/sling-health-check-tool.md
+++ b/src/main/jbake/content/documentation/bundles/sling-health-check-tool.md
@@ -4,7 +4,7 @@ status=published
 tags=healthchecks,operations
 ~~~~~~
 
-**Sling Health Checks are deprecated** and superseded by [Felix Health Checks](http://felix.apache.org/documentation/subprojects/apache-felix-healthchecks.html). See [Sling Health Check Tools (deprecated)](sling-health-check-tool-deprecated.html) for documentation prior to deprecation.
+**The Sling Health Check Runtime is deprecated** and superseded by [Felix Health Checks](http://felix.apache.org/documentation/subprojects/apache-felix-healthchecks.html). See [Sling Health Check Tools (deprecated)](sling-health-check-tool-deprecated.html) for documentation prior to deprecation and [Sling Health Checks](sling-health-checks.html) for checks implemented against the Felix Health Checks Runtime.
 
 ## Migrate custom checks
 
@@ -29,16 +29,21 @@ tags=healthchecks,operations
         
 ### Adjust Health Check Code
 
+Typically necessary steps:
+
 * Use the `Organize Imports` functionality of your IDE to fix the imports (mostly it is just replacing `org.apache.sling.hc.api` with `org.apache.felix.hc.api`, however the commonly used class `FormattingResultLog` has been moved from `org.apache.sling.hc.util` to `org.apache.felix.hc.api`)
-* For the case the annotation `@SlingHealthCheck` is used, replace that one with the new Felix annotations from [org.apache.felix.healthcheck.annotation](http://svn.apache.org/viewvc/felix/trunk/healthcheck/annotation/src/main/java/org/apache/felix/hc/annotation/)
+* For the case the annotation `@SlingHealthCheck` is used, replace that one with the new Felix annotations from [org.apache.felix.healthcheck.annotation](https://github.com/apache/felix/blob/trunk/healthcheck/README.md#annotations-to-simplify-configuration-of-custom-health-checks)
 * There is no `util` package in the api bundle anymore, apart from `FormattingResultLog` the other classes in the package were rarely used. The class `SimpleConstraintChecker` has moved to `org.apache.felix.hc.generalchecks.util` in bundle `generalchecks` (maven dependency to `org.apache.felix.healthcheck.generalchecks` needs to be added for that case). For the other classes there is no replacement.
+
+Only necessary if the the respective feature is used:
+
 * For the case the property `hc.async.cronExpression` is used, the bundle `org.apache.servicemix.bundles.quartz` needs to be available at runtime (as alternative it is possible to use `hc.async.intervalInSec` now)
 * For Health Checks using property `hc.warningsStickForMinutes`, this has been renamed to `hc.keepNonOkResultsStickyForSec` - here the unit has changed from min to sec in order to allow for second-magnitude values that can be useful for deployment scenarios
 
 
 ## Migrate a runtime
 
-* `org.apache.sling.hc.api` - keep to ensure bundles with checks that are not yet migrated work
+* `org.apache.sling.hc.api` - keep to ensure bundles with checks that are not yet migrated work (can be removed once all bundles are migrated to new API)
 * `org.apache.sling.hc.core` - remove
 * `org.apache.sling.hc.webconsole` - remove
 * `org.apache.sling.hc.support` - keep, Sling specific health checks that don't fit anywhere else go there
diff --git a/src/main/jbake/content/documentation/bundles/sling-health-checks.md b/src/main/jbake/content/documentation/bundles/sling-health-checks.md
new file mode 100644
index 0000000..e046088
--- /dev/null
+++ b/src/main/jbake/content/documentation/bundles/sling-health-checks.md
@@ -0,0 +1,35 @@
+title=Custom Sling Health Checks
+type=page
+status=published
+tags=healthchecks,operations
+~~~~~~
+
+Custom Sling Health Checks run on the [Felix Health Checks](http://felix.apache.org/documentation/subprojects/apache-felix-healthchecks.html) runtime. 
+
+# Best location for Health Checks
+
+It is best practice to place health check next to the functionality they check. Also documentation of those check should be provided along with the documentation of the functionality.
+
+The below checks are exceptions to that rule as they are generic in what they check (but still require Sling features, that's whey they are not in Apache Felix).
+
+# Apache Sling Health Check Support Module
+
+Check | PID | Factory | Description  
+--- | --- | --- | ---
+Default Logins Check | org.apache.sling.hc.support.DefaultLoginsHealthCheck | yes | Set a list of default logins in config array `logins` separed by `:`, e.g. `author:author` 
+Scripted Check | org.apache.felix.hc.generalchecks.ScriptedHealthCheck | yes | Allows to run an arbitrary script in the same way as the Scripted Check from from Apache Felix bundle [general checks](https://github.com/apache/felix/blob/trunk/healthcheck/README.md#general-purpose-health-checks-available-out-of-the-box), except that this check allows to use files being loaded from JCR by using a `scriptUrl` with prefix `jcr:`, e.g. `jcr:/apps/ops/my-custom-check.groovy`
+Request Status Health Check | *Deprecated* |  | Use instead the corresponding check from [general checks](https://github.com/apache/felix/blob/trunk/healthcheck/README.md#general-purpose-health-checks-available-out-of-the-box)
+
+# Health Checks as server-side JUnit tests
+The `org.apache.sling.hc.junit.bridge` bundle makes selected Health Checks available as server-side JUnit tests. 
+
+It requires the `org.apache.sling.junit.core bundle` which provides the server-side JUnit tests infrastructure.
+
+The idea is to implement the smoke tests of your system, for example, as health checks. You can then run them
+as part of integration testing, using the  [Sling Testing Tools](/documentation/development/sling-testing-tools.html)  
+remote testing utilities, and also as plain Health Checks for monitoring or troubleshooting Sling instances.
+
+To use this module, configure sets of tags at `/system/console/configMgr/org.apache.sling.hc.junitbridge.HealthCheckTestsProvider`
+using the standard `includeThisTag,-omitThatTag` syntax, and JUnit tests will be available at /system/sling/junit/HealthChecks.html 
+to run the corresponding Health Checks.
+