Merge "Add DMI to TrustLevel Cache During Registration"
authorPriyank Maheshwari <priyank.maheshwari@est.tech>
Mon, 25 Sep 2023 08:44:26 +0000 (08:44 +0000)
committerGerrit Code Review <gerrit@onap.org>
Mon, 25 Sep 2023 08:44:26 +0000 (08:44 +0000)
48 files changed:
.github/workflows/gerrit-merge.yaml [deleted file]
.github/workflows/gerrit-verify.yaml [deleted file]
checkstyle/pom.xml
cps-application/pom.xml
cps-bom/pom.xml
cps-dependencies/pom.xml
cps-events/pom.xml
cps-ncmp-events/pom.xml
cps-ncmp-rest-stub/cps-ncmp-rest-stub-app/pom.xml
cps-ncmp-rest-stub/cps-ncmp-rest-stub-service/pom.xml
cps-ncmp-rest-stub/pom.xml
cps-ncmp-rest/docs/openapi/components.yaml
cps-ncmp-rest/pom.xml
cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyControllerSpec.groovy
cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/mapper/CmHandleStateMapperSpec.groovy
cps-ncmp-service/pom.xml
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/LockReasonCategory.java
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/sync/ModuleSyncTasks.java
cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/inventory/sync/SyncUtils.java
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/NetworkCmProxyDataServiceImplSpec.groovy
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/events/lcm/LcmEventsCmHandleStateHandlerImplSpec.groovy
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/yangmodels/YangModelCmHandleSpec.groovy
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/inventory/CompositeStateBuilderSpec.groovy
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/inventory/CompositeStateSpec.groovy
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/inventory/sync/ModuleSyncTasksSpec.groovy
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/inventory/sync/SyncUtilsSpec.groovy
cps-ncmp-service/src/test/resources/expectedStateModel.json
cps-parent/pom.xml
cps-path-parser/pom.xml
cps-rest/pom.xml
cps-ri/pom.xml
cps-service/pom.xml
cps-service/src/main/java/org/onap/cps/yang/YangTextSchemaSourceSetBuilder.java
csit/tests/cps-data-operations/cps-data-operations.robot
csit/tests/cps-subscriptions/cps-subscription-notification.robot
dmi-plugin-demo-and-csit-stub/dmi-plugin-demo-and-csit-stub-app/pom.xml
dmi-plugin-demo-and-csit-stub/dmi-plugin-demo-and-csit-stub-service/pom.xml
dmi-plugin-demo-and-csit-stub/pom.xml
docs/api/swagger/ncmp/openapi-inventory.yaml
docs/deployment.rst
docs/release-notes.rst
integration-test/pom.xml
jacoco-report/pom.xml
pom.xml
releases/3.3.7-container.yaml [new file with mode: 0644]
releases/3.3.7.yaml [new file with mode: 0644]
spotbugs/pom.xml
version.properties

diff --git a/.github/workflows/gerrit-merge.yaml b/.github/workflows/gerrit-merge.yaml
deleted file mode 100644 (file)
index 76335e7..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
----
-name: Gerrit Merge
-
-# yamllint disable-line rule:truthy
-on:
-  workflow_dispatch:
-    inputs:
-      GERRIT_BRANCH:
-        description: "Branch that change is against"
-        required: true
-        type: string
-      GERRIT_CHANGE_ID:
-        description: "The ID for the change"
-        required: true
-        type: string
-      GERRIT_CHANGE_NUMBER:
-        description: "The Gerrit number"
-        required: true
-        type: string
-      GERRIT_CHANGE_URL:
-        description: "URL to the change"
-        required: true
-        type: string
-      GERRIT_EVENT_TYPE:
-        description: "Type of Gerrit event"
-        required: true
-        type: string
-      GERRIT_PATCHSET_NUMBER:
-        description: "The patch number for the change"
-        required: true
-        type: string
-      GERRIT_PATCHSET_REVISION:
-        description: "The revision sha"
-        required: true
-        type: string
-      GERRIT_PROJECT:
-        description: "Project in Gerrit"
-        required: true
-        type: string
-      GERRIT_REFSPEC:
-        description: "Gerrit refspec of change"
-        required: true
-        type: string
-
-jobs:
-  notify:
-    runs-on: ubuntu-latest
-    steps:
-      - name: Notify job start
-        # yamllint disable-line rule:line-length
-        uses: lfit/gerrit-review-action@6ac4c2322b68c0120a9b516eb0421491ee1b3fdf  # v0.4
-        with:
-          host: ${{ vars.GERRIT_SERVER }}
-          username: ${{ vars.GERRIT_SSH_USER }}
-          key: ${{ secrets.GERRIT_SSH_PRIVKEY }}
-          known_hosts: ${{ vars.GERRIT_KNOWN_HOSTS }}
-          gerrit-change-number: ${{ inputs.GERRIT_CHANGE_NUMBER }}
-          gerrit-patchset-number: ${{ inputs.GERRIT_PATCHSET_NUMBER }}
-          vote-type: clear
-          comment-only: true
-      - name: Allow replication
-        run: sleep 10s
-
-  call-gerrit-rtdv3-merge:
-    needs: notify
-    # yamllint disable-line rule:line-length
-    uses: lfit/releng-reusable-workflows/.github/workflows/compose-rtdv3-merge.yaml@main
-    with:
-      GERRIT_BRANCH: ${{ inputs.GERRIT_BRANCH }}
-      GERRIT_CHANGE_ID: ${{ inputs.GERRIT_CHANGE_ID }}
-      GERRIT_CHANGE_NUMBER: ${{ inputs.GERRIT_CHANGE_NUMBER }}
-      GERRIT_CHANGE_URL: ${{ inputs.GERRIT_CHANGE_URL }}
-      GERRIT_EVENT_TYPE: ${{ inputs.GERRIT_EVENT_TYPE }}
-      GERRIT_PATCHSET_NUMBER: ${{ inputs.GERRIT_PATCHSET_NUMBER }}
-      GERRIT_PATCHSET_REVISION: ${{ inputs.GERRIT_PATCHSET_REVISION }}
-      GERRIT_PROJECT: ${{ inputs.GERRIT_PROJECT }}
-      GERRIT_REFSPEC: ${{ inputs.GERRIT_REFSPEC }}
-    secrets:
-      RTD_TOKEN: ${{ secrets.RTD_TOKEN }}
-
-  report-status:
-    if: ${{ always() }}
-    needs: [notify, call-gerrit-rtdv3-merge]
-    runs-on: ubuntu-latest
-    steps:
-      - name: Get workflow conclusion
-        uses: technote-space/workflow-conclusion-action@v3
-      - name: Report workflow conclusion
-        # yamllint disable-line rule:line-length
-        uses: lfit/gerrit-review-action@6ac4c2322b68c0120a9b516eb0421491ee1b3fdf  # v0.4
-        with:
-          host: ${{ vars.GERRIT_SERVER }}
-          username: ${{ vars.GERRIT_SSH_USER }}
-          key: ${{ secrets.GERRIT_SSH_PRIVKEY }}
-          known_hosts: ${{ vars.GERRIT_KNOWN_HOSTS }}
-          gerrit-change-number: ${{ inputs.GERRIT_CHANGE_NUMBER }}
-          gerrit-patchset-number: ${{ inputs.GERRIT_PATCHSET_NUMBER }}
-          vote-type: ${{ env.WORKFLOW_CONCLUSION }}
-          comment-only: true
diff --git a/.github/workflows/gerrit-verify.yaml b/.github/workflows/gerrit-verify.yaml
deleted file mode 100644 (file)
index d425427..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
----
-name: Gerrit Composed rtdv3 Verify
-
-# yamllint disable-line rule:truthy
-on:
-  workflow_dispatch:
-    inputs:
-      GERRIT_BRANCH:
-        description: "Branch that change is against"
-        required: true
-        type: string
-      GERRIT_CHANGE_ID:
-        description: "The ID for the change"
-        required: true
-        type: string
-      GERRIT_CHANGE_NUMBER:
-        description: "The Gerrit number"
-        required: true
-        type: string
-      GERRIT_CHANGE_URL:
-        description: "URL to the change"
-        required: true
-        type: string
-      GERRIT_EVENT_TYPE:
-        description: "Type of Gerrit event"
-        required: true
-        type: string
-      GERRIT_PATCHSET_NUMBER:
-        description: "The patch number for the change"
-        required: true
-        type: string
-      GERRIT_PATCHSET_REVISION:
-        description: "The revision sha"
-        required: true
-        type: string
-      GERRIT_PROJECT:
-        description: "Project in Gerrit"
-        required: true
-        type: string
-      GERRIT_REFSPEC:
-        description: "Gerrit refspec of change"
-        required: true
-        type: string
-
-jobs:
-  prepare:
-    runs-on: ubuntu-latest
-    steps:
-      - name: Clear votes
-        # yamllint disable-line rule:line-length
-        uses: lfit/gerrit-review-action@6ac4c2322b68c0120a9b516eb0421491ee1b3fdf  # v0.4
-        with:
-          host: ${{ vars.GERRIT_SERVER }}
-          username: ${{ vars.GERRIT_SSH_USER }}
-          key: ${{ secrets.GERRIT_SSH_PRIVKEY }}
-          known_hosts: ${{ vars.GERRIT_KNOWN_HOSTS }}
-          gerrit-change-number: ${{ inputs.GERRIT_CHANGE_NUMBER }}
-          gerrit-patchset-number: ${{ inputs.GERRIT_PATCHSET_NUMBER }}
-          vote-type: clear
-          comment-only: true
-      - name: Allow replication
-        run: sleep 10s
-
-  rtd-validation:
-    needs: prepare
-    # use compose-jjb-verify from the v0.4 series of releng-reusable-workflows
-    # yamllint disable-line rule:line-length
-    uses: lfit/releng-reusable-workflows/.github/workflows/compose-rtdv3-verify.yaml@main
-    with:
-      GERRIT_BRANCH: ${{ inputs.GERRIT_BRANCH }}
-      GERRIT_CHANGE_ID: ${{ inputs.GERRIT_CHANGE_ID }}
-      GERRIT_CHANGE_NUMBER: ${{ inputs.GERRIT_CHANGE_NUMBER }}
-      GERRIT_CHANGE_URL: ${{ inputs.GERRIT_CHANGE_URL }}
-      GERRIT_EVENT_TYPE: ${{ inputs.GERRIT_EVENT_TYPE }}
-      GERRIT_PATCHSET_NUMBER: ${{ inputs.GERRIT_PATCHSET_NUMBER }}
-      GERRIT_PATCHSET_REVISION: ${{ inputs.GERRIT_PATCHSET_REVISION }}
-      GERRIT_PROJECT: ${{ inputs.GERRIT_PROJECT }}
-      GERRIT_REFSPEC: ${{ inputs.GERRIT_REFSPEC }}
-    secrets:
-      RTD_TOKEN: ${{ secrets.RTD_TOKEN }}
-
-  vote:
-    if: ${{ always() }}
-    # yamllint enable rule:line-length
-    needs: [prepare, rtd-validation]
-    runs-on: ubuntu-latest
-    steps:
-      - name: Get conclusion
-        # yamllint disable-line rule:line-length
-        uses: technote-space/workflow-conclusion-action@45ce8e0eb155657ab8ccf346ade734257fd196a5  # v3.0.3
-      - name: Set vote
-        # yamllint disable-line rule:line-length
-        uses: lfit/gerrit-review-action@6ac4c2322b68c0120a9b516eb0421491ee1b3fdf  # v0.4
-        with:
-          host: ${{ vars.GERRIT_SERVER }}
-          username: ${{ vars.GERRIT_SSH_USER }}
-          key: ${{ secrets.GERRIT_SSH_PRIVKEY }}
-          known_hosts: ${{ vars.GERRIT_KNOWN_HOSTS }}
-          gerrit-change-number: ${{ inputs.GERRIT_CHANGE_NUMBER }}
-          gerrit-patchset-number: ${{ inputs.GERRIT_PATCHSET_NUMBER }}
-          vote-type: ${{ env.WORKFLOW_CONCLUSION }}
-          comment-only: true
index ef52947..4cf950e 100644 (file)
@@ -26,7 +26,7 @@
     <modelVersion>4.0.0</modelVersion>
     <groupId>org.onap.cps</groupId>
     <artifactId>checkstyle</artifactId>
