You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@unomi.apache.org by sh...@apache.org on 2022/02/23 08:07:19 UTC

[unomi] branch UNOMI-486-json-schema-graphql updated (68940c3 -> d619e25)

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

shuber pushed a change to branch UNOMI-486-json-schema-graphql
in repository https://gitbox.apache.org/repos/asf/unomi.git.


    from 68940c3  UNOMI-486 - Rename property type keyword to Unomi property type keyword - Allow null in itemId JSON schema.
     add c9eafca  Update copyright year
     add ca6f4c6  UNOMI-552 Fix failing integration tests - Improve optimization criteria to make it a little more accepting of time variance - Fix issue in merge action when using integration tests (no HTTP request/response objects are available in this case)
     add e6f7d49  UNOMI-552 Fix failing integration tests - Fix unstable segment integration test due to inconsistent profile state
     add ffb9e72  UNOMI-552 Fix failing integration tests - Add comment to explain why we are using a <1 ratio for test validation
     add d00f426  Attempt to fix issue with release:prepare locking Unomi startup.
     add a0bfe54  Attempt to fix issue with release:prepare locking Unomi startup. - Added a dependency to Unomi in Groovy actions feature - Added a check of bundle states at initialization of Lifecycle Manager, in case it gets started after bundles that are required.
     new 7eb64ee  Merge remote-tracking branch 'origin/master' into UNOMI-486-json-schema-graphql
     new d619e25  UNOMI-486 - Corrections on integration tests to fix problems - Added new login event type definition (not complete yet) - Activated event validation

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:
 NOTICE                                             |  2 +-
 .../karaf-kar/src/main/feature/feature.xml         |  2 +-
 .../test/java/org/apache/unomi/itests/BasicIT.java |  4 +--
 .../org/apache/unomi/itests/RuleServiceIT.java     |  7 ++--
 .../java/org/apache/unomi/itests/SegmentIT.java    |  5 +++
 .../schemas/events/float-property-type.json        |  3 +-
 .../org/apache/unomi/lifecycle/BundleWatcher.java  | 38 +++++++++++++---------
 .../actions/MergeProfilesOnPropertyAction.java     | 15 ++++++---
 .../services/impl/events/EventServiceImpl.java     |  5 +--
 .../cxs/schemas/events/{view.json => login.json}   | 11 +++----
 10 files changed, 54 insertions(+), 38 deletions(-)
 copy services/src/main/resources/META-INF/cxs/schemas/events/{view.json => login.json} (69%)

[unomi] 02/02: UNOMI-486 - Corrections on integration tests to fix problems - Added new login event type definition (not complete yet) - Activated event validation

Posted by sh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch UNOMI-486-json-schema-graphql
in repository https://gitbox.apache.org/repos/asf/unomi.git

commit d619e254fa87669bb161faf50ef9472c4b7e910b
Author: Serge Huber <sh...@jahia.com>
AuthorDate: Wed Feb 23 09:07:03 2022 +0100

    UNOMI-486
    - Corrections on integration tests to fix problems
    - Added new login event type definition (not complete yet)
    - Activated event validation
---
 itests/src/test/java/org/apache/unomi/itests/BasicIT.java |  4 ++--
 .../resources/schemas/events/float-property-type.json     |  3 ++-
 .../unomi/services/impl/events/EventServiceImpl.java      |  5 +----
 .../main/resources/META-INF/cxs/schemas/events/login.json | 15 +++++++++------
 4 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/itests/src/test/java/org/apache/unomi/itests/BasicIT.java b/itests/src/test/java/org/apache/unomi/itests/BasicIT.java
index e726ce4..348bdc3 100644
--- a/itests/src/test/java/org/apache/unomi/itests/BasicIT.java
+++ b/itests/src/test/java/org/apache/unomi/itests/BasicIT.java
@@ -72,9 +72,9 @@ public class BasicIT extends BaseIT {
     private static final String TEST_SCOPE = "testScope";
 
     private static final String ITEM_TYPE_SITE = "site";
-    private static final String ITEM_ID_SITE = "/test/site";
+    private static final String ITEM_ID_SITE = "site-8f4d-4a07-8e96-d33ffa04d3d4";
     private static final String ITEM_TYPE_VISITOR = "VISITOR";
-    protected static final String ITEM_ID_PAGE_1 = "/test/site/page1";
+    protected static final String ITEM_ID_PAGE_1 = "page-8f4d-4a07-8e96-d33ffa04d3d4";
     protected static final String ITEM_TYPE_PAGE = "page";
 
     private static final String FIRST_NAME = "firstName";
diff --git a/itests/src/test/resources/schemas/events/float-property-type.json b/itests/src/test/resources/schemas/events/float-property-type.json
index a44061e..ca09db1 100644
--- a/itests/src/test/resources/schemas/events/float-property-type.json
+++ b/itests/src/test/resources/schemas/events/float-property-type.json
@@ -15,7 +15,8 @@
       "type" : "object",
       "properties" : {
         "floatProperty" : { "type" : "number" }
-      }
+      },
+      "additionalProperties": false
     }
   }
 }
