You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by dk...@apache.org on 2023/09/27 04:02:12 UTC
[sling-org-apache-sling-app-cms] branch master updated (3cf0bd30 -> 9c76f213)
This is an automated email from the ASF dual-hosted git repository.
dklco pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-app-cms.git
from 3cf0bd30 SLING-12012 - Add Recent Drafts List
new 4efc8024 SLING-12012 - enabling null check for published property
new 9c76f213 Minor - improving the startup detection
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../sling/cms/core/internal/IndexCreator.java | 2 +-
feature/src/main/features/healthcheck.json | 39 +++++++++++++------
it/cypress/ready.js | 45 +++++++++++++++++-----
3 files changed, 64 insertions(+), 22 deletions(-)
[sling-org-apache-sling-app-cms] 02/02: Minor - improving the startup detection
Posted by dk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
dklco pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-app-cms.git
commit 9c76f213161016005aeaef179ae91f2306202822
Author: Dan Klco <kl...@adobe.com>
AuthorDate: Wed Sep 27 00:01:24 2023 -0400
Minor - improving the startup detection
---
feature/src/main/features/healthcheck.json | 39 ++++++++++++++++++--------
it/cypress/ready.js | 45 ++++++++++++++++++++++++------
2 files changed, 63 insertions(+), 21 deletions(-)
diff --git a/feature/src/main/features/healthcheck.json b/feature/src/main/features/healthcheck.json
index 9e300493..80b35644 100644
--- a/feature/src/main/features/healthcheck.json
+++ b/feature/src/main/features/healthcheck.json
@@ -26,11 +26,6 @@
"registerHealthyMarkerService":true,
"registerUnhealthyMarkerService":true
},
- "org.apache.felix.hc.generalchecks.BundlesStartedCheck":{
- "hc.tags":[
- "bundles"
- ]
- },
"org.apache.felix.hc.generalchecks.CpuCheck":{
"hc.tags":[
"cpu",
@@ -47,12 +42,6 @@
"."
]
},
- "org.apache.felix.hc.generalchecks.FrameworkStartCheck":{
- "hc.tags":[
- "systemalive"
- ],
- "targetStartLevel:Integer":30
- },
"org.apache.felix.hc.generalchecks.MemoryCheck":{
"hc.tags":[
"memory",
@@ -63,7 +52,8 @@
},
"org.apache.felix.hc.generalchecks.ServicesCheck":{
"hc.tags":[
- "systemalive"
+ "systemalive",
+ "systemready"
],
"services.list":[
"org.apache.sling.jcr.api.SlingRepository",
@@ -73,6 +63,31 @@
"javax.script.ScriptEngineManager"
]
},
+ "org.apache.felix.hc.generalchecks.DsComponentsCheck~systemready": {
+ "hc.name":"DS Components Ready Check",
+ "hc.tags":[
+ "systemalive",
+ "systemready"
+ ],
+ "components.list":[
+ "org.apache.sling.cms.core.internal.servlets.CMSPageServlet",
+ "org.apache.sling.cms.core.internal.filters.CMSSecurityFilter"
+ ]
+ },
+ "org.apache.felix.hc.generalchecks.BundlesStartedCheck~systemready": {
+ "hc.name":"All bundles are up",
+ "hc.tags":[
+ "systemalive",
+ "systemready"
+ ]
+ },
+ "org.apache.felix.hc.generalchecks.FrameworkStartCheck": {
+ "hc.tags":[
+ "systemalive",
+ "systemready"
+ ],
+ "targetStartLevel:Integer":30
+ },
"org.apache.felix.hc.generalchecks.ThreadUsageCheck":{
"hc.tags":[
"threads",
diff --git a/it/cypress/ready.js b/it/cypress/ready.js
index 8ffae2b8..dfc55a85 100644
--- a/it/cypress/ready.js
+++ b/it/cypress/ready.js
@@ -19,26 +19,53 @@
const fetch = require("node-fetch-commonjs");
const url = process.env.CYPRESS_BASE_URL;
+const auth = Buffer.from("admin:admin").toString("base64");
async function sleep(ms) {
return new Promise((resolve) => {
setTimeout(resolve, ms);
});
}
+
+async function checkSystemReady() {
+ const res = await fetch(`${url}/system/health?tags=systemalive&format=txt`, {
+ headers: { Authorization: `Basic ${auth}` },
+ });
+ return res.ok;
+}
+
+async function checkLoginContent() {
+ const res = await fetch(`${url}/system/sling/login`);
+ if (res.ok) {
+ const body = await res.text();
+ if (body.indexOf("Welcome to Apache Sling CMS") !== -1) {
+ return true;
+ }
+ }
+ return false;
+}
+
+async function checkHomeStatus() {
+ const res = await fetch(`${url}/`);
+ return res.status === 403;
+}
+
async function main() {
console.log(`Waiting for Sling to start on: ${url}`);
- for (let i = 0; i < 120; i++) {
+ for (let i = 0; i < 240; i++) {
try {
- const res = await fetch(`${url}/system/sling/form/login`);
+ const systemReadyOk = await checkSystemReady();
+ const homeStatusOk = await checkHomeStatus();
+ const loginContentOk = await checkLoginContent();
- if (res.ok) {
- const body = await res.text();
- if (body.indexOf("Welcome to Apache Sling CMS") !== -1) {
- console.log(`Sling started on: ${url}`);
- return;
- }
+ if (systemReadyOk && homeStatusOk && loginContentOk) {
+ console.log(`Sling started on: ${url}`);
+ await sleep(2000);
+ return;
}
- } catch (e) {}
+ } catch (e) {
+ console.warn("Caught error checking status", e);
+ }
await sleep(5000);
}
console.log("Sling failed to start in the allotted time, failing...");
[sling-org-apache-sling-app-cms] 01/02: SLING-12012 - enabling null check for published property
Posted by dk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
dklco pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-app-cms.git
commit 4efc80243b5fd7356b59eb43d6d9ae149e8b551d
Author: Dan Klco <kl...@adobe.com>
AuthorDate: Tue Sep 26 23:59:22 2023 -0400
SLING-12012 - enabling null check for published property
---
core/src/main/java/org/apache/sling/cms/core/internal/IndexCreator.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/core/src/main/java/org/apache/sling/cms/core/internal/IndexCreator.java b/core/src/main/java/org/apache/sling/cms/core/internal/IndexCreator.java
index 5babc0fe..9e754eec 100644
--- a/core/src/main/java/org/apache/sling/cms/core/internal/IndexCreator.java
+++ b/core/src/main/java/org/apache/sling/cms/core/internal/IndexCreator.java
@@ -178,7 +178,7 @@ public class IndexCreator implements RepositoryInitializer {
indexRule.property("jcrLastModified", "jcr:content/jcr:lastModified", false).propertyIndex().ordered()
.type("Date");
indexRule.property("jcrLastModifiedBy", "jcr:content/jcr:lastModifiedBy", false).propertyIndex();
- indexRule.property("slingPublished", "jcr:content/sling:published", false).propertyIndex().type("Boolean");
+ indexRule.property("slingPublished", "jcr:content/sling:published", false).propertyIndex().nullCheckEnabled().type("Boolean");
indexRule.property("slingTaxonomy", "jcr:content/sling:taxonomy", false).propertyIndex().analyzed();
indexRule.property("allProperties", "jcr:content/.*", true).propertyIndex().analyzed();
}