-    <version>3.3.7-SNAPSHOT</version>
+    <version>3.3.8-SNAPSHOT</version>
 
     <profiles>
         <profile>
index e886970..0cf68ad 100755 (executable)
@@ -28,7 +28,7 @@
     <parent>
         <groupId>org.onap.cps</groupId>
         <artifactId>cps-parent</artifactId>
-        <version>3.3.7-SNAPSHOT</version>
+        <version>3.3.8-SNAPSHOT</version>
         <relativePath>../cps-parent/pom.xml</relativePath>
     </parent>
 
index f3c8f78..0f5cb4b 100644 (file)
@@ -25,7 +25,7 @@
     <modelVersion>4.0.0</modelVersion>
     <groupId>org.onap.cps</groupId>
     <artifactId>cps-bom</artifactId>
-    <version>3.3.7-SNAPSHOT</version>
+    <version>3.3.8-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <description>This artifact contains dependencyManagement declarations of all published CPS components.</description>
index 822d7cc..dac6e66 100755 (executable)
@@ -27,7 +27,7 @@
     <modelVersion>4.0.0</modelVersion>
     <groupId>org.onap.cps</groupId>
     <artifactId>cps-dependencies</artifactId>
-    <version>3.3.7-SNAPSHOT</version>
+    <version>3.3.8-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <name>${project.groupId}:${project.artifactId}</name>
index b305a31..d776ccb 100644 (file)
@@ -24,7 +24,7 @@
     <parent>
         <groupId>org.onap.cps</groupId>
         <artifactId>cps-parent</artifactId>
-        <version>3.3.7-SNAPSHOT</version>
+        <version>3.3.8-SNAPSHOT</version>
         <relativePath>../cps-parent/pom.xml</relativePath>
     </parent>
 
index 47b10c9..3e06028 100644 (file)
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.onap.cps</groupId>
         <artifactId>cps-parent</artifactId>
-        <version>3.3.7-SNAPSHOT</version>
+        <version>3.3.8-SNAPSHOT</version>
         <relativePath>../cps-parent/pom.xml</relativePath>
     </parent>
 
index 6683a23..275313c 100644 (file)
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.onap.cps</groupId>
         <artifactId>cps-ncmp-rest-stub</artifactId>
-        <version>3.3.7-SNAPSHOT</version>
+        <version>3.3.8-SNAPSHOT</version>
     </parent>
 
     <artifactId>cps-ncmp-rest-stub-app</artifactId>
index d7a5da0..435cc70 100644 (file)
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.onap.cps</groupId>
         <artifactId>cps-ncmp-rest-stub</artifactId>
-        <version>3.3.7-SNAPSHOT</version>
+        <version>3.3.8-SNAPSHOT</version>
     </parent>
     <artifactId>cps-ncmp-rest-stub-service</artifactId>
 
index 5e9d3de..4db8617 100644 (file)
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.onap.cps</groupId>
         <artifactId>cps-parent</artifactId>
-        <version>3.3.7-SNAPSHOT</version>
+        <version>3.3.8-SNAPSHOT</version>
         <relativePath>../cps-parent/pom.xml</relativePath>
     </parent>
 
