From bc5d15eaa37961c793fa0d75d5edb4fdf0bbb140 Mon Sep 17 00:00:00 2001
From: Serge Huber
Date: Sun, 28 Jun 2026 20:02:29 +0200
Subject: [PATCH 1/2] UNOMI-953: Backport packaging bundle (Phase 2 PR 2)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Reorder distribution Karaf features to install privacy-extension-services before plugins and REST, while preserving master’s advanced-conditions wiring. Port list query condition validation and Groovy action Javadoc fixes from unomi-3-dev without reverting master tracing improvements.
---
distribution/src/main/feature/feature.xml | 52 ++++++++++---------
.../unomi/groovy/actions/ScriptMetadata.java | 8 ++-
.../services/GroovyActionsService.java | 14 +++++
.../unomi/services/UserListServiceImpl.java | 4 +-
4 files changed, 51 insertions(+), 27 deletions(-)
diff --git a/distribution/src/main/feature/feature.xml b/distribution/src/main/feature/feature.xml
index 390ab3fd40..2b654d1df2 100644
--- a/distribution/src/main/feature/feature.xml
+++ b/distribution/src/main/feature/feature.xml
@@ -29,16 +29,17 @@
unomi-elasticsearch-core
unomi-persistence-core
unomi-services
- unomi-rest-api
- unomi-cxs-lists-extension
- unomi-cxs-geonames-extension
- unomi-cxs-privacy-extension
- unomi-elasticsearch-conditions
- unomi-plugins-advanced-conditions
+ unomi-cxs-privacy-extension-services
unomi-plugins-base
unomi-plugins-request
unomi-plugins-mail
unomi-plugins-optimization-test
+ unomi-rest-api
+ unomi-cxs-privacy-extension
+ unomi-elasticsearch-conditions
+ unomi-plugins-advanced-conditions
+ unomi-cxs-lists-extension
+ unomi-cxs-geonames-extension
unomi-shell-dev-commands
unomi-wab
unomi-web-tracker
@@ -55,16 +56,17 @@
unomi-elasticsearch-core
unomi-persistence-core
unomi-services
- unomi-rest-api
- unomi-cxs-lists-extension
- unomi-cxs-geonames-extension
- unomi-cxs-privacy-extension
- unomi-elasticsearch-conditions
- unomi-plugins-advanced-conditions
+ unomi-cxs-privacy-extension-services
unomi-plugins-base
unomi-plugins-request
unomi-plugins-mail
unomi-plugins-optimization-test
+ unomi-rest-api
+ unomi-cxs-privacy-extension
+ unomi-elasticsearch-conditions
+ unomi-plugins-advanced-conditions
+ unomi-cxs-lists-extension
+ unomi-cxs-geonames-extension
unomi-shell-dev-commands
unomi-wab
unomi-web-tracker
@@ -82,16 +84,17 @@
unomi-opensearch-core
unomi-persistence-core
unomi-services
- unomi-rest-api
- unomi-cxs-lists-extension
- unomi-cxs-geonames-extension
- unomi-cxs-privacy-extension
- unomi-opensearch-conditions
- unomi-plugins-advanced-conditions
+ unomi-cxs-privacy-extension-services
unomi-plugins-base
unomi-plugins-request
unomi-plugins-mail
unomi-plugins-optimization-test
+ unomi-rest-api
+ unomi-cxs-privacy-extension
+ unomi-opensearch-conditions
+ unomi-plugins-advanced-conditions
+ unomi-cxs-lists-extension
+ unomi-cxs-geonames-extension
unomi-shell-dev-commands
unomi-wab
unomi-web-tracker
@@ -108,16 +111,17 @@
unomi-opensearch-core
unomi-persistence-core
unomi-services
- unomi-rest-api
- unomi-cxs-lists-extension
- unomi-cxs-geonames-extension
- unomi-cxs-privacy-extension
- unomi-opensearch-conditions
- unomi-plugins-advanced-conditions
+ unomi-cxs-privacy-extension-services
unomi-plugins-base
unomi-plugins-request
unomi-plugins-mail
unomi-plugins-optimization-test
+ unomi-rest-api
+ unomi-cxs-privacy-extension
+ unomi-opensearch-conditions
+ unomi-plugins-advanced-conditions
+ unomi-cxs-lists-extension
+ unomi-cxs-geonames-extension
unomi-shell-dev-commands
unomi-wab
unomi-web-tracker
diff --git a/extensions/groovy-actions/services/src/main/java/org/apache/unomi/groovy/actions/ScriptMetadata.java b/extensions/groovy-actions/services/src/main/java/org/apache/unomi/groovy/actions/ScriptMetadata.java
index f8f3803b0d..4b8535d270 100644
--- a/extensions/groovy-actions/services/src/main/java/org/apache/unomi/groovy/actions/ScriptMetadata.java
+++ b/extensions/groovy-actions/services/src/main/java/org/apache/unomi/groovy/actions/ScriptMetadata.java
@@ -17,7 +17,6 @@
package org.apache.unomi.groovy.actions;
import groovy.lang.Script;
-
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.nio.charset.StandardCharsets;
@@ -29,9 +28,12 @@
* This class encapsulates all metadata associated with a compiled Groovy script,
* including content hash for efficient change detection and the compiled class
* for direct execution without recompilation.
+ *
+ *
*
* Thread Safety: This class is immutable and thread-safe. All fields are final
* and the class provides no methods to modify its state after construction.
+ *
*
* @since 2.7.0
*/
@@ -90,6 +92,7 @@ private String calculateHash(String content) {
*
* This method uses SHA-256 hash comparison for efficient change detection
* without storing or comparing the full script content.
+ *
*
* @param newContent the new script content to compare against
* @return {@code true} if content has changed, {@code false} if unchanged
@@ -143,10 +146,11 @@ public long getCreationTime() {
*
* This class can be used to create new script instances for execution
* without requiring recompilation.
+ *
*
* @return the compiled script class, never null
*/
public Class extends Script> getCompiledClass() {
return compiledClass;
}
-}
\ No newline at end of file
+}
diff --git a/extensions/groovy-actions/services/src/main/java/org/apache/unomi/groovy/actions/services/GroovyActionsService.java b/extensions/groovy-actions/services/src/main/java/org/apache/unomi/groovy/actions/services/GroovyActionsService.java
index 4f74528bbe..1b4bf14be2 100644
--- a/extensions/groovy-actions/services/src/main/java/org/apache/unomi/groovy/actions/services/GroovyActionsService.java
+++ b/extensions/groovy-actions/services/src/main/java/org/apache/unomi/groovy/actions/services/GroovyActionsService.java
@@ -27,6 +27,8 @@
* This service provides functionality to load, compile, cache, and execute
* Groovy scripts as actions within the Apache Unomi framework. It implements
* optimized compilation and caching strategies to achieve high performance.
+ *
+ *
*
* Key features:
*
@@ -35,9 +37,13 @@
* - Thread-safe compilation and execution
* - Unified caching architecture for compiled scripts
*
+ *
+ *
*
* Thread Safety: Implementations must be thread-safe as this service
* is accessed concurrently during script execution.
+ *
+ *
* @see GroovyAction
* @see ScriptMetadata
* @since 2.7.0
@@ -50,6 +56,8 @@ public interface GroovyActionsService {
* This method compiles the script, validates it has the required
* annotations, persists it, and updates the internal cache.
* If the script content hasn't changed, recompilation is skipped.
+ *
+ *
* @param actionName the unique identifier for the action
* @param groovyScript the Groovy script source code
* @throws IllegalArgumentException if actionName or groovyScript is null
@@ -62,6 +70,8 @@ public interface GroovyActionsService {
*
* This method removes the action from both the cache and persistent storage,
* and cleans up any registered action types in the definitions service.
+ *
+ *
* @param actionName the unique identifier of the action to remove
* @throws IllegalArgumentException if id is null
*/
@@ -73,6 +83,8 @@ public interface GroovyActionsService {
* This is the preferred method for script execution as it returns
* pre-compiled classes without any compilation overhead. Returns
* {@code null} if the script is not found in the cache.
+ *
+ *
* @param actionName the unique identifier of the action
* @return the compiled script class, or {@code null} if not found in cache
* @throws IllegalArgumentException if id is null
@@ -85,6 +97,8 @@ public interface GroovyActionsService {
* The returned metadata includes content hash, compilation timestamp,
* and the compiled class reference. This is useful for monitoring
* tools and debugging.
+ *
+ *
* @param actionName the unique identifier of the action
* @return the script metadata, or {@code null} if not found
* @throws IllegalArgumentException if actionName is null
diff --git a/extensions/lists-extension/services/src/main/java/org/apache/unomi/services/UserListServiceImpl.java b/extensions/lists-extension/services/src/main/java/org/apache/unomi/services/UserListServiceImpl.java
index 1c656d1dee..122488c030 100644
--- a/extensions/lists-extension/services/src/main/java/org/apache/unomi/services/UserListServiceImpl.java
+++ b/extensions/lists-extension/services/src/main/java/org/apache/unomi/services/UserListServiceImpl.java
@@ -59,7 +59,9 @@ public PartialList getListMetadatas(Query query) {
if (query.isForceRefresh()) {
persistenceService.refreshIndex(UserList.class);
}
- definitionsService.resolveConditionType(query.getCondition());
+ if (query.getCondition() != null) {
+ definitionsService.getConditionValidationService().validate(query.getCondition());
+ }
PartialList userLists = persistenceService.query(query.getCondition(), query.getSortby(), UserList.class, query.getOffset(), query.getLimit());
List metadata = new LinkedList<>();
for (UserList definition : userLists.getList()) {
From e0e8d9a16822a6c2f45399e7e136980b37367f40 Mon Sep 17 00:00:00 2001
From: Serge Huber
Date: Sun, 28 Jun 2026 20:43:56 +0200
Subject: [PATCH 2/2] Fix GroovyActionsService Javadoc invalid after