You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ri...@apache.org on 2026/05/11 12:00:55 UTC

(streampipes) branch fix-wrong-transformation-migration created (now da1cff6687)

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

dominikriemer pushed a change to branch fix-wrong-transformation-migration
in repository https://gitbox.apache.org/repos/asf/streampipes.git


      at da1cff6687 fix: Avoid migration of adapters with existing transformation config

This branch includes the following new commits:

     new da1cff6687 fix: Avoid migration of adapters with existing transformation config

The 1 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.



(streampipes) 01/01: fix: Avoid migration of adapters with existing transformation config

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

dominikriemer pushed a commit to branch fix-wrong-transformation-migration
in repository https://gitbox.apache.org/repos/asf/streampipes.git

commit da1cff6687f4980f08b42bcc9955afbd495759a5
Author: Dominik Riemer <do...@gmail.com>
AuthorDate: Mon May 11 14:00:38 2026 +0200

    fix: Avoid migration of adapters with existing transformation config
---
 .../migrations/v099/connect/MigrateAdaptersToUseScript.java  | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/streampipes-service-core/src/main/java/org/apache/streampipes/service/core/migrations/v099/connect/MigrateAdaptersToUseScript.java b/streampipes-service-core/src/main/java/org/apache/streampipes/service/core/migrations/v099/connect/MigrateAdaptersToUseScript.java
index 7d96411048..76f6acd0ea 100644
--- a/streampipes-service-core/src/main/java/org/apache/streampipes/service/core/migrations/v099/connect/MigrateAdaptersToUseScript.java
+++ b/streampipes-service-core/src/main/java/org/apache/streampipes/service/core/migrations/v099/connect/MigrateAdaptersToUseScript.java
@@ -61,15 +61,15 @@ public class MigrateAdaptersToUseScript implements Migration {
   // Execute if there is an adapter with no transformation config or script
   public boolean shouldExecute() {
     List<AdapterDescription> adapters = adapterStorage.findAll();
-    return adapters != null && adapters.stream()
-                                       .anyMatch(adapter -> adapter.getTransformationConfig() == null || adapter.getTransformationConfig()
-                                                                                                                .getScript() == null);
+    return adapters != null && adapters.stream().anyMatch(this::hasEmptyTransformationConfig);
   }
 
   @Override
   public void executeMigration() throws IOException {
     adapterStorage.findAll()
-                  .forEach(this::migrateAndUpdateAdapter);
+        .stream()
+        .filter(this::hasEmptyTransformationConfig)
+        .forEach(this::migrateAndUpdateAdapter);
   }
 
   @Override
@@ -77,6 +77,10 @@ public class MigrateAdaptersToUseScript implements Migration {
     return "Changes the rules based adapters to use script based transformations instead.";
   }
 
+  private boolean hasEmptyTransformationConfig(AdapterDescription adapter) {
+    return adapter.getTransformationConfig() == null || adapter.getTransformationConfig().getScript() == null;
+  }
+
   private void migrateAndUpdateAdapter(AdapterDescription adapterDescription) {
     LOG.info("Migrating adapter to script preprosessing: {}", adapterDescription.getName());