index 818b2da..243de62 100644 (file)
@@ -127,6 +127,9 @@ components:
           $ref: '#/components/schemas/RestCmHandleProperties'
         publicCmHandleProperties:
           $ref: '#/components/schemas/RestCmHandleProperties'
+        moduleSetTag:
+          type: string
+          example: "my-module-set-tag"
     RestCmHandleProperties:
       type: object
       additionalProperties:
index 1ac1bd7..2d6f687 100644 (file)
@@ -27,7 +27,7 @@
     <parent>
         <groupId>org.onap.cps</groupId>
         <artifactId>cps-parent</artifactId>
-        <version>3.3.7-SNAPSHOT</version>
+        <version>3.3.8-SNAPSHOT</version>
         <relativePath>../cps-parent/pom.xml</relativePath>
     </parent>
 
index 7964e32..6887d19 100644 (file)
@@ -600,7 +600,7 @@ class NetworkCmProxyControllerSpec extends Specification {
 
     def compositeStateTestObject() {
         new CompositeState(cmHandleState: CmHandleState.ADVISED,
-            lockReason: CompositeState.LockReason.builder().lockReasonCategory(LockReasonCategory.LOCKED_MODULE_SYNC_FAILED).details("lock details").build(),
+            lockReason: CompositeState.LockReason.builder().lockReasonCategory(LockReasonCategory.MODULE_SYNC_FAILED).details("lock details").build(),
             lastUpdateTime: formattedDateAndTime.toString(),
             dataSyncEnabled: false,
             dataStores: dataStores())
index 9a09b97..bc9ea80 100644 (file)
@@ -43,7 +43,7 @@ class CmHandleStateMapperSpec extends Specification {
             def compositeState = new CompositeStateBuilder()
                 .withCmHandleState(CmHandleState.ADVISED)
                 .withLastUpdatedTime(formattedDateAndTime.toString())
-                .withLockReason(LockReasonCategory.LOCKED_MODULE_SYNC_FAILED, 'locked details')
+                .withLockReason(LockReasonCategory.MODULE_SYNC_FAILED, 'locked details')
                 .withOperationalDataStores(DataStoreSyncState.SYNCHRONIZED, formattedDateAndTime).build()
         compositeState.setDataSyncEnabled(false)
         when: 'mapper is called'
@@ -74,9 +74,9 @@ class CmHandleStateMapperSpec extends Specification {
         then: 'the composite state contains the expected lock Reason and details'
             result.getLockReason().getReason() == expectedExternalLockReason
         where:
-            scenario                    | lockReason                                   || expectedExternalLockReason
-            'LOCKED_MODULE_SYNC_FAILED' | LockReasonCategory.LOCKED_MODULE_SYNC_FAILED || 'LOCKED_MISBEHAVING'
-            'null value'                | null                                         || null
+            scenario                    | lockReason                            || expectedExternalLockReason
+            'MODULE_SYNC_FAILED'        | LockReasonCategory.MODULE_SYNC_FAILED || 'LOCKED_MISBEHAVING'
+            'null value'                | null                                  || null
     }
 
 }
index fa3a369..527d70b 100644 (file)
@@ -27,7 +27,7 @@
     <parent>
         <groupId>org.onap.cps</groupId>
         <artifactId>cps-parent</artifactId>
-        <version>3.3.7-SNAPSHOT</version>
+        <version>3.3.8-SNAPSHOT</version>
         <relativePath>../cps-parent/pom.xml</relativePath>
     </parent>
 
index 16ae881..35daa62 100644 (file)
@@ -21,5 +21,5 @@
 package org.onap.cps.ncmp.api.inventory;
 
 public enum LockReasonCategory {
-    LOCKED_MODULE_SYNC_FAILED
+    MODULE_SYNC_FAILED, MODULE_UPGRADE, MODULE_UPGRADE_FAILED
 }
index 914b626..9ef75b3 100644 (file)
@@ -73,7 +73,7 @@ public class ModuleSyncTasks {
                 } catch (final Exception e) {
                     log.warn("Processing of {} module sync failed due to reason {}.", cmHandleId, e.getMessage());
                     syncUtils.updateLockReasonDetailsAndAttempts(compositeState,
-                            LockReasonCategory.LOCKED_MODULE_SYNC_FAILED, e.getMessage());
+                            LockReasonCategory.MODULE_SYNC_FAILED, e.getMessage());
                     setCmHandleStateLocked(yangModelCmHandle, compositeState.getLockReason());
                     cmHandelStatePerCmHandle.put(yangModelCmHandle, CmHandleState.LOCKED);
                 }
@@ -96,7 +96,7 @@ public class ModuleSyncTasks {
         final Map<YangModelCmHandle, CmHandleState> cmHandleStatePerCmHandle = new HashMap<>(failedCmHandles.size());
         for (final YangModelCmHandle failedCmHandle : failedCmHandles) {
             final CompositeState compositeState = failedCmHandle.getCompositeState();
-            final boolean isReadyForRetry = syncUtils.isReadyForRetry(compositeState);
+            final boolean isReadyForRetry = syncUtils.needsModuleSyncRetry(compositeState);
             log.info("Retry for cmHandleId : {} is {}", failedCmHandle.getId(), isReadyForRetry);
             if (isReadyForRetry) {
                 final String resetCmHandleId = failedCmHandle.getId();
index 53d8c79..ce41e33 100644 (file)
@@ -102,13 +102,13 @@ public class SyncUtils {
     }
 
     /**
-     * Query data nodes for cm handles with an "LOCKED" cm handle state with reason LOCKED_MODULE_SYNC_FAILED".
+     * Query data nodes for cm handles with an "LOCKED" cm handle state with reason MODULE_SYNC_FAILED".
      *
      * @return a random LOCKED yang model cm handle, return null if not found
      */
     public List<YangModelCmHandle> getModuleSyncFailedCmHandles() {
         final List<DataNode> lockedCmHandlesAsDataNodeList = cmHandleQueries.queryCmHandleDataNodesByCpsPath(
-                "//lock-reason[@reason=\"LOCKED_MODULE_SYNC_FAILED\"]",
+                "//lock-reason[@reason=\"MODULE_SYNC_FAILED\"]",
                 FetchDescendantsOption.INCLUDE_ALL_DESCENDANTS);
         return convertCmHandlesDataNodesToYangModelCmHandles(lockedCmHandlesAsDataNodeList);
     }
@@ -136,28 +136,37 @@ public class SyncUtils {
 
 
     /**
-     * Check if the retry mechanism should attempt to unlock the cm handle based on the last update time.
+     * Check if a module sync retry is needed.
      *
      * @param compositeState the composite state currently in the locked state
      * @return if the retry mechanism should be attempted
      */
-    public boolean isReadyForRetry(final CompositeState compositeState) {
-        int timeInMinutesUntilNextAttempt = 1;
+    public boolean needsModuleSyncRetry(final CompositeState compositeState) {
         final OffsetDateTime time =
                 OffsetDateTime.parse(compositeState.getLastUpdateTime(),
                         DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSZ"));
         final Matcher matcher = retryAttemptPattern.matcher(compositeState.getLockReason().getDetails());
+        final boolean failedDuringModuleSync = LockReasonCategory.MODULE_SYNC_FAILED
+                == compositeState.getLockReason().getLockReasonCategory();
+        if (!failedDuringModuleSync) {
+            log.info("Locked for other reason");
+            return false;
+        }
+        final int timeInMinutesUntilNextAttempt;
         if (matcher.find()) {
             timeInMinutesUntilNextAttempt = (int) Math.pow(2, Integer.parseInt(matcher.group(1)));
         } else {
-            log.debug("First Attempt: no current attempts found.");
+            timeInMinutesUntilNextAttempt = 1;
+            log.info("First Attempt: no current attempts found.");
         }
         final int timeSinceLastAttempt = (int) Duration.between(time, OffsetDateTime.now()).toMinutes();
         if (timeInMinutesUntilNextAttempt >= timeSinceLastAttempt) {
             log.info("Time until next attempt is {} minutes: ",
-                    timeInMinutesUntilNextAttempt - timeSinceLastAttempt);
+                timeInMinutesUntilNextAttempt - timeSinceLastAttempt);
+            return false;
         }
-        return timeSinceLastAttempt > timeInMinutesUntilNextAttempt;
+        log.info("Retry due now");
+        return true;
     }
 
     /**
index 9073e4d..50fc30f 100644 (file)
@@ -166,7 +166,7 @@ class NetworkCmProxyDataServiceImplSpec extends Specification {
         given: 'the system returns a yang modelled cm handle'
             def dmiServiceName = 'some service name'
             def compositeState = new CompositeState(cmHandleState: CmHandleState.ADVISED,
-                lockReason: CompositeState.LockReason.builder().lockReasonCategory(LockReasonCategory.LOCKED_MODULE_SYNC_FAILED).details("lock details").build(),
+                lockReason: CompositeState.LockReason.builder().lockReasonCategory(LockReasonCategory.MODULE_SYNC_FAILED).details("lock details").build(),
                 lastUpdateTime: 'some-timestamp',
                 dataSyncEnabled: false,
                 dataStores: dataStores())
@@ -223,7 +223,7 @@ class NetworkCmProxyDataServiceImplSpec extends Specification {
     def 'Get cm handle composite state'() {
         given: 'a yang modelled cm handle'
             def compositeState = new CompositeState(cmHandleState: CmHandleState.ADVISED,
-                lockReason: CompositeState.LockReason.builder().lockReasonCategory(LockReasonCategory.LOCKED_MODULE_SYNC_FAILED).details("lock details").build(),
+                lockReason: CompositeState.LockReason.builder().lockReasonCategory(LockReasonCategory.MODULE_SYNC_FAILED).details("lock details").build(),
                 lastUpdateTime: 'some-timestamp',
                 dataSyncEnabled: false,
                 dataStores: dataStores())
index 261b6e0..0e0810e 100644 (file)
@@ -31,7 +31,7 @@ import static org.onap.cps.ncmp.api.inventory.CmHandleState.DELETED
 import static org.onap.cps.ncmp.api.inventory.CmHandleState.DELETING
 import static org.onap.cps.ncmp.api.inventory.CmHandleState.LOCKED
 import static org.onap.cps.ncmp.api.inventory.CmHandleState.READY
-import static org.onap.cps.ncmp.api.inventory.LockReasonCategory.LOCKED_MODULE_SYNC_FAILED
+import static org.onap.cps.ncmp.api.inventory.LockReasonCategory.MODULE_SYNC_FAILED
 
 class LcmEventsCmHandleStateHandlerImplSpec extends Specification {
 
@@ -80,7 +80,7 @@ class LcmEventsCmHandleStateHandlerImplSpec extends Specification {
     def 'Update and Publish Events on State Change from LOCKED to ADVISED'() {
         given: 'Cm Handle represented as YangModelCmHandle in LOCKED state'
             compositeState = new CompositeState(cmHandleState: LOCKED,
-                lockReason: CompositeState.LockReason.builder().lockReasonCategory(LOCKED_MODULE_SYNC_FAILED).details('some lock details').build())
+                lockReason: CompositeState.LockReason.builder().lockReasonCategory(MODULE_SYNC_FAILED).details('some lock details').build())
             yangModelCmHandle = new YangModelCmHandle(id: cmHandleId, dmiProperties: [], publicProperties: [], compositeState: compositeState)
         when: 'update state is invoked'
             objectUnderTest.updateCmHandleState(yangModelCmHandle, ADVISED)
index 5fe2660..7883209 100644 (file)
@@ -43,7 +43,7 @@ class YangModelCmHandleSpec extends Specification {
             def compositeState = new CompositeStateBuilder()
                 .withCmHandleState(CmHandleState.LOCKED)
                 .withLastUpdatedTime('some-update-time')
-                .withLockReason(LockReasonCategory.LOCKED_MODULE_SYNC_FAILED, 'locked details')
+                .withLockReason(LockReasonCategory.MODULE_SYNC_FAILED, 'locked details')
                 .withOperationalDataStores(DataStoreSyncState.SYNCHRONIZED, 'some-sync-time').build()
             ncmpServiceCmHandle.setCompositeState(compositeState)
         when: 'it is converted to a yang model cm handle'
index fa43798..bab4518 100644 (file)
@@ -23,7 +23,6 @@ package org.onap.cps.ncmp.api.inventory
 
 import org.onap.cps.spi.model.DataNode
 import org.onap.cps.spi.model.DataNodeBuilder
-import org.onap.cps.ncmp.api.inventory.CompositeStateBuilder
 import spock.lang.Specification
 
 import java.time.OffsetDateTime
@@ -38,7 +37,7 @@ class CompositeStateBuilderSpec extends Specification {
     def static cmHandleId = 'myHandle1'
     def static cmHandleXpath = "/dmi-registry/cm-handles[@id='${cmHandleId}/state']"
     def static stateDataNodes = [new DataNodeBuilder().withXpath("/dmi-registry/cm-handles[@id='${cmHandleId}']/state/lock-reason")
-                                         .withLeaves(['reason': 'LOCKED_MODULE_SYNC_FAILED', 'details': 'lock details']).build(),
+                                         .withLeaves(['reason': 'MODULE_SYNC_FAILED', 'details': 'lock details']).build(),
                                  new DataNodeBuilder().withXpath("/dmi-registry/cm-handles[@id='${cmHandleId}']/state/datastores")
                                             .withChildDataNodes(Arrays.asList(new DataNodeBuilder()
                                                     .withXpath("/dmi-registry/cm-handles[@id='${cmHandleId}']/state/datastores/operational")
@@ -48,7 +47,7 @@ class CompositeStateBuilderSpec extends Specification {
     def "Composite State Specification"() {
         when: 'using composite state builder '
             def compositeState = new CompositeStateBuilder().withCmHandleState(CmHandleState.ADVISED)
-                    .withLockReason(LockReasonCategory.LOCKED_MODULE_SYNC_FAILED,"").withOperationalDataStores(DataStoreSyncState.UNSYNCHRONIZED,
+                    .withLockReason(LockReasonCategory.MODULE_SYNC_FAILED,"").withOperationalDataStores(DataStoreSyncState.UNSYNCHRONIZED,
                     formattedDateAndTime.toString()).withLastUpdatedTime(formattedDateAndTime).build()
         then: 'it matches expected cm handle state and data store sync state'
             assert compositeState.cmHandleState == CmHandleState.ADVISED
@@ -69,7 +68,7 @@ class CompositeStateBuilderSpec extends Specification {
             def finalCompositeStateBuilder = new CompositeStateBuilder()
                 .withCmHandleState(CmHandleState.ADVISED)
                 .withLastUpdatedTime(formattedDateAndTime.toString())
-                .withLockReason(LockReasonCategory.LOCKED_MODULE_SYNC_FAILED, 'locked details')
+                .withLockReason(LockReasonCategory.MODULE_SYNC_FAILED, 'locked details')
                 .withOperationalDataStores(DataStoreSyncState.SYNCHRONIZED, formattedDateAndTime)
         when: 'build is called'
             def result = finalCompositeStateBuilder.build()
@@ -78,7 +77,7 @@ class CompositeStateBuilderSpec extends Specification {
         and: 'built result should have correct values'
             assert !result.getDataSyncEnabled()
             assert result.getLastUpdateTime() == formattedDateAndTime
-            assert result.getLockReason().getLockReasonCategory() == LockReasonCategory.LOCKED_MODULE_SYNC_FAILED
+            assert result.getLockReason().getLockReasonCategory() == LockReasonCategory.MODULE_SYNC_FAILED
             assert result.getLockReason().getDetails() == 'locked details'
             assert result.getCmHandleState() == CmHandleState.ADVISED
             assert result.getDataStores().getOperationalDataStore().getDataStoreSyncState() == DataStoreSyncState.SYNCHRONIZED
index 7bdf335..df16eb1 100644 (file)
@@ -40,7 +40,7 @@ class CompositeStateSpec extends Specification {
     def "Composite State Specification"() {
         given: "a Composite State"
             def compositeState = new CompositeState(cmHandleState: CmHandleState.ADVISED,
-                lockReason: CompositeState.LockReason.builder().lockReasonCategory(LockReasonCategory.LOCKED_MODULE_SYNC_FAILED).details("lock details").build(),
+                lockReason: CompositeState.LockReason.builder().lockReasonCategory(LockReasonCategory.MODULE_SYNC_FAILED).details("lock details").build(),
                 lastUpdateTime: formattedDateAndTime.toString(),
                 dataSyncEnabled: false,
                 dataStores: dataStores())
index 382d5da..577c041 100644 (file)
@@ -87,7 +87,7 @@ class ModuleSyncTasksSpec extends Specification {
         when: 'module sync is executed'
             objectUnderTest.performModuleSync([cmHandle], batchCount)
         then: 'update lock reason, details and attempts is invoked'
-            1 * mockSyncUtils.updateLockReasonDetailsAndAttempts(cmHandleState, LockReasonCategory.LOCKED_MODULE_SYNC_FAILED, 'some exception')
+            1 * mockSyncUtils.updateLockReasonDetailsAndAttempts(cmHandleState, LockReasonCategory.MODULE_SYNC_FAILED, 'some exception')
         and: 'the state handler is called to update the state to LOCKED'
             1 * mockLcmEventsCmHandleStateHandler.updateCmHandleStateBatch(_) >> { args ->
                 assertBatch(args, ['cm-handle'], CmHandleState.LOCKED)
@@ -99,7 +99,7 @@ class ModuleSyncTasksSpec extends Specification {
     def 'Reset failed CM Handles #scenario.'() {
         given: 'cm handles in an locked state'
             def lockedState = new CompositeStateBuilder().withCmHandleState(CmHandleState.LOCKED)
-                    .withLockReason(LockReasonCategory.LOCKED_MODULE_SYNC_FAILED, '').withLastUpdatedTimeNow().build()
+                    .withLockReason(LockReasonCategory.MODULE_SYNC_FAILED, '').withLastUpdatedTimeNow().build()
             def yangModelCmHandle1 = new YangModelCmHandle(id: 'cm-handle-1', compositeState: lockedState)
             def yangModelCmHandle2 = new YangModelCmHandle(id: 'cm-handle-2', compositeState: lockedState)
             def expectedCmHandleStatePerCmHandle = [(yangModelCmHandle1): CmHandleState.ADVISED]
@@ -109,7 +109,7 @@ class ModuleSyncTasksSpec extends Specification {
             moduleSyncStartedOnCmHandles.put('cm-handle-1', 'started')
             moduleSyncStartedOnCmHandles.put('cm-handle-2', 'started')
         and: 'sync utils retry locked cm handle returns #isReadyForRetry'
-            mockSyncUtils.isReadyForRetry(lockedState) >>> isReadyForRetry
+            mockSyncUtils.needsModuleSyncRetry(lockedState) >>> isReadyForRetry
         when: 'resetting failed cm handles'
             objectUnderTest.resetFailedCmHandles([yangModelCmHandle1, yangModelCmHandle2])
         then: 'updated to state "ADVISED" from "READY" is called as often as there are cm handles ready for retry'
index c6ce1a5..dcf03ed 100644 (file)
 
 package org.onap.cps.ncmp.api.inventory.sync
 
+import ch.qos.logback.classic.Level
+import ch.qos.logback.classic.Logger
+import ch.qos.logback.core.read.ListAppender
+import org.slf4j.LoggerFactory
+import org.springframework.context.annotation.AnnotationConfigApplicationContext
+
 import static org.onap.cps.ncmp.api.impl.operations.DatastoreType.PASSTHROUGH_OPERATIONAL
+import static org.onap.cps.ncmp.api.inventory.LockReasonCategory.MODULE_SYNC_FAILED
+import static org.onap.cps.ncmp.api.inventory.LockReasonCategory.MODULE_UPGRADE
+import static org.onap.cps.ncmp.api.inventory.LockReasonCategory.MODULE_UPGRADE_FAILED
 
 import com.fasterxml.jackson.databind.JsonNode
 import com.fasterxml.jackson.databind.ObjectMapper
@@ -31,13 +40,11 @@ import org.onap.cps.ncmp.api.inventory.CmHandleState
 import org.onap.cps.ncmp.api.inventory.CompositeState
 import org.onap.cps.ncmp.api.inventory.CompositeStateBuilder
 import org.onap.cps.ncmp.api.inventory.DataStoreSyncState
-import org.onap.cps.ncmp.api.inventory.LockReasonCategory
 import org.onap.cps.spi.FetchDescendantsOption
 import org.onap.cps.spi.model.DataNode
 import org.onap.cps.utils.JsonObjectMapper
 import org.springframework.http.HttpStatus
 import org.springframework.http.ResponseEntity
-import spock.lang.Shared
 import spock.lang.Specification
 import java.time.OffsetDateTime
 import java.time.format.DateTimeFormatter
@@ -53,12 +60,31 @@ class SyncUtilsSpec extends Specification{
 
     def objectUnderTest = new SyncUtils(mockCmHandleQueries, mockDmiDataOperations, jsonObjectMapper)
 
-    @Shared
-    def formattedDateAndTime = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSZ").format(OffsetDateTime.now())
+    def static neverUpdatedBefore = '1900-01-01T00:00:00.000+0100'
+
+    def static now = OffsetDateTime.now()
+
+    def static nowAsString = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSZ").format(now)
+
+    def static dataNode = new DataNode(leaves: ['id': 'cm-handle-123'])
+
+    def applicationContext = new AnnotationConfigApplicationContext()
 
-    @Shared
-    def dataNode = new DataNode(leaves: ['id': 'cm-handle-123'])
+    def logger = (Logger) LoggerFactory.getLogger(SyncUtils)
+    def loggingListAppender
 
+    void setup() {
+        logger.setLevel(Level.DEBUG)
+        loggingListAppender = new ListAppender()
+        logger.addAppender(loggingListAppender)
+        loggingListAppender.start()
+        applicationContext.refresh()
+    }
+
+    void cleanup() {
+        ((Logger) LoggerFactory.getLogger(SyncUtils.class)).detachAndStopAllAppenders()
+        applicationContext.close()
+    }
 
     def 'Get an advised Cm-Handle where ADVISED cm handle #scenario'() {
         given: 'the inventory persistence service returns a collection of data nodes'
@@ -77,9 +103,9 @@ class SyncUtilsSpec extends Specification{
         given: 'A locked state'
             def compositeState = new CompositeState(lockReason: lockReason)
         when: 'update cm handle details and attempts is called'
-            objectUnderTest.updateLockReasonDetailsAndAttempts(compositeState, LockReasonCategory.LOCKED_MODULE_SYNC_FAILED, 'new error message')
+            objectUnderTest.updateLockReasonDetailsAndAttempts(compositeState, MODULE_SYNC_FAILED, 'new error message')
         then: 'the composite state lock reason and details are updated'
-            assert compositeState.lockReason.lockReasonCategory == LockReasonCategory.LOCKED_MODULE_SYNC_FAILED
+            assert compositeState.lockReason.lockReasonCategory == MODULE_SYNC_FAILED
             assert compositeState.lockReason.details == expectedDetails
         where:
             scenario         | lockReason                                                                                   || expectedDetails
@@ -87,10 +113,10 @@ class SyncUtilsSpec extends Specification{
             'exists'         | CompositeState.LockReason.builder().details("Attempt #2 failed: some error message").build() || 'Attempt #3 failed: new error message'
     }
 
-    def 'Get all locked Cm-Handle where Lock Reason is LOCKED_MODULE_SYNC_FAILED cm handle #scenario'() {
+    def 'Get all locked Cm-Handle where Lock Reason is MODULE_SYNC_FAILED cm handle #scenario'() {
         given: 'the cps (persistence service) returns a collection of data nodes'
             mockCmHandleQueries.queryCmHandleDataNodesByCpsPath(
-                '//lock-reason[@reason="LOCKED_MODULE_SYNC_FAILED"]',
+                '//lock-reason[@reason="MODULE_SYNC_FAILED"]',
                 FetchDescendantsOption.INCLUDE_ALL_DESCENDANTS) >> [dataNode]
         when: 'get locked Misbehaving cm handle is called'
             def result = objectUnderTest.getModuleSyncFailedCmHandles()
@@ -101,19 +127,41 @@ class SyncUtilsSpec extends Specification{
     }
 
     def 'Retry Locked Cm-Handle where the last update time is #scenario'() {
-        when: 'retry locked cm handle is invoked'
-            def result = objectUnderTest.isReadyForRetry(new CompositeStateBuilder()
-                .withLockReason(LockReasonCategory.LOCKED_MODULE_SYNC_FAILED, details)
-                .withLastUpdatedTime(lastUpdateTime).build())
-        then: 'result returns #expectedResult'
-            result == expectedResult
-        where:
-            scenario                     | lastUpdateTime                     | details                 || expectedResult
-            'the first attempt'          | '1900-01-01T00:00:00.000+0100'     | 'First Attempt'         || true
-            'greater than one minute'    | '1900-01-01T00:00:00.000+0100'     | 'Attempt #1 failed:'    || true
-            'less than eight minutes'    | formattedDateAndTime               | 'Attempt #3 failed:'    || false
+        given: 'Last update was #lastUpdateMinutesAgo minutes ago (-1 means never)'
+            def lastUpdatedTime = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSZ").format(now.minusMinutes(lastUpdateMinutesAgo))
+            if (lastUpdateMinutesAgo < 0 ) {
+                lastUpdatedTime = neverUpdatedBefore
+            }
+        when: 'checking to see if cm handle is ready for retry'
+         def result = objectUnderTest.needsModuleSyncRetry(new CompositeStateBuilder()
+                .withLockReason(MODULE_SYNC_FAILED, lockDetails)
+                .withLastUpdatedTime(lastUpdatedTime).build())
+        then: 'retry is only attempted when expected'
+            assert result == retryExpected
+        and: 'logs contain related information'
+            def logs = loggingListAppender.list.toString()
+            assert logs.contains(logReason)
+        where: 'the following parameters are used'
+            scenario                                    | lastUpdateMinutesAgo | lockDetails          | logReason                               || retryExpected
+            'never attempted before'                    | -1                   | 'fist attempt:'      | 'First Attempt:'                        || true
+            '1st attempt, last attempt > 2 minute ago'  | 3                    | 'Attempt #1 failed:' | 'Retry due now'                         || true
+            '2nd attempt, last attempt < 4 minutes ago' | 1                    | 'Attempt #2 failed:' | 'Time until next attempt is 3 minutes:' || false
+            '2nd attempt, last attempt > 4 minutes ago' | 5                    | 'Attempt #2 failed:' | 'Retry due now'                         || true
     }
 
+    def 'Retry Locked Cm-Handle with other lock reasons (category) #lockReasonCategory'() {
+        when: 'checking to see if cm handle is ready for retry'
+            def result = objectUnderTest.needsModuleSyncRetry(new CompositeStateBuilder()
+                .withLockReason(lockReasonCategory, 'some details')
+                .withLastUpdatedTime(nowAsString).build())
+        then: 'retry attempt is never triggered'
+            assert result == false
+        and: 'logs contain related information'
+            def logs = loggingListAppender.list.toString()
+            assert logs.contains('Locked for other reason')
+        where: 'the following lock reasons occurred'
+            lockReasonCategory  << [MODULE_UPGRADE, MODULE_UPGRADE_FAILED]
+    }
 
     def 'Get a Cm-Handle where #scenario'() {
         given: 'the inventory persistence service returns a collection of data nodes'
index 07275e0..79ce228 100644 (file)
@@ -1,7 +1,7 @@
 {
   "cm-handle-state" : "ADVISED",
   "lock-reason" : {
-    "reason" : "LOCKED_MODULE_SYNC_FAILED",
+    "reason" : "MODULE_SYNC_FAILED",
     "details" : "lock details"
   },
   "last-update-time" : "2022-12-31T20:30:40.000+0000",
index a8de0ae..42555fb 100755 (executable)
@@ -32,7 +32,7 @@
 
     <groupId>org.onap.cps</groupId>
     <artifactId>cps-parent</artifactId>
-    <version>3.3.7-SNAPSHOT</version>
+    <version>3.3.8-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <properties>
index 325c303..8ce3fa5 100644 (file)
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.onap.cps</groupId>
         <artifactId>cps-parent</artifactId>
-        <version>3.3.7-SNAPSHOT</version>
+        <version>3.3.8-SNAPSHOT</version>
         <relativePath>../cps-parent/pom.xml</relativePath>
     </parent>
 
index 8d92d97..3137549 100755 (executable)
@@ -28,7 +28,7 @@
     <parent>
         <groupId>org.onap.cps</groupId>
         <artifactId>cps-parent</artifactId>
-        <version>3.3.7-SNAPSHOT</version>
+        <version>3.3.8-SNAPSHOT</version>
         <relativePath>../cps-parent/pom.xml</relativePath>
     </parent>
 
index 1a1c4a0..e1598ab 100644 (file)
@@ -26,7 +26,7 @@
     <parent>\r
         <groupId>org.onap.cps</groupId>\r
         <artifactId>cps-parent</artifactId>\r
-        <version>3.3.7-SNAPSHOT</version>\r
+        <version>3.3.8-SNAPSHOT</version>\r
         <relativePath>../cps-parent/pom.xml</relativePath>\r
     </parent>\r
 \r
index d4fe2e3..59428cd 100644 (file)
@@ -29,7 +29,7 @@
   <parent>
     <groupId>org.onap.cps</groupId>
     <artifactId>cps-parent</artifactId>
-    <version>3.3.7-SNAPSHOT</version>
+    <version>3.3.8-SNAPSHOT</version>
     <relativePath>../cps-parent/pom.xml</relativePath>
   </parent>
 
index ca90714..0235b00 100644 (file)
@@ -43,10 +43,11 @@ import org.opendaylight.yangtools.yang.model.api.Module;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.opendaylight.yangtools.yang.model.repo.api.RevisionSourceIdentifier;
 import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource;
-import org.opendaylight.yangtools.yang.parser.rfc7950.reactor.RFC7950Reactors;
-import org.opendaylight.yangtools.yang.parser.rfc7950.repo.YangStatementStreamSource;
-import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
-import org.opendaylight.yangtools.yang.parser.stmt.reactor.CrossSourceStatementReactor;
+import org.opendaylight.yangtools.yang.parser.api.YangParser;
+import org.opendaylight.yangtools.yang.parser.api.YangParserException;
+import org.opendaylight.yangtools.yang.parser.api.YangParserFactory;
+import org.opendaylight.yangtools.yang.parser.impl.DefaultYangParserFactory;
+import org.opendaylight.yangtools.yang.xpath.impl.di.DefaultXPathParserFactory;
 
 @NoArgsConstructor
 public final class YangTextSchemaSourceSetBuilder {
@@ -56,6 +57,9 @@ public final class YangTextSchemaSourceSetBuilder {
 
     private final ImmutableMap.Builder<String, String> yangModelMap = new ImmutableMap.Builder<>();
 
+    private static final YangParserFactory YANG_PARSER_FACTORY =
+            new DefaultYangParserFactory(new DefaultXPathParserFactory());
+
     /**
      * Add Yang resource context.
      *
@@ -136,11 +140,11 @@ public final class YangTextSchemaSourceSetBuilder {
      * @return the schema context
      */
     private static SchemaContext generateSchemaContext(final Map<String, String> yangResourceNameToContent) {
-        final CrossSourceStatementReactor.BuildAction reactor = RFC7950Reactors.defaultReactor().newBuild();
+        final YangParser yangParser = YANG_PARSER_FACTORY.createParser();
         for (final YangTextSchemaSource yangTextSchemaSource : forResources(yangResourceNameToContent)) {
             final String resourceName = yangTextSchemaSource.getIdentifier().getName();
             try {
-                reactor.addSource(YangStatementStreamSource.create(yangTextSchemaSource));
+                yangParser.addSource(yangTextSchemaSource);
             } catch (final Exception exception) {
                 throw new ModelValidationException("Yang resource processing exception.",
                     String.format("Could not process resource %s:%n%s", resourceName, exception.getMessage()),
@@ -148,13 +152,13 @@ public final class YangTextSchemaSourceSetBuilder {
             }
         }
         try {
-            return reactor.buildEffective();
-        } catch (final ReactorException reactorException) {
+            return yangParser.buildEffectiveModel();
+        } catch (final YangParserException yangParserException) {
             final List<String> resourceNames = yangResourceNameToContent.keySet().stream().collect(Collectors.toList());
             Collections.sort(resourceNames);
             throw new ModelValidationException("Invalid schema set.",
                 String.format("Effective schema context build failed for resources %s.", resourceNames),
-                reactorException);
+                yangParserException);
         }
     }
 
index b2912ee..16eb5f2 100644 (file)
@@ -58,17 +58,20 @@ Consume cloud event from client topic
     ${messages}=         Poll                group_id=${group_id}     only_value=false
     ${event}                        Set Variable                      ${messages}[0]
     ${headers}                      Set Variable                      ${event.headers()}
-    ${specVersionHeaderValue}       Set Variable                      ${headers[1][1]}
-    ${sourceHeaderValue}            Set Variable                      ${headers[3][1]}
-    ${typeHeaderValue}              Set Variable                      ${headers[4][1]}
-    ${correlationIdHeaderValue}     Set Variable                      ${headers[8][1]}
-    Should Be Equal As Strings      ${specVersionHeaderValue}         1.0
-    Should Be Equal As Strings      ${sourceHeaderValue}              DMI
-    Should Be Equal As Strings      ${correlationIdHeaderValue}       ${expectedRequestId}
-    Should Be Equal As Strings      ${typeHeaderValue}                org.onap.cps.ncmp.events.async1_0_0.DataOperationEvent
+    FOR   ${header_key_value_pair}   IN  @{headers}
+        Compare Header Values       ${header_key_value_pair[0]}   ${header_key_value_pair[1]}      "ce_specversion"      "1.0"
+        Compare Header Values       ${header_key_value_pair[0]}   ${header_key_value_pair[1]}      "ce_source"           "DMI"
+        Compare Header Values       ${header_key_value_pair[0]}   ${header_key_value_pair[1]}      "ce_type"             "org.onap.cps.ncmp.events.async1_0_0.DataOperationEvent"
+        Compare Header Values       ${header_key_value_pair[0]}   ${header_key_value_pair[1]}      "ce_correlationid"    "${expectedRequestId}"
+    END
     [Teardown]                      Basic Teardown                    ${group_id}
 
 *** Keywords ***
+Compare Header Values
+    [Arguments]                    ${header_key}        ${header_value}     ${header_to_check}       ${expected_header_value}
+    IF   "${header_key}" == ${header_to_check}
+        Should Be Equal As Strings              "${header_value}"    ${expected_header_value}
+    END
 
 Basic Teardown
     [Arguments]     ${group_id}
index b0e8665..2d5152a 100644 (file)
@@ -69,16 +69,20 @@ All Messages Are Produced and Consumed
     ${result}=                      Poll                        group_id=${GROUP_ID}      only_value=False
     ${headers}                      Set Variable                      ${result[0].headers()}
     ${value}                        Set Variable                      ${result[0].value()}
-    ${valueAsDict}=                 Evaluate                          json.loads("""${value}""")                              json
-    ${specVersionHeaderValue}       Set Variable                      ${headers[1][1]}
-    ${sourceHeaderValue}            Set Variable                      ${headers[3][1]}
-    ${typeHeaderValue}              Set Variable                      ${headers[4][1]}
-    ${correlationIdHeaderValue}     Set Variable                      ${headers[6][1]}
+    ${valueAsDict}=                 Evaluate                          json.loads("""${value}""")                        json
+    FOR   ${header_key_value_pair}   IN  @{headers}
+        Compare Header Values       ${header_key_value_pair[0]}   ${header_key_value_pair[1]}     "ce_specversion"      "1.0"
+        Compare Header Values       ${header_key_value_pair[0]}   ${header_key_value_pair[1]}     "ce_source"           "NCMP"
+        Compare Header Values       ${header_key_value_pair[0]}   ${header_key_value_pair[1]}     "ce_type"             "subscriptionCreatedStatus"
+        Compare Header Values       ${header_key_value_pair[0]}   ${header_key_value_pair[1]}     "ce_correlationid"    "SCO-9989752cm-subscription-001"
+    END
     Dictionaries Should Be Equal    ${valueAsDict}                    ${ncmpOutEventJsonGlobal}
-    Should Be Equal As Strings      ${specVersionHeaderValue}         1.0
-    Should Be Equal As Strings      ${sourceHeaderValue}              NCMP
-    Should Be Equal As Strings      ${typeHeaderValue}                subscriptionCreatedStatus
-    Should Be Equal As Strings      ${correlationIdHeaderValue}       SCO-9989752cm-subscription-001
+
+Compare Header Values
+    [Arguments]                    ${header_key}        ${header_value}      ${header_to_check}       ${expected_header_value}
+    IF   "${header_key}" == ${header_to_check}
+        Should Be Equal As Strings              "${header_value}"    ${expected_header_value}
+    END
 
 Basic Teardown
     [Arguments]                     ${group_id}
index 2d3a9be..3663b82 100644 (file)
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.onap.cps</groupId>
         <artifactId>dmi-plugin-demo-and-csit-stub</artifactId>
-        <version>3.3.7-SNAPSHOT</version>
+        <version>3.3.8-SNAPSHOT</version>
     </parent>
 
     <artifactId>dmi-plugin-demo-and-csit-stub-app</artifactId>
index 53f1985..8daddba 100644 (file)
@@ -21,7 +21,7 @@
     <parent>
         <groupId>org.onap.cps</groupId>
         <artifactId>dmi-plugin-demo-and-csit-stub</artifactId>
-        <version>3.3.7-SNAPSHOT</version>
+        <version>3.3.8-SNAPSHOT</version>
     </parent>
     <artifactId>dmi-plugin-demo-and-csit-stub-service</artifactId>
 
index f9f4197..4304769 100644 (file)
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.onap.cps</groupId>
         <artifactId>cps-parent</artifactId>
-        <version>3.3.7-SNAPSHOT</version>
+        <version>3.3.8-SNAPSHOT</version>
         <relativePath>../cps-parent/pom.xml</relativePath>
     </parent>
 
index 6203c85..af6b004 100644 (file)
@@ -265,22 +265,26 @@ components:
             key: my-property
           cmHandleProperties:
             key: my-property
+          moduleSetTag: my-module-set-tag
         - cmHandle: my-cm-handle
           publicCmHandleProperties:
             key: my-property
           cmHandleProperties:
             key: my-property
+          moduleSetTag: my-module-set-tag
         createdCmHandles:
         - cmHandle: my-cm-handle
           publicCmHandleProperties:
             key: my-property
           cmHandleProperties:
             key: my-property
+          moduleSetTag: my-module-set-tag
         - cmHandle: my-cm-handle
           publicCmHandleProperties:
             key: my-property
           cmHandleProperties:
             key: my-property
+          moduleSetTag: my-module-set-tag
         dmiPlugin: my-dmi-plugin
         dmiModelPlugin: my-dmi-model-plugin
         dmiDataPlugin: my-dmi-data-plugin
@@ -325,6 +329,7 @@ components:
           key: my-property
         cmHandleProperties:
           key: my-property
+        moduleSetTag: my-module-set-tag
       properties:
         cmHandle:
           example: my-cm-handle
@@ -339,6 +344,9 @@ components:
             example: my-property
             type: string
           type: object
+        moduleSetTag:
+          example: my-module-set-tag
+          type: string
       required:
       - cmHandle
       type: object
index 3807d71..acc32e3 100644 (file)
@@ -310,3 +310,31 @@ CPS-Core Docker Installation
 
 CPS-Core can also be installed in a docker environment. Latest `docker-compose <https://github.com/onap/cps/blob/master/docker-compose/docker-compose.yml>`_ is included in the repo to start all the relevant services.
 The latest instructions are covered in the `README <https://github.com/onap/cps/blob/master/docker-compose/README.md>`_.
+
+CPS-Core and NCMP Distributed Datastructures
+============================================
+
+CPS-Core and NCMP both internally uses embedded distributed datastructure to replicate the state across various instances for low latency.
+These instances require some additional ports to be available. The default range starts from 5701 and based on the number of instances configured they are incremented sequentially.
+
+Below are the list of distributed datastructures that we have.
+
++--------------+---------------------------------+----------------------------------------------------------+
+| Component    | Datastructure name              |                 Use                                      |
++==============+=================================+==========================================================+
+| cps-core     | anchorDataCache                 | Used to resolve prefix for the container name.           |
++--------------+---------------------------------+----------------------------------------------------------+
+| cps-ncmp     | moduleSyncStartedOnCmHandles    | Watchdog process to register cmHandles.                  |
++--------------+---------------------------------+----------------------------------------------------------+
+| cps-ncmp     | dataSyncSemaphores              | Watchdog process to sync data from the nodes.            |
++--------------+---------------------------------+----------------------------------------------------------+
+| cps-ncmp     | moduleSyncWorkQueue             | Queue used internally for workers to pick the task.      |
++--------------+---------------------------------+----------------------------------------------------------+
+| cps-ncmp     | forwardedSubscriptionEventCache | Keeps track of the LCM Subscription Events.              |
++--------------+---------------------------------+----------------------------------------------------------+
+| cps-ncmp     | untrustworthyCmHandlesSet       | Stores untrustworthy cmHandles whose TrustLevel is NONE. |
++--------------+---------------------------------+----------------------------------------------------------+
+| cps-ncmp     | trustLevelPerDmiPlugin          | Stores the TrustLevel for the dmi-plugins.               |
++--------------+---------------------------------+----------------------------------------------------------+
+
+Total number of caches : 7
\ No newline at end of file
index 013617a..ee0ea9a 100755 (executable)
@@ -16,6 +16,33 @@ CPS Release Notes
 ..      * * *   MONTREAL   * * *
 ..      ========================
 
+Version: 3.3.8
+==============
+
+Release Data
+------------
+
++--------------------------------------+--------------------------------------------------------+
+| **CPS Project**                      |                                                        |
+|                                      |                                                        |
++--------------------------------------+--------------------------------------------------------+
+| **Docker images**                    | onap/cps-and-ncmp:3.3.8                                |
+|                                      |                                                        |
++--------------------------------------+--------------------------------------------------------+
+| **Release designation**              | 3.3.8 Montreal                                         |
+|                                      |                                                        |
++--------------------------------------+--------------------------------------------------------+
+| **Release date**                     | Not yet released                                       |
+|                                      |                                                        |
++--------------------------------------+--------------------------------------------------------+
+
+Bug Fixes
+---------
+3.3.8
+
+Features
+--------
+
 Version: 3.3.7
 ==============
 
@@ -32,13 +59,14 @@ Release Data
 | **Release designation**              | 3.3.7 Montreal                                         |
 |                                      |                                                        |
 +--------------------------------------+--------------------------------------------------------+
-| **Release date**                     | Not yet released                                       |
+| **Release date**                     | 2023 September 20                                      |
 |                                      |                                                        |
 +--------------------------------------+--------------------------------------------------------+
 
 Bug Fixes
 ---------
 3.3.7
+    - `CPS-1866 <https://jira.onap.org/browse/CPS-1866>`_ Fix ClassDefNotFoundError in opendaylight Yang parser
 
 Features
 --------
index 9ae7d0c..af67a5f 100644 (file)
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.onap.cps</groupId>
         <artifactId>cps-parent</artifactId>
-        <version>3.3.7-SNAPSHOT</version>
+        <version>3.3.8-SNAPSHOT</version>
         <relativePath>../cps-parent/pom.xml</relativePath>
     </parent>
 
index c8a3be8..22e071f 100644 (file)
@@ -5,7 +5,7 @@
     <parent>
         <groupId>org.onap.cps</groupId>
         <artifactId>cps-parent</artifactId>
-        <version>3.3.7-SNAPSHOT</version>
+        <version>3.3.8-SNAPSHOT</version>
         <relativePath>../cps-parent/pom.xml</relativePath>
     </parent>
     <modelVersion>4.0.0</modelVersion>
diff --git a/pom.xml b/pom.xml
index 0834767..71310fb 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -32,7 +32,7 @@
 \r
     <groupId>org.onap.cps</groupId>\r
     <artifactId>cps-aggregator</artifactId>\r
-    <version>3.3.7-SNAPSHOT</version>\r
+    <version>3.3.8-SNAPSHOT</version>\r
     <packaging>pom</packaging>\r
 \r
     <name>cps</name>\r
diff --git a/releases/3.3.7-container.yaml b/releases/3.3.7-container.yaml
new file mode 100644 (file)
index 0000000..04b6fa5
--- /dev/null
@@ -0,0 +1,8 @@
+distribution_type: container
+container_release_tag: 3.3.7
+project: cps
+log_dir: cps-maven-docker-stage-master/928/
+ref: c3e7b0e3ab0d3b3155d713f639080bdd036d7ba2
+containers:
+  - name: 'cps-and-ncmp'
+    version: '3.3.7-20230920T152321Z'
\ No newline at end of file
diff --git a/releases/3.3.7.yaml b/releases/3.3.7.yaml
new file mode 100644 (file)
index 0000000..b0a0563
--- /dev/null
@@ -0,0 +1,4 @@
+distribution_type: maven
+log_dir: cps-maven-stage-master/936/
+project: cps
+version: 3.3.7
\ No newline at end of file
index daa4756..d511c0f 100644 (file)
@@ -25,7 +25,7 @@
     <modelVersion>4.0.0</modelVersion>
     <groupId>org.onap.cps</groupId>
     <artifactId>spotbugs</artifactId>
-    <version>3.3.7-SNAPSHOT</version>
+    <version>3.3.8-SNAPSHOT</version>
 
     <properties>
         <nexusproxy>https://nexus.onap.org</nexusproxy>
index b583c9e..4709bf1 100755 (executable)
@@ -22,7 +22,7 @@
 
 major=3
 minor=3
-patch=7
+patch=8
 
 base_version=${major}.${minor}.${patch}