From aa3f52b564179cea91f013aa31b5d5a3ae676efb Mon Sep 17 00:00:00 2001 From: Krystian Panek Date: Tue, 21 Oct 2025 08:13:03 +0200 Subject: [PATCH 1/3] Repo init check --- .../dev/vml/es/acm/core/instance/HealthChecker.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/dev/vml/es/acm/core/instance/HealthChecker.java b/core/src/main/java/dev/vml/es/acm/core/instance/HealthChecker.java index 3446df94..283d5446 100644 --- a/core/src/main/java/dev/vml/es/acm/core/instance/HealthChecker.java +++ b/core/src/main/java/dev/vml/es/acm/core/instance/HealthChecker.java @@ -9,6 +9,7 @@ import dev.vml.es.acm.core.osgi.OsgiScanner; import dev.vml.es.acm.core.osgi.OsgiUtils; import dev.vml.es.acm.core.repo.Repo; +import dev.vml.es.acm.core.script.ScriptType; import dev.vml.es.acm.core.util.ExceptionUtils; import dev.vml.es.acm.core.util.ResolverUtils; import java.util.*; @@ -18,7 +19,6 @@ import org.apache.commons.lang3.StringUtils; import org.apache.sling.api.resource.ResourceResolver; import org.apache.sling.api.resource.ResourceResolverFactory; -import org.apache.sling.discovery.DiscoveryService; import org.osgi.framework.Bundle; import org.osgi.framework.FrameworkUtil; import org.osgi.framework.ServiceRegistration; @@ -53,9 +53,6 @@ public class HealthChecker implements EventHandler { @Reference private SlingInstaller slingInstaller; - @Reference - private DiscoveryService discoveryService; - private Config config; private ServiceRegistration eventHandlerRegistration; @@ -131,6 +128,14 @@ private void checkRepository(List issues, ResourceResolver resource "Composite node store not available", null)); } + if (Arrays.stream(ScriptType.values()) + .anyMatch(st -> !repo.get(st.root()).exists())) { + issues.add(new HealthIssue( + HealthIssueSeverity.CRITICAL, + HealthIssueCategory.INSTANCE, + "Restart required: repo-init not yet executed", + null)); + } if (ArrayUtils.isNotEmpty(config.repositoryPathsExisted())) { Arrays.stream(config.repositoryPathsExisted()).forEach(path -> { if (!repo.get(path).exists()) { From 8cc00dfa2df48f9ba4ef5a4f106eeb1cb38938a2 Mon Sep 17 00:00:00 2001 From: Krystian Panek Date: Tue, 21 Oct 2025 08:14:24 +0200 Subject: [PATCH 2/3] Tmp --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fdb22520..345abde2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -109,8 +109,8 @@ jobs: PACKAGE_PATH=$(find ./aem/home/lib/acm -name "*.zip" | head -1) echo "Deploying ACM Package '$PACKAGE_PATH'" sh aemw pkg deploy --file "$PACKAGE_PATH" - echo "Restarting AEM instance to apply repoinit scripts" - sh aemw instance restart + #echo "Restarting AEM instance to apply repoinit scripts" + #sh aemw instance restart echo "Deployed ACM Package '$PACKAGE_PATH'" - name: Run Playwright Tests From 8fb9ab4b03a65b5617601517df6a91e60589fac6 Mon Sep 17 00:00:00 2001 From: Krystian Panek Date: Tue, 21 Oct 2025 08:15:17 +0200 Subject: [PATCH 3/3] Revert --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 345abde2..fdb22520 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -109,8 +109,8 @@ jobs: PACKAGE_PATH=$(find ./aem/home/lib/acm -name "*.zip" | head -1) echo "Deploying ACM Package '$PACKAGE_PATH'" sh aemw pkg deploy --file "$PACKAGE_PATH" - #echo "Restarting AEM instance to apply repoinit scripts" - #sh aemw instance restart + echo "Restarting AEM instance to apply repoinit scripts" + sh aemw instance restart echo "Deployed ACM Package '$PACKAGE_PATH'" - name: Run Playwright Tests