\ No newline at end of file
diff --git a/services/src/main/java/org/apache/unomi/services/impl/events/EventServiceImpl.java b/services/src/main/java/org/apache/unomi/services/impl/events/EventServiceImpl.java
index c64bc13..be5ac44 100644
--- a/services/src/main/java/org/apache/unomi/services/impl/events/EventServiceImpl.java
+++ b/services/src/main/java/org/apache/unomi/services/impl/events/EventServiceImpl.java
@@ -140,10 +140,7 @@ public class EventServiceImpl implements EventService {
     }
 
     public boolean isEventValid(Event event) {
-        if (!this.schemaRegistry.isValid(event, "https://unomi.apache.org/schemas/json/events/" + event.getEventType() + "/1-0-0")) {
-            logger.warn("Event doesn't validate.");
-        };
-        return true;
+        return this.schemaRegistry.isValid(event, "https://unomi.apache.org/schemas/json/events/" + event.getEventType() + "/1-0-0");
     }
 
     public String authenticateThirdPartyServer(String key, String ip) {
diff --git a/itests/src/test/resources/schemas/events/float-property-type.json b/services/src/main/resources/META-INF/cxs/schemas/events/login.json
similarity index 52%
copy from itests/src/test/resources/schemas/events/float-property-type.json
copy to services/src/main/resources/META-INF/cxs/schemas/events/login.json
index a44061e..f00ef58 100644
--- a/itests/src/test/resources/schemas/events/float-property-type.json
+++ b/services/src/main/resources/META-INF/cxs/schemas/events/login.json
@@ -1,21 +1,24 @@
 {
-  "$id": "https://unomi.apache.org/schemas/json/events/float-property-type/1-0-0",
+  "$id": "https://unomi.apache.org/schemas/json/events/login/1-0-0",
   "$schema": "https://json-schema.org/draft/2019-09/schema",
   "self":{
     "vendor":"org.apache.unomi",
-    "name":"events/float-property-type",
+    "target" : "events",
+    "name": "login",
     "format":"jsonschema",
     "version":"1-0-0"
   },
-  "title": "FloatPropertyEvent",
+  "title": "LoginEvent",
   "type": "object",
   "allOf": [{ "$ref": "https://unomi.apache.org/schemas/json/event/1-0-0" }],
   "properties" : {
     "properties" : {
       "type" : "object",
-      "properties" : {
-        "floatProperty" : { "type" : "number" }
-      }
+      "unomiPropertyTypes" : [ "events" ],
+      "maxProperties": 50
+    },
+    "target" : {
+      "$ref" : "https://unomi.apache.org/schemas/json/customitem/1-0-0"
     }
   }
 }
\ No newline at end of file

[unomi] 01/02: Merge remote-tracking branch 'origin/master' into UNOMI-486-json-schema-graphql

Posted by sh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

shuber pushed a commit to branch UNOMI-486-json-schema-graphql
in repository https://gitbox.apache.org/repos/asf/unomi.git

commit 7eb64eec80c5c8b872523b43db1c7bcc4ddbc3e5
Merge: 68940c3 a0bfe54
Author: Serge Huber <sh...@jahia.com>
AuthorDate: Wed Feb 23 08:43:43 2022 +0100

    Merge remote-tracking branch 'origin/master' into UNOMI-486-json-schema-graphql

 NOTICE                                             |  2 +-
 .../karaf-kar/src/main/feature/feature.xml         |  2 +-
 .../org/apache/unomi/itests/RuleServiceIT.java     |  7 ++--
 .../java/org/apache/unomi/itests/SegmentIT.java    |  5 +++
 .../org/apache/unomi/lifecycle/BundleWatcher.java  | 38 +++++++++++++---------
 .../actions/MergeProfilesOnPropertyAction.java     | 15 ++++++---
 6 files changed, 45 insertions(+), 24 deletions(-)