You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by "rhkp (via GitHub)" <gi...@apache.org> on 2024/10/22 19:16:15 UTC

[PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

rhkp opened a new pull request, #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697

   Closes #2659 
   Add kogito-db-migrator-tool and kogito-db-migrator-tool-image packages for use by the SonataFlow Operator.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1893221918


##########
packages/kogito-db-migrator-tool-image/README.md:
##########
@@ -0,0 +1,116 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+     http://www.apache.org/licenses/LICENSE-2.0
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+-->
+
+# Kogito Postgres DB Migrator Tool Image
+
+This package contains the `Containerfile/Dockerfile` and scripts to build a container image for Kogito Postgres DB Migrator Tool. Details about the Kogito Postgres DB Migrator Tool can be found [here](../kogito-db-migrator-tool/README.md).
+
+## Additional requirements
+
+- docker
+
+## Build
+
+_NOTE_: Before performing this step, be sure that the Kogito Postgres DB Migrator Tool jar has been built and available for inclusion in the image.
+
+- Enable the image to be built:
+
+  ```bash
+  export KIE_TOOLS_BUILD__buildContainerImages=true
+  ```
+
+Run the following in the root folder of the repository to build the package:
+
+```bash
+pnpm -F @kie-tools/kogito-db-migrator-tool-image... build:prod
+```
+
+- Then check if the image is correctly stored:
+
+  ```bash
+  docker images
+  ```
+
+## Run
+
+- Start up a clean container with:
+
+  ```bash
+    docker run docker.io/apache/incubator-kie-kogito-service-db-migration-postgresql:latest

Review Comment:
   Hi @wmedvede/ @ricardozanini,
   I spent more time on this one. 
   
   **EXECUTE DB MIGRATOR JAVA JAR IN TERMINAL(WITHOUT IMAGE I MEAN)**
   - The execution of the DB migrator with `java -jar target/quarkus-app/quarkus-run.jar` gives identical results whether the export QUARKUS_PLATFORM_VERSION=3.8.6 variable is set or not.
   - Meaning in any of the situation above I am not seeing 999-SNAPSHOTS log.
   - Please note the WARN message for 999-SNAPSHOT comes from `[io.qua.run.con.ConfigRecorder]` package, when we are using image and I do not at all see this package in the logs in these scenarios.
   
   **COMPARE DB MIGRATOR IMAGE build FOLDERS**
   - I compared TWO directories one built with env vars set and another without setting one.
   - The files are identical in this case too.
   - And not sure where the 999-SNAPSHOT appears from.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "wmedvede (via GitHub)" <gi...@apache.org>.
wmedvede commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1890152113


##########
packages/kogito-db-migrator-tool-image/README.md:
##########
@@ -0,0 +1,116 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+     http://www.apache.org/licenses/LICENSE-2.0
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+-->
+
+# Kogito Postgres DB Migrator Tool Image
+
+This package contains the `Containerfile/Dockerfile` and scripts to build a container image for Kogito Postgres DB Migrator Tool. Details about the Kogito Postgres DB Migrator Tool can be found [here](../kogito-db-migrator-tool/README.md).
+
+## Additional requirements
+
+- docker
+
+## Build
+
+_NOTE_: Before performing this step, be sure that the Kogito Postgres DB Migrator Tool jar has been built and available for inclusion in the image.
+
+- Enable the image to be built:
+
+  ```bash
+  export KIE_TOOLS_BUILD__buildContainerImages=true
+  ```
+
+Run the following in the root folder of the repository to build the package:
+
+```bash
+pnpm -F @kie-tools/kogito-db-migrator-tool-image... build:prod

Review Comment:
   I don't think this is good, let me explain.
   
   When we build other modules, e.g.
   
   pnpm -F sonataflow-quarkus-devui... build:prod
   
   along the build chain, if nothing is set, the version number 0.0.0 is used. 
   Developers don't need to do any particular setting, just clone the project, pnpm bootstrap, and then build the module of their need.
   
   see example:
   
   ![Screenshot from 2024-12-18 13-16-22](https://github.com/user-attachments/assets/2c67982d-e2d3-47dc-9267-9fab495fd470)
   
   
   This new module must work the same way, and by default, the produced version must be 0.0.0.
   
   
   In the local maven repository, I can see that this module is producing this:
   
   ![image](https://github.com/user-attachments/assets/17800382-1b82-4ede-88a5-3cce958134b5)
   
   not good.
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1930722200


##########
packages/kogito-db-migrator-tool/src/main/java/org/kie/kogito/postgresql/migrator/MigrationService.java:
##########
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.kie.kogito.postgresql.migrator;

Review Comment:
   Updated source and test packages.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1811347524


##########
packages/kogito-db-migrator-tool/src/main/cekit/modules/kogito-postgres-db-migration-deps/migration.sh:
##########
@@ -0,0 +1,36 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+set -x
+set -e
+
+OPERATOR_VERSION=999.0.0
+
+for arg in "$@"; do
+   case "$arg" in
+      OPERATOR_VERSION=*) OPERATOR_VERSION="${arg#*=}" ;;
+   esac
+done
+
+cd /home/kogito/
+
+mv sonataflow-db-migrator-runner.jar sonataflow-db-migrator-"$OPERATOR_VERSION"-runner.jar

Review Comment:
   Correct, they are included in the kogito-db-migrator-tool-image package. They are deleted from kogito-db-migrator-tool package, as they are irrelevant.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1813396877


##########
packages/kogito-db-migrator-tool/install.js:
##########
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+const { env } = require("./env");
+const { setupMavenConfigFile, installMvnw, buildTailFromPackageJsonDependencies } = require("@kie-tools/maven-base");
+
+setupMavenConfigFile(
+  `
+    --batch-mode
+    -Dstyle.color=always
+    -Drevision=${env.devDeploymentQuarkusApp.version}

Review Comment:
   @ricardozanini  Please elaborate on this comment. This file comes from `dev-deployment-kogito-quarkus-blank-app` package.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "wmedvede (via GitHub)" <gi...@apache.org>.
wmedvede commented on PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#issuecomment-2589666122

   Hi @tiagobento , when you got some time, would you mind take a look if your suggestions where addressed?
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1917214895


##########
packages/kogito-db-migrator-tool-image/README.md:
##########
@@ -0,0 +1,116 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+     http://www.apache.org/licenses/LICENSE-2.0
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+-->
+

Review Comment:
   Okay, removed the image build section.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#issuecomment-2605794052

   > I'm fine with either approach @wmedvede, just as long as the name of package is clear and the intentions and scope of the new packages are well defined.
   > 
   > If you want to evolve a single package into a multi-db migration tool, that's fine for me. As well as if you want to have one package per db migration tool. Finding the right granularity is more of an art than a science, so even if the strategy chosen today doesn't evolve well, we can always change. The package abstraction is flexible enough to accommodate for changes like that, so please feel free to proceed in the way you feel is best now.
   > 
   > My request is just that the names and descriptions align with this initial strategy. Thx!
   
   Hi @tiagobento @wmedvede @ricardozanini 
   I think in this `wave` of implementation we are focussing on `postgreSQL` so I would suggest to keep it that way: keep postgreSQL in the package name. 
   In future when we do expand this functionality we can remove the `postgreSQL` from the name.
   WDYT? 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1917261544


##########
packages/kogito-db-migrator-tool/README.md:
##########
@@ -0,0 +1,31 @@
+# Kogito Postgres DB Migrator Tool

Review Comment:
   Renamed the packages to `kogito-postgresql-db-migrator-tool` 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1821306156


##########
packages/kogito-db-migrator-tool/package.json:
##########
@@ -0,0 +1,33 @@
+{
+  "private": true,
+  "name": "@kie-tools/kogito-db-migrator-tool",
+  "version": "0.0.0",
+  "description": "",
+  "license": "Apache-2.0",
+  "homepage": "https://github.com/apache/incubator-kie-tools",
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/apache/incubator-kie-tools.git"
+  },
+  "bugs": {
+    "url": "https://github.com/apache/incubator-kie-tools/issues"
+  },
+  "scripts": {
+    "build:dev": "pnpm install && ./build-db-migrator-jar.sh true",
+    "build:prod": "pnpm install && ./build-db-migrator-jar.sh false",

Review Comment:
   @tiagobento 
   Done, please check and advise if you need any more change there. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "ricardozanini (via GitHub)" <gi...@apache.org>.
ricardozanini commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1822698191


##########
packages/kogito-db-migrator-tool/install.js:
##########
@@ -0,0 +1,18 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */

Review Comment:
   Oh yes, I commented in the wrong file 😮‍💨 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "ricardozanini (via GitHub)" <gi...@apache.org>.
ricardozanini commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1815042982


##########
packages/kogito-db-migrator-tool-image/build-container-image.sh:
##########
@@ -0,0 +1,40 @@
+#!/bin/sh
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+set -x
+set -e
+
+CEKIT_BUILDER=docker
+SOURCE_FILE=/tmp/kogito-db-migrator-tool/sonataflow-db-migrator-0.0.0-runner.jar
+TARGET_FILE=./cekit/modules/kogito-postgres-db-migration-deps/sonataflow-db-migrator-runner.jar
+
+if [ -f "$SOURCE_FILE" ]; then
+   echo "The file: $SOURCE_FILE found and will be used to build image."
+   rm -f $TARGET_FILE
+   cp $SOURCE_FILE $TARGET_FILE
+
+   # Build the container image
+   cd ./cekit || exit
+   cekit -v build "$CEKIT_BUILDER"
+   rm -f $TARGET_FILE
+else
+   echo "The file: $SOURCE_FILE not found. Please build kogito-db-migrator-tool package first before building the image."
+   exit 1
+fi

Review Comment:
   Yes



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "ricardozanini (via GitHub)" <gi...@apache.org>.
ricardozanini commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1817220036


##########
packages/kogito-db-migrator-tool/env/index.js:
##########
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+const { varsWithName, composeEnv, getOrDefault } = require("@kie-tools-scripts/build-env");
+
+module.exports = composeEnv([require("@kie-tools/root-env/env")], {
+  vars: varsWithName({
+    KOGITO_DB_MIGRATOR_TOOL__ddl_version: {
+      default: "10.0.999-SNAPSHOT",
+      description: "The version to use for ddl.",
+    },
+    KOGITO_DB_MIGRATOR_TOOL__ddl_file_name: {
+      default: "kogito-ddl-10.0.999-20241018.012042-73-db-scripts.zip",
+      description: "The file name for ddl.",
+    },
+    KOGITO_DB_MIGRATOR_TOOL__ddl_base_url: {
+      default: "https://repository.apache.org/content/groups/snapshots/org/kie/kogito/kogito-ddl",
+      description: "The url from where the ddl file will be downloaded.",
+    },

Review Comment:
   @rhkp I can elaborate more:
   
   - KOGITO_DB_MIGRATOR_TOOL__ddl_version: this can come from here https://github.com/apache/incubator-kie-tools/blob/main/packages/root-env/env/index.js#L72C5-L72C27
   - KOGITO_DB_MIGRATOR_TOOL__ddl_file_name: this must be a combination of the above and the filename
   - KOGITO_DB_MIGRATOR_TOOL__ddl_base_url: this must come from `mvn dependency:download`. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1889297033


##########
packages/kogito-db-migrator-tool/src/main/java/org/kie/kogito/postgresql/migrator/DBMigrator.java:
##########
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.kie.kogito.postgresql.migrator;
+
+import io.quarkus.runtime.Quarkus;
+import io.quarkus.runtime.QuarkusApplication;
+import io.quarkus.runtime.annotations.QuarkusMain;
+import jakarta.inject.Inject;
+import io.quarkus.logging.Log;
+
+import java.sql.SQLException;
+
+import org.eclipse.microprofile.config.inject.ConfigProperty;
+
+@QuarkusMain
+public class DBMigrator implements QuarkusApplication {
+
+    @Inject
+    MigrationService service;
+
+    @Inject
+    DBConnectionChecker dbConnectionChecker;
+
+    @ConfigProperty(name = "migrate.db.dataindex")
+    Boolean migrateDataIndex;
+
+    @ConfigProperty(name = "migrate.db.jobsservice")
+    Boolean migrateJobsService;
+
+    @Override
+    public int run(String... args) {
+        if (migrateDataIndex) {
+            try {
+                dbConnectionChecker.checkDataIndexDBConnection();
+            } catch (SQLException e) {
+                Log.error( "Error obtaining data index database connection. Cannot proceed, exiting.");
+                Quarkus.asyncExit(-1);
+                return -1;

Review Comment:
   Yes it refers to Data Index DB connection error/issue.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1890643197


##########
packages/kogito-db-migrator-tool-image/README.md:
##########
@@ -0,0 +1,116 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+     http://www.apache.org/licenses/LICENSE-2.0
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+-->
+
+# Kogito Postgres DB Migrator Tool Image
+
+This package contains the `Containerfile/Dockerfile` and scripts to build a container image for Kogito Postgres DB Migrator Tool. Details about the Kogito Postgres DB Migrator Tool can be found [here](../kogito-db-migrator-tool/README.md).
+
+## Additional requirements
+
+- docker
+
+## Build
+
+_NOTE_: Before performing this step, be sure that the Kogito Postgres DB Migrator Tool jar has been built and available for inclusion in the image.
+
+- Enable the image to be built:
+
+  ```bash
+  export KIE_TOOLS_BUILD__buildContainerImages=true
+  ```
+
+Run the following in the root folder of the repository to build the package:
+
+```bash
+pnpm -F @kie-tools/kogito-db-migrator-tool-image... build:prod
+```
+
+- Then check if the image is correctly stored:
+
+  ```bash
+  docker images
+  ```
+
+## Run
+
+- Start up a clean container with:
+
+  ```bash
+    docker run docker.io/apache/incubator-kie-kogito-service-db-migration-postgresql:latest

Review Comment:
   This is what I found, when **building the DB Migrator Image**: 
   if the `QUARKUS_PLATFORM_VERSION` env var in terminal is **not set**, the 999-SNAPSHOT version appears. 
   
   However when the `QUARKUS_PLATFORM_VERSION` env var in terminal is set when the image is built with a value such as `3.8.6` this does not appear.
   
   However not sure where and why the `999-SNAPSHOT` version is being specifically picked up, as the DB migrator tool and/or image do not specifically use these versions.
   
   A quick search of this string in sources shows `999-SNAPSHOT` is not used in the tool e.g.
   <img width="555" alt="image" src="https://github.com/user-attachments/assets/333e1453-ebfb-40a6-a500-03aff7161c31" />
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1821447308


##########
packages/kogito-db-migrator-tool-image/resources/kogito-db-migrator-tool-image.yaml:
##########
@@ -0,0 +1,49 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+name: "docker.io/apache/kogito-db-migrator-tool"
+version: "main"
+from: registry.access.redhat.com/ubi8/openjdk-17-runtime:1.20
+description: Flyway image for DI/JS database migration

Review Comment:
   Updated in this file as Data Index and Jobs Service



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "tiagobento (via GitHub)" <gi...@apache.org>.
tiagobento commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1821412713


##########
packages/kogito-db-migrator-tool-image/resources/kogito-db-migrator-tool-image.yaml:
##########
@@ -0,0 +1,49 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+name: "docker.io/apache/kogito-db-migrator-tool"
+version: "main"

Review Comment:
   @ricardozanini We need to make sure that this is updated by `update-stream-name-to`.



##########
packages/kogito-db-migrator-tool-image/resources/build-container-image.sh:
##########
@@ -0,0 +1,35 @@
+#!/bin/sh
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+set -x
+set -e
+
+CEKIT_BUILDER=docker
+SOURCE_FILE=/tmp/kogito-db-migrator-tool/sonataflow-db-migrator-0.0.0-runner.jar

Review Comment:
   0.0.0 cannot be hard-coded like this here.



##########
packages/kogito-db-migrator-tool/README.md:
##########
@@ -0,0 +1,39 @@
+# Kogito Postgres DB Migrator Tool
+
+This is a java quarkus based postgres database migrator application for SonataFlow Data Index and Jobs Service applications for use by SonataFlow Operator.

Review Comment:
   ```suggestion
   This is a Java, Quarkus-based PostgreSQL database migrator application for Data-Index and Jobs Service applications for use by SonataFlow Operator.
   ```



##########
packages/kogito-db-migrator-tool-image/resources/modules/kogito-postgres-db-migration-deps/module.yaml:
##########
@@ -0,0 +1,25 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+schema_version: 1
+name: org.kie.kogito.postgresql.db-migration-deps
+version: "main"

Review Comment:
   Same here. @ricardozanini 



##########
packages/kogito-db-migrator-tool/pom.xml:
##########
@@ -0,0 +1,165 @@
+<?xml version="1.0" ?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+-->
+<project
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
+  xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+>
+  <parent>
+    <groupId>org.kie</groupId>
+    <artifactId>kie-tools-maven-base</artifactId>
+    <version>${revision}</version>
+    <relativePath>./node_modules/@kie-tools/maven-base/pom.xml</relativePath>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.kie.kogito</groupId>
+  <artifactId>sonataflow-db-migrator</artifactId>
+
+  <dependencies>
+    <dependency>
+      <groupId>io.quarkus</groupId>
+      <artifactId>quarkus-flyway</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.quarkus</groupId>
+      <artifactId>quarkus-jdbc-postgresql</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.quarkus</groupId>
+      <artifactId>quarkus-arc</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.quarkus</groupId>
+      <artifactId>quarkus-junit5</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-junit-jupiter</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-core</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>com.github.stefanbirkner</groupId>
+      <artifactId>system-rules</artifactId>
+      <version>${version.com.github.stefanbirkner.systemrules}</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <testSourceDirectory>src/test/java</testSourceDirectory>
+    <plugins>
+      <!-- Use mvn dependency:unpack command to unzip ddl files and mvn dependency:copy to copy into destination -->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <version>3.8.1</version>
+        <configuration>
+          <artifactItems>
+            <artifactItem>
+              <groupId>org.kie.kogito</groupId>
+              <artifactId>kogito-ddl</artifactId>
+              <version>${version.org.kie.kogito}</version>
+              <classifier>db-scripts</classifier>
+              <type>zip</type>
+              <overWrite>true</overWrite>
+              <outputDirectory>src/main/resources</outputDirectory>
+              <destFileName>kogito-ddl-db-scripts.zip</destFileName>
+            </artifactItem>
+          </artifactItems>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>io.quarkus</groupId>
+        <artifactId>quarkus-maven-plugin</artifactId>
+        <extensions>true</extensions>
+        <executions>
+          <execution>
+            <goals>
+              <goal>build</goal>
+              <goal>generate-code</goal>
+              <goal>generate-code-tests</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <compilerArgs>
+            <arg>-parameters</arg>
+          </compilerArgs>
+        </configuration>
+      </plugin>
+      <plugin>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <version>${version.maven.surefire.plugin}</version>

Review Comment:
   ```suggestion
   ```



##########
packages/kogito-db-migrator-tool-image/resources/kogito-db-migrator-tool-image.yaml:
##########
@@ -0,0 +1,49 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+name: "docker.io/apache/kogito-db-migrator-tool"
+version: "main"
+from: registry.access.redhat.com/ubi8/openjdk-17-runtime:1.20
+description: Flyway image for DI/JS database migration

Review Comment:
   What is DI/JS please?



##########
packages/kogito-db-migrator-tool/pom.xml:
##########
@@ -0,0 +1,165 @@
+<?xml version="1.0" ?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+-->
+<project
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
+  xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+>
+  <parent>
+    <groupId>org.kie</groupId>
+    <artifactId>kie-tools-maven-base</artifactId>
+    <version>${revision}</version>
+    <relativePath>./node_modules/@kie-tools/maven-base/pom.xml</relativePath>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.kie.kogito</groupId>
+  <artifactId>sonataflow-db-migrator</artifactId>
+
+  <dependencies>
+    <dependency>
+      <groupId>io.quarkus</groupId>
+      <artifactId>quarkus-flyway</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.quarkus</groupId>
+      <artifactId>quarkus-jdbc-postgresql</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.quarkus</groupId>
+      <artifactId>quarkus-arc</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.quarkus</groupId>
+      <artifactId>quarkus-junit5</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-junit-jupiter</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-core</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>com.github.stefanbirkner</groupId>
+      <artifactId>system-rules</artifactId>
+      <version>${version.com.github.stefanbirkner.systemrules}</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <testSourceDirectory>src/test/java</testSourceDirectory>
+    <plugins>
+      <!-- Use mvn dependency:unpack command to unzip ddl files and mvn dependency:copy to copy into destination -->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <version>3.8.1</version>

Review Comment:
   ```suggestion
           <artifactId>maven-dependency-plugin</artifactId>
   ```
   
   <groupId> is unnecessary here.
   <version> comes from `maven-base`



##########
packages/kogito-db-migrator-tool/pom.xml:
##########
@@ -0,0 +1,165 @@
+<?xml version="1.0" ?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+-->
+<project
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
+  xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+>
+  <parent>
+    <groupId>org.kie</groupId>
+    <artifactId>kie-tools-maven-base</artifactId>
+    <version>${revision}</version>
+    <relativePath>./node_modules/@kie-tools/maven-base/pom.xml</relativePath>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.kie.kogito</groupId>
+  <artifactId>sonataflow-db-migrator</artifactId>
+
+  <dependencies>
+    <dependency>
+      <groupId>io.quarkus</groupId>
+      <artifactId>quarkus-flyway</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.quarkus</groupId>
+      <artifactId>quarkus-jdbc-postgresql</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.quarkus</groupId>
+      <artifactId>quarkus-arc</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.quarkus</groupId>
+      <artifactId>quarkus-junit5</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-junit-jupiter</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-core</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>com.github.stefanbirkner</groupId>
+      <artifactId>system-rules</artifactId>
+      <version>${version.com.github.stefanbirkner.systemrules}</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <testSourceDirectory>src/test/java</testSourceDirectory>
+    <plugins>
+      <!-- Use mvn dependency:unpack command to unzip ddl files and mvn dependency:copy to copy into destination -->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <version>3.8.1</version>
+        <configuration>
+          <artifactItems>
+            <artifactItem>
+              <groupId>org.kie.kogito</groupId>
+              <artifactId>kogito-ddl</artifactId>
+              <version>${version.org.kie.kogito}</version>
+              <classifier>db-scripts</classifier>
+              <type>zip</type>
+              <overWrite>true</overWrite>
+              <outputDirectory>src/main/resources</outputDirectory>
+              <destFileName>kogito-ddl-db-scripts.zip</destFileName>
+            </artifactItem>
+          </artifactItems>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>io.quarkus</groupId>
+        <artifactId>quarkus-maven-plugin</artifactId>
+        <extensions>true</extensions>
+        <executions>
+          <execution>
+            <goals>
+              <goal>build</goal>
+              <goal>generate-code</goal>
+              <goal>generate-code-tests</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <compilerArgs>
+            <arg>-parameters</arg>
+          </compilerArgs>
+        </configuration>
+      </plugin>
+      <plugin>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <version>${version.maven.surefire.plugin}</version>
+        <configuration>
+          <systemPropertyVariables>
+            <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
+            <maven.home>${maven.home}</maven.home>
+          </systemPropertyVariables>
+        </configuration>
+      </plugin>
+      <plugin>
+        <artifactId>maven-failsafe-plugin</artifactId>
+        <version>${version.maven.surefire.plugin}</version>
+        <executions>
+          <execution>
+            <goals>
+              <goal>integration-test</goal>
+              <goal>verify</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <systemPropertyVariables>
+            <native.image.path>${project.build.directory}/${project.build.finalName}-runner
+                        </native.image.path>
+            <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
+            <maven.home>${maven.home}</maven.home>
+          </systemPropertyVariables>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.jacoco</groupId>
+        <artifactId>jacoco-maven-plugin</artifactId>
+        <version> ${version.jacoco.maven.plugin} </version>

Review Comment:
   ```suggestion
   ```
   
   Plugins should be declared under <pluginManagement> in `maven-base`.



##########
packages/kogito-db-migrator-tool/pom.xml:
##########
@@ -0,0 +1,165 @@
+<?xml version="1.0" ?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+-->
+<project
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
+  xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+>
+  <parent>
+    <groupId>org.kie</groupId>
+    <artifactId>kie-tools-maven-base</artifactId>
+    <version>${revision}</version>
+    <relativePath>./node_modules/@kie-tools/maven-base/pom.xml</relativePath>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.kie.kogito</groupId>
+  <artifactId>sonataflow-db-migrator</artifactId>
+
+  <dependencies>
+    <dependency>
+      <groupId>io.quarkus</groupId>
+      <artifactId>quarkus-flyway</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.quarkus</groupId>
+      <artifactId>quarkus-jdbc-postgresql</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.quarkus</groupId>
+      <artifactId>quarkus-arc</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.quarkus</groupId>
+      <artifactId>quarkus-junit5</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-junit-jupiter</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-core</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>com.github.stefanbirkner</groupId>
+      <artifactId>system-rules</artifactId>
+      <version>${version.com.github.stefanbirkner.systemrules}</version>
+      <scope>test</scope>
+    </dependency>

Review Comment:
   This should be in `maven-base` under `<dependencyManagement>`



##########
packages/kogito-db-migrator-tool-image/resources/build-container-image.sh:
##########
@@ -0,0 +1,35 @@
+#!/bin/sh
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+set -x
+set -e
+
+CEKIT_BUILDER=docker
+SOURCE_FILE=/tmp/kogito-db-migrator-tool/sonataflow-db-migrator-0.0.0-runner.jar

Review Comment:
   Not sure why we need to use the `/tmp` directory. Usually, temporary files that are only necessary for during the build go to the `dist-dev` or `dist` folders. We try to stay away from changing the file system outside of the repository folder as much as possible.



##########
packages/kogito-db-migrator-tool/package.json:
##########
@@ -0,0 +1,38 @@
+{
+  "private": true,
+  "name": "@kie-tools/kogito-db-migrator-tool",
+  "version": "0.0.0",
+  "description": "",
+  "license": "Apache-2.0",
+  "homepage": "https://github.com/apache/incubator-kie-tools",
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/apache/incubator-kie-tools.git"
+  },
+  "bugs": {
+    "url": "https://github.com/apache/incubator-kie-tools/issues"
+  },
+  "scripts": {
+    "build:dev": "pnpm pre-build && mvn clean install -DskipTests -Dquarkus.package.type=uber-jar && pnpm drop-jar && pnpm cleanup-ddl-dirs",
+    "build:prod": "pnpm pre-build && mvn clean install -DskipTests=$(build-env tests.run --not) -Dmaven.test.failure.ignore=$(build-env tests.ignoreFailures) -Dquarkus.package.type=uber-jar && pnpm drop-jar && pnpm cleanup-ddl-dirs",
+    "cleanup": "pnpm cleanup-drop-jar && pnpm cleanup-ddl-dirs",
+    "cleanup-ddl-dirs": "rimraf src/main/resources/ansi && rimraf src/main/resources/postgresql",
+    "cleanup-drop-jar": "rimraf /tmp/kogito-db-migrator-tool/ && mkdir -p /tmp/kogito-db-migrator-tool",
+    "drop-jar": "cp target/sonataflow-db-migrator-0.0.0-runner.jar /tmp/kogito-db-migrator-tool",
+    "pre-build": " pnpm cleanup && mvn dependency:unpack"

Review Comment:
   Do we really need to unpack all dependencies?



##########
packages/kogito-db-migrator-tool/package.json:
##########
@@ -0,0 +1,38 @@
+{
+  "private": true,
+  "name": "@kie-tools/kogito-db-migrator-tool",
+  "version": "0.0.0",
+  "description": "",
+  "license": "Apache-2.0",
+  "homepage": "https://github.com/apache/incubator-kie-tools",
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/apache/incubator-kie-tools.git"
+  },
+  "bugs": {
+    "url": "https://github.com/apache/incubator-kie-tools/issues"
+  },
+  "scripts": {
+    "build:dev": "pnpm pre-build && mvn clean install -DskipTests -Dquarkus.package.type=uber-jar && pnpm drop-jar && pnpm cleanup-ddl-dirs",
+    "build:prod": "pnpm pre-build && mvn clean install -DskipTests=$(build-env tests.run --not) -Dmaven.test.failure.ignore=$(build-env tests.ignoreFailures) -Dquarkus.package.type=uber-jar && pnpm drop-jar && pnpm cleanup-ddl-dirs",
+    "cleanup": "pnpm cleanup-drop-jar && pnpm cleanup-ddl-dirs",
+    "cleanup-ddl-dirs": "rimraf src/main/resources/ansi && rimraf src/main/resources/postgresql",
+    "cleanup-drop-jar": "rimraf /tmp/kogito-db-migrator-tool/ && mkdir -p /tmp/kogito-db-migrator-tool",
+    "drop-jar": "cp target/sonataflow-db-migrator-0.0.0-runner.jar /tmp/kogito-db-migrator-tool",

Review Comment:
   Same comment about `/tmp` dir.



##########
packages/kogito-db-migrator-tool/README.md:
##########
@@ -0,0 +1,39 @@
+# Kogito Postgres DB Migrator Tool
+
+This is a java quarkus based postgres database migrator application for SonataFlow Data Index and Jobs Service applications for use by SonataFlow Operator.
+
+_NOTE_: This postgres database migrator application and its corresponding images are only envisaged to be made use of by SonataFlow Operator, Data Index and Jobs Service internally. Conversely this application is of no use outside the usecases involved with SonataFlow Operator, Data Index and Jobs Service.
+
+## Build jar file
+
+You can build the jar file with the script `build-db-migrator-jar.sh` which places the jar into /tmp/ kogito-db-migrator-tool directory for use by the corresponding image builder in package kogito-db-migrator-tool-image later, which can be found [here](../kogito-db-migrator-tool-image/README.md).
+
+```shell
+pnpm -F kogito-db-migrator-tool... build:dev
+```

Review Comment:
   Outdated and redudant. All packages on `kie-tools` are build with `pnpm [pnpm-filter?] build:{dev,prod}`. No need to list it here. Let's keep README files targeting consumption/usage. If there are any special remarks to be made about development/architecture of a package, let's put it in separate files.



##########
packages/kogito-db-migrator-tool/package.json:
##########
@@ -0,0 +1,38 @@
+{
+  "private": true,
+  "name": "@kie-tools/kogito-db-migrator-tool",
+  "version": "0.0.0",
+  "description": "",
+  "license": "Apache-2.0",
+  "homepage": "https://github.com/apache/incubator-kie-tools",
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/apache/incubator-kie-tools.git"
+  },
+  "bugs": {
+    "url": "https://github.com/apache/incubator-kie-tools/issues"
+  },
+  "scripts": {
+    "build:dev": "pnpm pre-build && mvn clean install -DskipTests -Dquarkus.package.type=uber-jar && pnpm drop-jar && pnpm cleanup-ddl-dirs",
+    "build:prod": "pnpm pre-build && mvn clean install -DskipTests=$(build-env tests.run --not) -Dmaven.test.failure.ignore=$(build-env tests.ignoreFailures) -Dquarkus.package.type=uber-jar && pnpm drop-jar && pnpm cleanup-ddl-dirs",
+    "cleanup": "pnpm cleanup-drop-jar && pnpm cleanup-ddl-dirs",
+    "cleanup-ddl-dirs": "rimraf src/main/resources/ansi && rimraf src/main/resources/postgresql",
+    "cleanup-drop-jar": "rimraf /tmp/kogito-db-migrator-tool/ && mkdir -p /tmp/kogito-db-migrator-tool",

Review Comment:
   src/main/resources is not ignored by Git. We shouldn't be making changes to it during the build. If there are versioned files to be changed, it has to be done on during `pnpm bootstrap`, (I.e., during the `install` script on packages). Please see [MANUAL.md](https://github.com/apache/incubator-kie-tools/blob/main/repo/MANUAL.md)
   
   >9. Generated code is either ignored or versioned on Git.
   If files are produced either during bootstrap, they must be either ignored by Git, or committed. Running pnpm bootstrap on a clean clone must never change any versioned file. If files are generated during build, they should not be versioned in Git.



##########
packages/kogito-db-migrator-tool/pom.xml:
##########
@@ -0,0 +1,165 @@
+<?xml version="1.0" ?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+-->
+<project
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
+  xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+>
+  <parent>
+    <groupId>org.kie</groupId>
+    <artifactId>kie-tools-maven-base</artifactId>
+    <version>${revision}</version>
+    <relativePath>./node_modules/@kie-tools/maven-base/pom.xml</relativePath>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.kie.kogito</groupId>
+  <artifactId>sonataflow-db-migrator</artifactId>
+
+  <dependencies>
+    <dependency>
+      <groupId>io.quarkus</groupId>
+      <artifactId>quarkus-flyway</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.quarkus</groupId>
+      <artifactId>quarkus-jdbc-postgresql</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.quarkus</groupId>
+      <artifactId>quarkus-arc</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.quarkus</groupId>
+      <artifactId>quarkus-junit5</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-junit-jupiter</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-core</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>com.github.stefanbirkner</groupId>
+      <artifactId>system-rules</artifactId>
+      <version>${version.com.github.stefanbirkner.systemrules}</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <testSourceDirectory>src/test/java</testSourceDirectory>
+    <plugins>
+      <!-- Use mvn dependency:unpack command to unzip ddl files and mvn dependency:copy to copy into destination -->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <version>3.8.1</version>
+        <configuration>
+          <artifactItems>
+            <artifactItem>
+              <groupId>org.kie.kogito</groupId>
+              <artifactId>kogito-ddl</artifactId>
+              <version>${version.org.kie.kogito}</version>
+              <classifier>db-scripts</classifier>
+              <type>zip</type>
+              <overWrite>true</overWrite>
+              <outputDirectory>src/main/resources</outputDirectory>
+              <destFileName>kogito-ddl-db-scripts.zip</destFileName>
+            </artifactItem>
+          </artifactItems>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>io.quarkus</groupId>
+        <artifactId>quarkus-maven-plugin</artifactId>
+        <extensions>true</extensions>
+        <executions>
+          <execution>
+            <goals>
+              <goal>build</goal>
+              <goal>generate-code</goal>
+              <goal>generate-code-tests</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <compilerArgs>
+            <arg>-parameters</arg>
+          </compilerArgs>
+        </configuration>
+      </plugin>
+      <plugin>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <version>${version.maven.surefire.plugin}</version>
+        <configuration>
+          <systemPropertyVariables>
+            <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
+            <maven.home>${maven.home}</maven.home>
+          </systemPropertyVariables>
+        </configuration>
+      </plugin>
+      <plugin>
+        <artifactId>maven-failsafe-plugin</artifactId>
+        <version>${version.maven.surefire.plugin}</version>

Review Comment:
   ```suggestion
   ```



##########
packages/kogito-db-migrator-tool/package.json:
##########
@@ -0,0 +1,38 @@
+{
+  "private": true,
+  "name": "@kie-tools/kogito-db-migrator-tool",
+  "version": "0.0.0",
+  "description": "",
+  "license": "Apache-2.0",
+  "homepage": "https://github.com/apache/incubator-kie-tools",
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/apache/incubator-kie-tools.git"
+  },
+  "bugs": {
+    "url": "https://github.com/apache/incubator-kie-tools/issues"
+  },
+  "scripts": {
+    "build:dev": "pnpm pre-build && mvn clean install -DskipTests -Dquarkus.package.type=uber-jar && pnpm drop-jar && pnpm cleanup-ddl-dirs",
+    "build:prod": "pnpm pre-build && mvn clean install -DskipTests=$(build-env tests.run --not) -Dmaven.test.failure.ignore=$(build-env tests.ignoreFailures) -Dquarkus.package.type=uber-jar && pnpm drop-jar && pnpm cleanup-ddl-dirs",
+    "cleanup": "pnpm cleanup-drop-jar && pnpm cleanup-ddl-dirs",
+    "cleanup-ddl-dirs": "rimraf src/main/resources/ansi && rimraf src/main/resources/postgresql",
+    "cleanup-drop-jar": "rimraf /tmp/kogito-db-migrator-tool/ && mkdir -p /tmp/kogito-db-migrator-tool",
+    "drop-jar": "cp target/sonataflow-db-migrator-0.0.0-runner.jar /tmp/kogito-db-migrator-tool",
+    "pre-build": " pnpm cleanup && mvn dependency:unpack"
+  },
+  "dependencies": {
+    "@kie-tools/maven-base": "workspace:*",
+    "rimraf": "^3.0.2"

Review Comment:
   Move to `devDependencies`



##########
packages/kogito-db-migrator-tool/pom.xml:
##########
@@ -0,0 +1,165 @@
+<?xml version="1.0" ?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+-->
+<project
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
+  xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+>
+  <parent>
+    <groupId>org.kie</groupId>
+    <artifactId>kie-tools-maven-base</artifactId>
+    <version>${revision}</version>
+    <relativePath>./node_modules/@kie-tools/maven-base/pom.xml</relativePath>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.kie.kogito</groupId>
+  <artifactId>sonataflow-db-migrator</artifactId>
+
+  <dependencies>
+    <dependency>
+      <groupId>io.quarkus</groupId>
+      <artifactId>quarkus-flyway</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.quarkus</groupId>
+      <artifactId>quarkus-jdbc-postgresql</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.quarkus</groupId>
+      <artifactId>quarkus-arc</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.quarkus</groupId>
+      <artifactId>quarkus-junit5</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-junit-jupiter</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-core</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>com.github.stefanbirkner</groupId>
+      <artifactId>system-rules</artifactId>
+      <version>${version.com.github.stefanbirkner.systemrules}</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <testSourceDirectory>src/test/java</testSourceDirectory>
+    <plugins>
+      <!-- Use mvn dependency:unpack command to unzip ddl files and mvn dependency:copy to copy into destination -->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <version>3.8.1</version>
+        <configuration>
+          <artifactItems>
+            <artifactItem>
+              <groupId>org.kie.kogito</groupId>
+              <artifactId>kogito-ddl</artifactId>
+              <version>${version.org.kie.kogito}</version>
+              <classifier>db-scripts</classifier>
+              <type>zip</type>
+              <overWrite>true</overWrite>
+              <outputDirectory>src/main/resources</outputDirectory>
+              <destFileName>kogito-ddl-db-scripts.zip</destFileName>
+            </artifactItem>
+          </artifactItems>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>io.quarkus</groupId>
+        <artifactId>quarkus-maven-plugin</artifactId>
+        <extensions>true</extensions>
+        <executions>
+          <execution>
+            <goals>
+              <goal>build</goal>
+              <goal>generate-code</goal>
+              <goal>generate-code-tests</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <compilerArgs>
+            <arg>-parameters</arg>
+          </compilerArgs>
+        </configuration>
+      </plugin>
+      <plugin>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <version>${version.maven.surefire.plugin}</version>
+        <configuration>
+          <systemPropertyVariables>
+            <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
+            <maven.home>${maven.home}</maven.home>
+          </systemPropertyVariables>
+        </configuration>
+      </plugin>
+      <plugin>
+        <artifactId>maven-failsafe-plugin</artifactId>
+        <version>${version.maven.surefire.plugin}</version>
+        <executions>
+          <execution>
+            <goals>
+              <goal>integration-test</goal>
+              <goal>verify</goal>

Review Comment:
   Do we really need this configuration here?



##########
packages/kogito-db-migrator-tool/build-db-migrator-jar.sh:
##########


Review Comment:
   Unused.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1821493467


##########
packages/kogito-db-migrator-tool/pom.xml:
##########
@@ -0,0 +1,165 @@
+<?xml version="1.0" ?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+-->
+<project
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
+  xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+>
+  <parent>
+    <groupId>org.kie</groupId>
+    <artifactId>kie-tools-maven-base</artifactId>
+    <version>${revision}</version>
+    <relativePath>./node_modules/@kie-tools/maven-base/pom.xml</relativePath>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.kie.kogito</groupId>
+  <artifactId>sonataflow-db-migrator</artifactId>
+
+  <dependencies>
+    <dependency>
+      <groupId>io.quarkus</groupId>
+      <artifactId>quarkus-flyway</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.quarkus</groupId>
+      <artifactId>quarkus-jdbc-postgresql</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.quarkus</groupId>
+      <artifactId>quarkus-arc</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.quarkus</groupId>
+      <artifactId>quarkus-junit5</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-junit-jupiter</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-core</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>com.github.stefanbirkner</groupId>
+      <artifactId>system-rules</artifactId>
+      <version>${version.com.github.stefanbirkner.systemrules}</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <testSourceDirectory>src/test/java</testSourceDirectory>
+    <plugins>
+      <!-- Use mvn dependency:unpack command to unzip ddl files and mvn dependency:copy to copy into destination -->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <version>3.8.1</version>

Review Comment:
   As conveyed by @tiagobento we just need `artifactId` and has been modified accordingly.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "ricardozanini (via GitHub)" <gi...@apache.org>.
ricardozanini commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1822696656


##########
packages/kogito-db-migrator-tool-image/resources/kogito-db-migrator-tool-image.yaml:
##########
@@ -0,0 +1,49 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+name: "docker.io/apache/kogito-db-migrator-tool"
+version: "main"

Review Comment:
   If he uses the `install.js` I mentioned in another comment, it will :)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1823262730


##########
packages/kogito-db-migrator-tool-image/resources/build-container-image.sh:
##########
@@ -0,0 +1,35 @@
+#!/bin/sh
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+set -x
+set -e
+
+CEKIT_BUILDER=docker
+SOURCE_FILE=/tmp/kogito-db-migrator-tool/sonataflow-db-migrator-0.0.0-runner.jar

Review Comment:
   We are now using `quarkus-run.jar` and no longer using 0.0.0.
   Also we are no longer using /tmp directories.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1817143645


##########
packages/kogito-db-migrator-tool/pom.xml:
##########
@@ -0,0 +1,200 @@
+<?xml version="1.0" ?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+-->
+<project
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
+  xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+>
+  <parent>
+    <groupId>org.kie</groupId>
+    <artifactId>kie-tools-maven-base</artifactId>
+    <version>${revision}</version>
+    <relativePath>./node_modules/@kie-tools/maven-base/pom.xml</relativePath>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.kie.kogito</groupId>
+  <artifactId>sonataflow-db-migrator</artifactId>
+  <properties>
+    <project.build.outputTimestamp>2024-11-01T00:00:00Z</project.build.outputTimestamp>
+    <quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
+    <quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
+    <quarkus.platform.version>3.13.0</quarkus.platform.version>
+    <skipITs>true</skipITs>
+
+    <jacoco.version>0.8.12</jacoco.version>
+    <systemrules.version>1.19.0</systemrules.version>

Review Comment:
   I do not see either `jacoco` or `systemrules` in `maven-base` and will need to be part of this pom file.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "ricardozanini (via GitHub)" <gi...@apache.org>.
ricardozanini commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1817232149


##########
packages/kogito-db-migrator-tool-image/resources/modules/kogito-postgres-db-migration-deps/module.yaml:
##########
@@ -0,0 +1,25 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+schema_version: 1
+name: org.kie.kogito.postgresql.db-migration-deps
+version: "main"
+artifacts:
+  - name: sonataflow-db-migrator-runner.jar
+    path: sonataflow-db-migrator-runner.jar
+    dest: /home/kogito

Review Comment:
   ```suggestion
       dest: /home/kogito/bin
   ```



##########
packages/kogito-db-migrator-tool-image/resources/build-container-image.sh:
##########
@@ -0,0 +1,36 @@
+#!/bin/sh
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+set -x
+set -e
+
+CEKIT_BUILDER=docker
+SOURCE_FILE=/tmp/kogito-db-migrator-tool/sonataflow-db-migrator-0.0.0-runner.jar
+TARGET_FILE=./resources/modules/kogito-postgres-db-migration-deps/sonataflow-db-migrator-runner.jar
+CEKIT_DESCRIPTOR_FILE=build/kogito-db-migrator-tool-image.yaml
+
+echo "The file: $SOURCE_FILE found and will be used to build image."

Review Comment:
   But you are not doing a conditional check here. 🤔 



##########
packages/kogito-db-migrator-tool/pom.xml:
##########
@@ -0,0 +1,200 @@
+<?xml version="1.0" ?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+-->
+<project
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
+  xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+>
+  <parent>
+    <groupId>org.kie</groupId>
+    <artifactId>kie-tools-maven-base</artifactId>
+    <version>${revision}</version>
+    <relativePath>./node_modules/@kie-tools/maven-base/pom.xml</relativePath>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.kie.kogito</groupId>
+  <artifactId>sonataflow-db-migrator</artifactId>
+  <properties>
+    <project.build.outputTimestamp>2024-11-01T00:00:00Z</project.build.outputTimestamp>
+    <quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
+    <quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
+    <quarkus.platform.version>3.13.0</quarkus.platform.version>

Review Comment:
   No, here you're forcing the Quarkus version. Don't need to add that since the `maven-base` already configures Quarkus for us. Just declare your quarkus dependencies in this pom.xml.



##########
packages/kogito-db-migrator-tool/pom.xml:
##########
@@ -0,0 +1,200 @@
+<?xml version="1.0" ?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+-->
+<project
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
+  xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+>
+  <parent>
+    <groupId>org.kie</groupId>
+    <artifactId>kie-tools-maven-base</artifactId>
+    <version>${revision}</version>
+    <relativePath>./node_modules/@kie-tools/maven-base/pom.xml</relativePath>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.kie.kogito</groupId>
+  <artifactId>sonataflow-db-migrator</artifactId>
+  <properties>
+    <project.build.outputTimestamp>2024-11-01T00:00:00Z</project.build.outputTimestamp>
+    <quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
+    <quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
+    <quarkus.platform.version>3.13.0</quarkus.platform.version>
+    <skipITs>true</skipITs>
+
+    <jacoco.version>0.8.12</jacoco.version>
+    <systemrules.version>1.19.0</systemrules.version>

Review Comment:
   @rhkp I think what @tiagobento means is that we can add as part of this PR, these versions there so we will have one point of upgrade when maintaining this repo.



##########
packages/kogito-db-migrator-tool/pom.xml:
##########
@@ -0,0 +1,199 @@
+<?xml version="1.0" ?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+-->
+<project
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
+  xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+>
+  <parent>
+    <groupId>org.kie</groupId>
+    <artifactId>kie-tools-maven-base</artifactId>
+    <version>${revision}</version>
+    <relativePath>./node_modules/@kie-tools/maven-base/pom.xml</relativePath>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.kie.kogito</groupId>
+  <artifactId>sonataflow-db-migrator</artifactId>
+  <properties>
+    <quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
+    <quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
+    <quarkus.platform.version>3.13.0</quarkus.platform.version>
+    <skipITs>true</skipITs>
+
+    <jacoco.version>0.8.12</jacoco.version>
+    <systemrules.version>1.19.0</systemrules.version>
+  </properties>
+
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>${quarkus.platform.group-id}</groupId>
+        <artifactId>${quarkus.platform.artifact-id}</artifactId>
+        <version>${quarkus.platform.version}</version>
+        <type>pom</type>
+        <scope>import</scope>

Review Comment:
   No need to declare this. We already have it in `maven-base`.



##########
packages/kogito-db-migrator-tool-image/resources/kogito-db-migrator-tool-image.yaml:
##########
@@ -0,0 +1,49 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+name: "docker.io/apache/kogito-db-migrator-tool"
+version: "main"
+from: registry.access.redhat.com/ubi8/openjdk-17-runtime:1.20
+description: Flyway image for DI/JS database migration
+
+labels:
+  - name: "org.kie.kogito.version"
+    value: "### SET ME DURING BUILD PROCESS ###"
+  - name: "maintainer"
+    value: "Apache KIE <de...@kie.apache.org>"
+  - name: "io.k8s.description"
+    value: "Kogito DB Migration creates schemas and tables for Data Index and Jobs Service for PostgreSQL database"
+  - name: "io.k8s.display-name"
+    value: "Kogito DB Migration for Data Index and Jobs Service - PostgreSQL"
+  - name: "io.openshift.tags"
+    value: "kogito,db-migration"
+
+modules:
+  repositories:
+    - path: modules
+  install:
+    - name: org.kie.kogito.system.user
+    - name: org.kie.kogito.postgresql.db-migration-deps
+
+run:
+  workdir: "/home/kogito"

Review Comment:
   ```suggestion
     workdir: "/home/kogito/bin"
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1813412548


##########
packages/kogito-db-migrator-tool/env/index.js:
##########
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+const { varsWithName, composeEnv } = require("@kie-tools-scripts/build-env");
+
+module.exports = composeEnv([require("@kie-tools/root-env/env")], {
+  vars: varsWithName({}),
+  get env() {
+    return {
+      devDeploymentQuarkusApp: {
+        version: require("../package.json").version,
+      },

Review Comment:
   @tiagobento Not sure what is the question here. This file comes from `dev-deployment-kogito-quarkus-blank-app` . 
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "ricardozanini (via GitHub)" <gi...@apache.org>.
ricardozanini commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1815043384


##########
packages/kogito-db-migrator-tool-image/cekit/image.yaml:
##########
@@ -0,0 +1,45 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+name: "docker.io/apache/incubator-kie-kogito-service-db-migration-postgresql"
+version: "999-SNAPSHOT"

Review Comment:
   Not resolved



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1890696709


##########
packages/maven-base/pom.xml:
##########
@@ -263,6 +265,12 @@
         <version>${version.org.mockito}</version>
         <scope>test</scope>
       </dependency>
+      <dependency>
+        <groupId>com.github.stefanbirkner</groupId>

Review Comment:
   I think the license for com.github.stefanbirkner does not look compatible, so I have removed this lib and test lines making use of it.  



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1893221918


##########
packages/kogito-db-migrator-tool-image/README.md:
##########
@@ -0,0 +1,116 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+     http://www.apache.org/licenses/LICENSE-2.0
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+-->
+
+# Kogito Postgres DB Migrator Tool Image
+
+This package contains the `Containerfile/Dockerfile` and scripts to build a container image for Kogito Postgres DB Migrator Tool. Details about the Kogito Postgres DB Migrator Tool can be found [here](../kogito-db-migrator-tool/README.md).
+
+## Additional requirements
+
+- docker
+
+## Build
+
+_NOTE_: Before performing this step, be sure that the Kogito Postgres DB Migrator Tool jar has been built and available for inclusion in the image.
+
+- Enable the image to be built:
+
+  ```bash
+  export KIE_TOOLS_BUILD__buildContainerImages=true
+  ```
+
+Run the following in the root folder of the repository to build the package:
+
+```bash
+pnpm -F @kie-tools/kogito-db-migrator-tool-image... build:prod
+```
+
+- Then check if the image is correctly stored:
+
+  ```bash
+  docker images
+  ```
+
+## Run
+
+- Start up a clean container with:
+
+  ```bash
+    docker run docker.io/apache/incubator-kie-kogito-service-db-migration-postgresql:latest

Review Comment:
   Hi @wmedvede and @ricardozanini,
   I spent more time on this one. 
   
   **EXECUTE DB MIGRATOR JAVA JAR IN TERMINAL(WITHOUT IMAGE I MEAN)**
   - The execution of the DB migrator with `java -jar target/quarkus-app/quarkus-run.jar` gives identical results whether the export QUARKUS_PLATFORM_VERSION=3.8.6 variable is set or not.
   - Meaning in any of the situation above I am not seeing 999-SNAPSHOTS log.
   - Please note the WARN message for 999-SNAPSHOT comes from `[io.qua.run.con.ConfigRecorder]` package, when we are using image and I do not at all see this package in the logs in these scenarios.
   
   **COMPARE DB MIGRATOR IMAGE build FOLDERS**
   - I compared TWO directories one built with env vars set and another without setting one.
   - The files are identical in this case too.
   - And not sure where the 999-SNAPSHOT appears from.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1811349963


##########
packages/kogito-db-migrator-tool/src/main/cekit/image.yaml:
##########
@@ -0,0 +1,45 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+name: "docker.io/apache/incubator-kie-kogito-service-db-migration-postgresql"
+version: "999-SNAPSHOT"

Review Comment:
   Not applicable as the cekit build is not relevant in this package and is now removed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "ricardozanini (via GitHub)" <gi...@apache.org>.
ricardozanini commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1811280731


##########
packages/kogito-db-migrator-tool-image/cekit/image.yaml:
##########
@@ -0,0 +1,45 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+name: "docker.io/apache/incubator-kie-kogito-service-db-migration-postgresql"
+version: "999-SNAPSHOT"
+from: registry.access.redhat.com/ubi8/openjdk-17-runtime:1.19
+description: Flyway image for DI/JS database migration
+
+labels:
+  - name: "org.kie.kogito.version"
+    value: "999-SNAPSHOT"

Review Comment:
   ```suggestion
       value: "### SET ME DURING BUILD PROCESS ###"
   ```



##########
packages/kogito-db-migrator-tool-image/package.json:
##########
@@ -0,0 +1,26 @@
+{
+  "private": true,
+  "name": "@kie-tools/kogito-db-migrator-tool-image",
+  "version": "0.0.0",
+  "description": "",
+  "license": "Apache-2.0",
+  "homepage": "https://github.com/apache/incubator-kie-tools",
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/apache/incubator-kie-tools.git"
+  },
+  "bugs": {
+    "url": "https://github.com/apache/incubator-kie-tools/issues"
+  },
+  "scripts": {
+    "build": "./build-container-image.sh",
+    "build:dev": "pnpm build",
+    "build:prod": "pnpm build",

Review Comment:
   This commands must reflect the image build: https://github.com/apache/incubator-kie-tools/blob/main/packages/kogito-data-index-ephemeral-image/package.json#L16-L33



##########
packages/kogito-db-migrator-tool/install.js:
##########
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+const { env } = require("./env");
+const { setupMavenConfigFile, installMvnw, buildTailFromPackageJsonDependencies } = require("@kie-tools/maven-base");
+
+setupMavenConfigFile(
+  `
+    --batch-mode
+    -Dstyle.color=always
+    -Drevision=${env.devDeploymentQuarkusApp.version}
+    -Dversion.quarkus=${env.versions.quarkus}
+    -Dversion.org.kie.kogito=${env.versions.kogito}

Review Comment:
   Here too, I don't see these set in the `env/index.js`.



##########
packages/kogito-db-migrator-tool-image/README.md:
##########
@@ -0,0 +1,47 @@
+# kogito-db-migrator-tool-image
+
+This is a cekit based image builder for the database migrator application. Details about the database migrator application are [here](../kogito-db-migrator-tool/README.md)
+
+## Build and Run container image locally
+
+You can build the cekit build of container image by using the provided image builder shell script
+
+```shell
+./build-container-image.sh

Review Comment:
   Instead of shell, we can provide the pnpm command `pnpm build:dev`.



##########
packages/kogito-db-migrator-tool/src/main/cekit/image.yaml:
##########
@@ -0,0 +1,45 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+name: "docker.io/apache/incubator-kie-kogito-service-db-migration-postgresql"
+version: "999-SNAPSHOT"

Review Comment:
   ```suggestion
   version: "0.0.0"
   ```



##########
packages/kogito-db-migrator-tool/pom.xml:
##########
@@ -0,0 +1,213 @@
+<?xml version="1.0" ?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+-->
+<project
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
+  xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+>
+  <parent>
+    <groupId>org.kie</groupId>
+    <artifactId>kie-tools-maven-base</artifactId>
+    <version>${revision}</version>
+    <relativePath>./node_modules/@kie-tools/maven-base/pom.xml</relativePath>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.kie.kogito</groupId>
+  <artifactId>sonataflow-db-migrator</artifactId>
+  <properties>
+    <project.build.outputTimestamp>2024-11-01T00:00:00Z</project.build.outputTimestamp>
+    <compiler-plugin.version>3.13.0</compiler-plugin.version>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+    <quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
+    <quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
+    <quarkus.platform.version>3.13.0</quarkus.platform.version>
+    <skipITs>true</skipITs>
+    <surefire-plugin.version>3.2.5</surefire-plugin.version>
+    <jacoco.version>0.8.12</jacoco.version>
+    <systemrules.version>1.19.0</systemrules.version>

Review Comment:
   These come from the maven-base pom.



##########
packages/kogito-db-migrator-tool-image/cekit/modules/kogito-postgres-db-migration-deps/migration.sh:
##########
@@ -0,0 +1,36 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+set -x
+set -e
+
+OPERATOR_VERSION=999.0.0
+
+for arg in "$@"; do
+   case "$arg" in
+      OPERATOR_VERSION=*) OPERATOR_VERSION="${arg#*=}" ;;
+   esac
+done
+
+cd /home/kogito/
+
+mv sonataflow-db-migrator-runner.jar sonataflow-db-migrator-"$OPERATOR_VERSION"-runner.jar
+
+java -jar sonataflow-db-migrator-"$OPERATOR_VERSION"-runner.jar

Review Comment:
   I don't think we need this file. Can't we just have this command as the image's entrypoint?



##########
packages/kogito-db-migrator-tool-image/cekit/modules/kogito-postgres-db-migration-deps/install:
##########
@@ -0,0 +1,32 @@
+#!/bin/sh
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+set -x
+set -e
+
+useradd -m kogito

Review Comment:
   Please use this instead: https://github.com/apache/incubator-kie-tools/blob/main/packages/sonataflow-management-console-image/resources/incubator-kie-sonataflow-management-console-image.yaml#L44



##########
packages/kogito-db-migrator-tool/install.js:
##########
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+const { env } = require("./env");
+const { setupMavenConfigFile, installMvnw, buildTailFromPackageJsonDependencies } = require("@kie-tools/maven-base");
+
+setupMavenConfigFile(
+  `
+    --batch-mode
+    -Dstyle.color=always
+    -Drevision=${env.devDeploymentQuarkusApp.version}

Review Comment:
   I think we must have this env in this package.



##########
packages/kogito-db-migrator-tool-image/install.js:
##########
@@ -0,0 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+console.log("install.js");

Review Comment:
   Let's do as is:
   https://github.com/apache/incubator-kie-tools/blob/main/packages/kogito-data-index-ephemeral-image/install.js



##########
packages/kogito-db-migrator-tool-image/README.md:
##########
@@ -0,0 +1,47 @@
+# kogito-db-migrator-tool-image

Review Comment:
   See this readme to use as inspiration: https://github.com/apache/incubator-kie-tools/tree/main/packages/sonataflow-management-console-image



##########
packages/kogito-db-migrator-tool-image/cekit/image.yaml:
##########
@@ -0,0 +1,45 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+name: "docker.io/apache/incubator-kie-kogito-service-db-migration-postgresql"
+version: "999-SNAPSHOT"

Review Comment:
   ```suggestion
   version: "0.0.0"
   ```



##########
packages/kogito-db-migrator-tool-image/env/index.js:
##########
@@ -0,0 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+console.log("index.js");

Review Comment:
   This file is unncessary if we are not doing anything. But I think you can use this: https://github.com/apache/incubator-kie-tools/blob/main/packages/kogito-data-index-ephemeral-image/env/index.js



##########
.gitignore:
##########
@@ -346,3 +346,6 @@ turbo.json
 # IntelliJ projects should be on _intellij-projects folder, never on specific packages.
 packages/*/.idea
 examples/*/.idea
+
+# Jar files
+**/*.jar

Review Comment:
   Why do we need this?



##########
packages/kogito-db-migrator-tool-image/build-container-image.sh:
##########
@@ -0,0 +1,40 @@
+#!/bin/sh
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+set -x
+set -e
+
+CEKIT_BUILDER=docker
+SOURCE_FILE=/tmp/kogito-db-migrator-tool/sonataflow-db-migrator-0.0.0-runner.jar
+TARGET_FILE=./cekit/modules/kogito-postgres-db-migration-deps/sonataflow-db-migrator-runner.jar
+
+if [ -f "$SOURCE_FILE" ]; then
+   echo "The file: $SOURCE_FILE found and will be used to build image."
+   rm -f $TARGET_FILE
+   cp $SOURCE_FILE $TARGET_FILE
+
+   # Build the container image
+   cd ./cekit || exit
+   cekit -v build "$CEKIT_BUILDER"
+   rm -f $TARGET_FILE
+else
+   echo "The file: $SOURCE_FILE not found. Please build kogito-db-migrator-tool package first before building the image."
+   exit 1
+fi

Review Comment:
   I think we should have the `package.js` reflect what we are doing here.



##########
packages/kogito-db-migrator-tool/README.md:
##########
@@ -0,0 +1,25 @@
+# kogito-db-migrator
+
+This is a java quarkus based postgres database migrator application for Sonataflow Data Index and Jobs Service applications for use by SonataFlow Operator.

Review Comment:
   ```suggestion
   This is a java quarkus based postgres database migrator application for SonataFlow Data Index and Jobs Service applications for use by SonataFlow Operator.
   ```



##########
packages/kogito-db-migrator-tool-image/cekit/modules/kogito-postgres-db-migration-deps/migration.sh:
##########
@@ -0,0 +1,36 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+set -x
+set -e
+
+OPERATOR_VERSION=999.0.0
+
+for arg in "$@"; do
+   case "$arg" in
+      OPERATOR_VERSION=*) OPERATOR_VERSION="${arg#*=}" ;;
+   esac
+done
+
+cd /home/kogito/
+
+mv sonataflow-db-migrator-runner.jar sonataflow-db-migrator-"$OPERATOR_VERSION"-runner.jar

Review Comment:
   We don't need to rename the jar file. Within the image, we will have the `KOGITO_VERSION` variable set.



##########
packages/kogito-db-migrator-tool/src/main/cekit/image.yaml:
##########
@@ -0,0 +1,45 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+name: "docker.io/apache/incubator-kie-kogito-service-db-migration-postgresql"
+version: "999-SNAPSHOT"
+from: registry.access.redhat.com/ubi8/openjdk-17-runtime:1.19

Review Comment:
   ```suggestion
   from: registry.access.redhat.com/ubi8/openjdk-17-runtime:1.20
   ```



##########
packages/kogito-db-migrator-tool/get-kogito-ddl-scripts.sh:
##########
@@ -0,0 +1,64 @@
+#!/bin/sh
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+set -x
+set -e
+
+# Script variables with default values. These values will be updated by hack/bump-version.sh, don't change it.
+DDL_VERSION=10.0.999-SNAPSHOT
+DDL_FILE=kogito-ddl-10.0.999-20241018.012042-73-db-scripts.zip
+DDL_BASE_URL=https://repository.apache.org/content/groups/snapshots/org/kie/kogito/kogito-ddl

Review Comment:
   These data can come from the `env/index.js`. 
   
   We have a few root parameters that we can also use here, see: https://github.com/apache/incubator-kie-tools/blob/main/packages/root-env/env/index.js#L67-L75



##########
packages/kogito-db-migrator-tool/src/main/cekit/image.yaml:
##########
@@ -0,0 +1,45 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+name: "docker.io/apache/incubator-kie-kogito-service-db-migration-postgresql"
+version: "999-SNAPSHOT"
+from: registry.access.redhat.com/ubi8/openjdk-17-runtime:1.19
+description: Flyway image for DI/JS database migration
+
+labels:
+  - name: "org.kie.kogito.version"
+    value: "999-SNAPSHOT"

Review Comment:
   ```suggestion
       value: "### SET ME DURING BUILD PROCESS ###"
   ```



##########
packages/kogito-db-migrator-tool/src/main/cekit/modules/kogito-postgres-db-migration-deps/migration.sh:
##########
@@ -0,0 +1,36 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+set -x
+set -e
+
+OPERATOR_VERSION=999.0.0
+
+for arg in "$@"; do
+   case "$arg" in
+      OPERATOR_VERSION=*) OPERATOR_VERSION="${arg#*=}" ;;
+   esac
+done
+
+cd /home/kogito/
+
+mv sonataflow-db-migrator-runner.jar sonataflow-db-migrator-"$OPERATOR_VERSION"-runner.jar

Review Comment:
   I think these files are repeated here?



##########
packages/kogito-db-migrator-tool/src/main/cekit/modules/kogito-postgres-db-migration-deps/install:
##########
@@ -0,0 +1,32 @@
+#!/bin/sh
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+set -x
+set -e
+
+useradd -m kogito

Review Comment:
   We already have a module doing this: https://github.com/apache/incubator-kie-tools/blob/main/packages/sonataflow-management-console-image/resources/incubator-kie-sonataflow-management-console-image.yaml#L44



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#issuecomment-2438741392

   > We are almost there!
   > 
   > By the way, have you successfully built this image locally using this package?
   
   Yes. All `build:prod` and `docker run` are successful, locally, as in screenshots.
   
   ![image](https://github.com/user-attachments/assets/a7b3fd22-e859-4a6a-91d6-982ee4b56d31)
   ![image](https://github.com/user-attachments/assets/3cde3760-f01c-4df4-a7b0-73b0d9ebb57d)
   ![image](https://github.com/user-attachments/assets/1c5814d3-a92e-46a2-948c-f4d0f7e77aff)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1889319714


##########
packages/kogito-db-migrator-tool-image/README.md:
##########
@@ -0,0 +1,116 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+     http://www.apache.org/licenses/LICENSE-2.0
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+-->
+
+# Kogito Postgres DB Migrator Tool Image
+
+This package contains the `Containerfile/Dockerfile` and scripts to build a container image for Kogito Postgres DB Migrator Tool. Details about the Kogito Postgres DB Migrator Tool can be found [here](../kogito-db-migrator-tool/README.md).
+
+## Additional requirements
+
+- docker
+
+## Build
+
+_NOTE_: Before performing this step, be sure that the Kogito Postgres DB Migrator Tool jar has been built and available for inclusion in the image.
+
+- Enable the image to be built:
+
+  ```bash
+  export KIE_TOOLS_BUILD__buildContainerImages=true
+  ```
+
+Run the following in the root folder of the repository to build the package:
+
+```bash
+pnpm -F @kie-tools/kogito-db-migrator-tool-image... build:prod

Review Comment:
   The null appears when ${revision} variable is not set.
   You can add properties section in pom.xml as follows
   `  <properties>
       <revision>1.2.3</revision>
     </properties>`
   
   Which will have revision above instead of null, as below:
   `packages/kogito-db-migrator-tool build:prod: [INFO] --- install:3.1.3:install (default-install) @ sonataflow-db-migrator ---
   packages/kogito-db-migrator-tool build:prod: [INFO] Installing /home/ubuntu/flpath-1775/incubator-kie-tools/packages/kogito-db-migrator-tool/.flattened-pom.xml to /home/ubuntu/.m2/repository/org/kie/kogito/sonataflow-db-migrator/1.2.3/sonataflow-db-migrator-1.2.3.pom
   packages/kogito-db-migrator-tool build:prod: [INFO] Installing /home/ubuntu/flpath-1775/incubator-kie-tools/packages/kogito-db-migrator-tool/target/sonataflow-db-migrator-1.2.3.jar to /home/ubuntu/.m2/repository/org/kie/kogito/sonataflow-db-migrator/1.2.3/sonataflow-db-migrator-1.2.3.jar
   packages/kogito-db-migrator-tool build:prod: [INFO] Installing /home/ubuntu/flpath-1775/incubator-kie-tools/packages/kogito-db-migrator-tool/target/sonataflow-db-migrator-1.2.3-sources.jar to /home/ubuntu/.m2/repository/org/kie/kogito/sonataflow-db-migrator/1.2.3/sonataflow-db-migrator-1.2.3-sources.jar
   packages/kogito-db-migrator-tool build:prod: [INFO] Installing /home/ubuntu/flpath-1775/incubator-kie-tools/packages/kogito-db-migrator-tool/target/sonataflow-db-migrator-1.2.3-test-sources.jar to /home/ubuntu/.m2/repository/org/kie/kogito/sonataflow-db-migrator/1.2.3/sonataflow-db-migrator-1.2.3-test-sources.jar
   packages/kogito-db-migrator-tool build:prod: [INFO] ------------------------------------------------------------------------
   packages/kogito-db-migrator-tool build:prod: [INFO] BUILD SUCCESS
   `



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1889297033


##########
packages/kogito-db-migrator-tool/src/main/java/org/kie/kogito/postgresql/migrator/DBMigrator.java:
##########
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.kie.kogito.postgresql.migrator;
+
+import io.quarkus.runtime.Quarkus;
+import io.quarkus.runtime.QuarkusApplication;
+import io.quarkus.runtime.annotations.QuarkusMain;
+import jakarta.inject.Inject;
+import io.quarkus.logging.Log;
+
+import java.sql.SQLException;
+
+import org.eclipse.microprofile.config.inject.ConfigProperty;
+
+@QuarkusMain
+public class DBMigrator implements QuarkusApplication {
+
+    @Inject
+    MigrationService service;
+
+    @Inject
+    DBConnectionChecker dbConnectionChecker;
+
+    @ConfigProperty(name = "migrate.db.dataindex")
+    Boolean migrateDataIndex;
+
+    @ConfigProperty(name = "migrate.db.jobsservice")
+    Boolean migrateJobsService;
+
+    @Override
+    public int run(String... args) {
+        if (migrateDataIndex) {
+            try {
+                dbConnectionChecker.checkDataIndexDBConnection();
+            } catch (SQLException e) {
+                Log.error( "Error obtaining data index database connection. Cannot proceed, exiting.");
+                Quarkus.asyncExit(-1);
+                return -1;

Review Comment:
   Yes it refers to Data Index DB connection.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1890523081


##########
packages/kogito-db-migrator-tool-image/README.md:
##########
@@ -0,0 +1,116 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+     http://www.apache.org/licenses/LICENSE-2.0
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+-->
+
+# Kogito Postgres DB Migrator Tool Image
+
+This package contains the `Containerfile/Dockerfile` and scripts to build a container image for Kogito Postgres DB Migrator Tool. Details about the Kogito Postgres DB Migrator Tool can be found [here](../kogito-db-migrator-tool/README.md).
+
+## Additional requirements
+
+- docker
+
+## Build
+
+_NOTE_: Before performing this step, be sure that the Kogito Postgres DB Migrator Tool jar has been built and available for inclusion in the image.
+
+- Enable the image to be built:
+
+  ```bash
+  export KIE_TOOLS_BUILD__buildContainerImages=true
+  ```
+
+Run the following in the root folder of the repository to build the package:
+
+```bash
+pnpm -F @kie-tools/kogito-db-migrator-tool-image... build:prod

Review Comment:
   Great, the example made it easy to achieve the desired behavior. 
   <img width="994" alt="image" src="https://github.com/user-attachments/assets/e91052fa-2268-4d05-b346-3db3eade0995" />
   <img width="1496" alt="image" src="https://github.com/user-attachments/assets/9e520ce2-97b2-4117-b4ba-156d5f644302" />
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1890643197


##########
packages/kogito-db-migrator-tool-image/README.md:
##########
@@ -0,0 +1,116 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+     http://www.apache.org/licenses/LICENSE-2.0
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+-->
+
+# Kogito Postgres DB Migrator Tool Image
+
+This package contains the `Containerfile/Dockerfile` and scripts to build a container image for Kogito Postgres DB Migrator Tool. Details about the Kogito Postgres DB Migrator Tool can be found [here](../kogito-db-migrator-tool/README.md).
+
+## Additional requirements
+
+- docker
+
+## Build
+
+_NOTE_: Before performing this step, be sure that the Kogito Postgres DB Migrator Tool jar has been built and available for inclusion in the image.
+
+- Enable the image to be built:
+
+  ```bash
+  export KIE_TOOLS_BUILD__buildContainerImages=true
+  ```
+
+Run the following in the root folder of the repository to build the package:
+
+```bash
+pnpm -F @kie-tools/kogito-db-migrator-tool-image... build:prod
+```
+
+- Then check if the image is correctly stored:
+
+  ```bash
+  docker images
+  ```
+
+## Run
+
+- Start up a clean container with:
+
+  ```bash
+    docker run docker.io/apache/incubator-kie-kogito-service-db-migration-postgresql:latest

Review Comment:
   This is what I found: 
   when **building the DB Migrator Image**, if the `QUARKUS_PLATFORM_VERSION` env var in terminal is **not set**, the 999-SNAPSHOT version appears. 
   
   However when the `QUARKUS_PLATFORM_VERSION` env var in terminal is set with a value such as `3.8.6` this does not appear.
   
   However not sure where and why the `999-SNAPSHOT` version is being picked up, as the DB migrator tool and/or image do not specifically use these versions.
   
   A quick search of this string in sources shows `999-SNAPSHOT` is not used in the tool e.g.
   <img width="555" alt="image" src="https://github.com/user-attachments/assets/333e1453-ebfb-40a6-a500-03aff7161c31" />
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1893221918


##########
packages/kogito-db-migrator-tool-image/README.md:
##########
@@ -0,0 +1,116 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+     http://www.apache.org/licenses/LICENSE-2.0
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+-->
+
+# Kogito Postgres DB Migrator Tool Image
+
+This package contains the `Containerfile/Dockerfile` and scripts to build a container image for Kogito Postgres DB Migrator Tool. Details about the Kogito Postgres DB Migrator Tool can be found [here](../kogito-db-migrator-tool/README.md).
+
+## Additional requirements
+
+- docker
+
+## Build
+
+_NOTE_: Before performing this step, be sure that the Kogito Postgres DB Migrator Tool jar has been built and available for inclusion in the image.
+
+- Enable the image to be built:
+
+  ```bash
+  export KIE_TOOLS_BUILD__buildContainerImages=true
+  ```
+
+Run the following in the root folder of the repository to build the package:
+
+```bash
+pnpm -F @kie-tools/kogito-db-migrator-tool-image... build:prod
+```
+
+- Then check if the image is correctly stored:
+
+  ```bash
+  docker images
+  ```
+
+## Run
+
+- Start up a clean container with:
+
+  ```bash
+    docker run docker.io/apache/incubator-kie-kogito-service-db-migration-postgresql:latest

Review Comment:
   Hi @wmedvede and @ricardozanini,
   I spent more time on this one. 
   
   **EXECUTE DB MIGRATOR JAVA JAR IN TERMINAL(WITHOUT IMAGE I MEAN)**
   - The execution of the DB migrator with `java -jar target/quarkus-app/quarkus-run.jar` gives identical results whether the export QUARKUS_PLATFORM_VERSION=3.8.6 variable is set or not.
   - Meaning in any of the situation above I am not seeing 999-SNAPSHOTS log.
   - Please note the WARN message for 999-SNAPSHOT comes from `[io.qua.run.con.ConfigRecorder]` package, when we are using image and I do not at all see this package in the logs in these scenarios.
   
   **COMPARE DB MIGRATOR IMAGE build FOLDERS**
   - I compared TWO directories one built with env vars set and another without setting one.
   - The files are identical in this case too.
   - And not sure where the 999-SNAPSHOT appears from in the logs.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "tiagobento (via GitHub)" <gi...@apache.org>.
tiagobento commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1823515836


##########
packages/kogito-db-migrator-tool/install.js:
##########
@@ -0,0 +1,18 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */

Review Comment:
   Note that Maven-based packages still need a `install.js` file. Please refer to the manual for instructions. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1823267411


##########
packages/kogito-db-migrator-tool-image/install.js:
##########
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+const { execSync } = require("child_process");
+const fs = require("fs");
+
+const { env } = require("./env");
+const path = require("path");
+const pythonVenvDir = path.dirname(require.resolve("@kie-tools/python-venv/package.json"));
+const sonataflowImageCommonDir = path.dirname(require.resolve("@kie-tools/sonataflow-image-common/package.json"));
+const replaceInFile = require("replace-in-file");
+
+const activateCmd =
+  process.platform === "win32"
+    ? `${pythonVenvDir}\\venv\\Scripts\\Activate.bat`
+    : `. ${pythonVenvDir}/venv/bin/activate`;
+
+execSync(
+  `${activateCmd} && \
+  python3 ${sonataflowImageCommonDir}/resources/scripts/versions_manager.py --bump-to ${env.kogitoDbMigratorToolImage.buildTag} --source-folder ./resources`,
+  { stdio: "inherit" }
+);
+
+// Find and read the -image.yaml file
+const resourcesPath = path.resolve(__dirname, "./resources");
+const files = fs.readdirSync(resourcesPath);
+const imageYamlFiles = files.filter((fileName) => fileName.endsWith("image.yaml"));
+if (imageYamlFiles.length !== 1) {
+  throw new Error("There should only be one image.yaml file on ./resources!");
+}
+const originalYamlPath = path.join(resourcesPath, imageYamlFiles[0]);
+let imageYaml = fs.readFileSync(originalYamlPath, "utf8");
+
+const imageUrl = `${env.kogitoDbMigratorToolImage.registry}/${env.kogitoDbMigratorToolImage.account}/${env.kogitoDbMigratorToolImage.name}`;
+
+// Replace the whole string between quotes ("") with the image name
+imageYaml = imageYaml.replace(/(?<=")(.*incubator-kie-kogito-service-db-migration-postgresql.*)(?=")/gm, imageUrl);

Review Comment:
   Okay I am resolving this one.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "tiagobento (via GitHub)" <gi...@apache.org>.
tiagobento commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1918532662


##########
packages/kogito-postgresql-db-migrator-tool/pom.xml:
##########
@@ -0,0 +1,130 @@
+<?xml version="1.0" ?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+-->
+<project
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
+  xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+>
+  <parent>
+    <groupId>org.kie</groupId>
+    <artifactId>kie-tools-maven-base</artifactId>
+    <version>${revision}</version>
+    <relativePath>./node_modules/@kie-tools/maven-base/pom.xml</relativePath>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.kie.kogito</groupId>
+  <artifactId>kogito-postgresql-db-migrator-tool</artifactId>
+
+  <properties>
+    <version.jacoco.maven.plugin>0.8.12</version.jacoco.maven.plugin>
+  </properties>

Review Comment:
   @rhkp This should be on `maven-base`, as we want to try and follow the "one version rule" as much as we can... so having it there will allow other packages to depend on the same version of the plugin if they want to use it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1918617864


##########
packages/kogito-postgresql-db-migrator-tool/pom.xml:
##########
@@ -0,0 +1,130 @@
+<?xml version="1.0" ?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+-->
+<project
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
+  xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+>
+  <parent>
+    <groupId>org.kie</groupId>
+    <artifactId>kie-tools-maven-base</artifactId>
+    <version>${revision}</version>
+    <relativePath>./node_modules/@kie-tools/maven-base/pom.xml</relativePath>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.kie.kogito</groupId>
+  <artifactId>kogito-postgresql-db-migrator-tool</artifactId>
+
+  <properties>
+    <version.jacoco.maven.plugin>0.8.12</version.jacoco.maven.plugin>
+  </properties>

Review Comment:
   Correct, I agree. Done.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "pkliczewski (via GitHub)" <gi...@apache.org>.
pkliczewski commented on PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#issuecomment-2615924603

   @ricardozanini @wmedvede is there anything else that needs to be done to have this PR merged?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1813289256


##########
packages/kogito-db-migrator-tool-image/cekit/modules/kogito-postgres-db-migration-deps/migration.sh:
##########
@@ -0,0 +1,36 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+set -x
+set -e
+
+OPERATOR_VERSION=999.0.0
+
+for arg in "$@"; do
+   case "$arg" in
+      OPERATOR_VERSION=*) OPERATOR_VERSION="${arg#*=}" ;;
+   esac
+done
+
+cd /home/kogito/
+
+mv sonataflow-db-migrator-runner.jar sonataflow-db-migrator-"$OPERATOR_VERSION"-runner.jar

Review Comment:
   This file has been removed as it is not required as expressed in other comment. We will be using image's entrypoint section.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1815612759


##########
packages/kogito-db-migrator-tool-image/build-container-image.sh:
##########
@@ -0,0 +1,40 @@
+#!/bin/sh
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+set -x
+set -e
+
+CEKIT_BUILDER=docker
+SOURCE_FILE=/tmp/kogito-db-migrator-tool/sonataflow-db-migrator-0.0.0-runner.jar
+TARGET_FILE=./cekit/modules/kogito-postgres-db-migration-deps/sonataflow-db-migrator-runner.jar
+
+if [ -f "$SOURCE_FILE" ]; then
+   echo "The file: $SOURCE_FILE found and will be used to build image."
+   rm -f $TARGET_FILE
+   cp $SOURCE_FILE $TARGET_FILE
+
+   # Build the container image
+   cd ./cekit || exit
+   cekit -v build "$CEKIT_BUILDER"
+   rm -f $TARGET_FILE
+else
+   echo "The file: $SOURCE_FILE not found. Please build kogito-db-migrator-tool package first before building the image."
+   exit 1
+fi

Review Comment:
   We won't need this condition or check as `"@kie-tools/kogito-db-migrator-tool"` is included as a dependency.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rgdoliveira (via GitHub)" <gi...@apache.org>.
rgdoliveira commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1821315101


##########
packages/kogito-db-migrator-tool/pom.xml:
##########
@@ -0,0 +1,165 @@
+<?xml version="1.0" ?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+-->
+<project
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
+  xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+>
+  <parent>
+    <groupId>org.kie</groupId>
+    <artifactId>kie-tools-maven-base</artifactId>
+    <version>${revision}</version>
+    <relativePath>./node_modules/@kie-tools/maven-base/pom.xml</relativePath>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.kie.kogito</groupId>
+  <artifactId>sonataflow-db-migrator</artifactId>
+
+  <dependencies>
+    <dependency>
+      <groupId>io.quarkus</groupId>
+      <artifactId>quarkus-flyway</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.quarkus</groupId>
+      <artifactId>quarkus-jdbc-postgresql</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.quarkus</groupId>
+      <artifactId>quarkus-arc</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.quarkus</groupId>
+      <artifactId>quarkus-junit5</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-junit-jupiter</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-core</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>com.github.stefanbirkner</groupId>
+      <artifactId>system-rules</artifactId>
+      <version>${version.com.github.stefanbirkner.systemrules}</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <testSourceDirectory>src/test/java</testSourceDirectory>
+    <plugins>
+      <!-- Use mvn dependency:unpack command to unzip ddl files and mvn dependency:copy to copy into destination -->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <version>3.8.1</version>
+        <configuration>
+          <artifactItems>
+            <artifactItem>
+              <groupId>org.kie.kogito</groupId>
+              <artifactId>kogito-ddl</artifactId>
+              <version>10.0.999-SNAPSHOT</version>

Review Comment:
   just out of curiosity, shouldn't the version here be {version.org.kie.kogito} which is defined maven-base/pom.xml?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1821352270


##########
packages/kogito-db-migrator-tool/pom.xml:
##########
@@ -0,0 +1,165 @@
+<?xml version="1.0" ?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+-->
+<project
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
+  xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+>
+  <parent>
+    <groupId>org.kie</groupId>
+    <artifactId>kie-tools-maven-base</artifactId>
+    <version>${revision}</version>
+    <relativePath>./node_modules/@kie-tools/maven-base/pom.xml</relativePath>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.kie.kogito</groupId>
+  <artifactId>sonataflow-db-migrator</artifactId>
+
+  <dependencies>
+    <dependency>
+      <groupId>io.quarkus</groupId>
+      <artifactId>quarkus-flyway</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.quarkus</groupId>
+      <artifactId>quarkus-jdbc-postgresql</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.quarkus</groupId>
+      <artifactId>quarkus-arc</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.quarkus</groupId>
+      <artifactId>quarkus-junit5</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-junit-jupiter</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-core</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>com.github.stefanbirkner</groupId>
+      <artifactId>system-rules</artifactId>
+      <version>${version.com.github.stefanbirkner.systemrules}</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <testSourceDirectory>src/test/java</testSourceDirectory>
+    <plugins>
+      <!-- Use mvn dependency:unpack command to unzip ddl files and mvn dependency:copy to copy into destination -->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <version>3.8.1</version>
+        <configuration>
+          <artifactItems>
+            <artifactItem>
+              <groupId>org.kie.kogito</groupId>
+              <artifactId>kogito-ddl</artifactId>
+              <version>10.0.999-SNAPSHOT</version>

Review Comment:
   @ricardozanini All throughout we have made use of SNAPSHOT versions. If we need a change to  {version.org.kie.kogito} please advise and I will change it accordingly.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "tiagobento (via GitHub)" <gi...@apache.org>.
tiagobento commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1820031420


##########
packages/kogito-db-migrator-tool/package.json:
##########
@@ -0,0 +1,33 @@
+{
+  "private": true,
+  "name": "@kie-tools/kogito-db-migrator-tool",
+  "version": "0.0.0",
+  "description": "",
+  "license": "Apache-2.0",
+  "homepage": "https://github.com/apache/incubator-kie-tools",
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/apache/incubator-kie-tools.git"
+  },
+  "bugs": {
+    "url": "https://github.com/apache/incubator-kie-tools/issues"
+  },
+  "scripts": {
+    "build:dev": "pnpm install && ./build-db-migrator-jar.sh true",
+    "build:prod": "pnpm install && ./build-db-migrator-jar.sh false",

Review Comment:
   I guess this is the third time I'm commenting in this file.. Not sure where my comments are going because they're not here anymore 😅 
   
   `pnpm install` is not really a command we should be running as part of the build. Also, please remove the indirection and place commands directly here.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1821157079


##########
packages/kogito-db-migrator-tool/env/index.js:
##########
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+const { varsWithName, composeEnv, getOrDefault } = require("@kie-tools-scripts/build-env");
+
+module.exports = composeEnv([require("@kie-tools/root-env/env")], {
+  vars: varsWithName({
+    KOGITO_DB_MIGRATOR_TOOL__ddl_version: {
+      default: "10.0.999-SNAPSHOT",
+      description: "The version to use for ddl.",
+    },
+    KOGITO_DB_MIGRATOR_TOOL__ddl_file_name: {
+      default: "kogito-ddl-10.0.999-20241018.012042-73-db-scripts.zip",
+      description: "The file name for ddl.",
+    },
+    KOGITO_DB_MIGRATOR_TOOL__ddl_base_url: {
+      default: "https://repository.apache.org/content/groups/snapshots/org/kie/kogito/kogito-ddl",
+      description: "The url from where the ddl file will be downloaded.",
+    },

Review Comment:
   With the use of maven dependency plugin many things have been simplified and some of challenges of handling of these vars is no longer needed. Please check the latest commit: https://github.com/apache/incubator-kie-tools/pull/2697/commits/256a55e0c87de533c7d48b5322d884e25d32c36b



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "ricardozanini (via GitHub)" <gi...@apache.org>.
ricardozanini commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1815041641


##########
packages/kogito-db-migrator-tool/env/index.js:
##########
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+const { varsWithName, composeEnv } = require("@kie-tools-scripts/build-env");
+
+module.exports = composeEnv([require("@kie-tools/root-env/env")], {
+  vars: varsWithName({}),
+  get env() {
+    return {
+      devDeploymentQuarkusApp: {
+        version: require("../package.json").version,
+      },

Review Comment:
   Your variable should be renamed to something that resembles this package, like `kogitoDbMigratorTool`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1817151314


##########
packages/kogito-db-migrator-tool/pom.xml:
##########
@@ -0,0 +1,200 @@
+<?xml version="1.0" ?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+-->
+<project
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
+  xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+>
+  <parent>
+    <groupId>org.kie</groupId>
+    <artifactId>kie-tools-maven-base</artifactId>
+    <version>${revision}</version>
+    <relativePath>./node_modules/@kie-tools/maven-base/pom.xml</relativePath>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.kie.kogito</groupId>
+  <artifactId>sonataflow-db-migrator</artifactId>
+  <properties>
+    <project.build.outputTimestamp>2024-11-01T00:00:00Z</project.build.outputTimestamp>
+    <quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
+    <quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
+    <quarkus.platform.version>3.13.0</quarkus.platform.version>

Review Comment:
   Both the following properties are not present in `maven-base` and I guess we will need them in this `pom` file. I have removed the `timestamp` though based on this comment. 
   
   `
   <quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
   <quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
   `



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "wmedvede (via GitHub)" <gi...@apache.org>.
wmedvede commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1888672232


##########
packages/kogito-db-migrator-tool/src/main/resources/application.properties:
##########
@@ -0,0 +1,40 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+# Data Index data source
+migrate.db.dataindex=false
+quarkus.datasource.dataindex.db-kind=postgresql
+quarkus.datasource.dataindex.username=postgres
+quarkus.datasource.dataindex.password=postgres
+quarkus.datasource.dataindex.jdbc.url=jdbc:postgresql://localhost:5432/postgres
+quarkus.flyway.dataindex.locations=classpath:postgresql/data-index
+quarkus.flyway.dataindex.schemas=dataindex

Review Comment:
   ```suggestion
   quarkus.flyway.dataindex.schemas=data-index-service
   ```



##########
packages/kogito-db-migrator-tool/src/main/resources/application.properties:
##########
@@ -0,0 +1,40 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+# Data Index data source
+migrate.db.dataindex=false
+quarkus.datasource.dataindex.db-kind=postgresql
+quarkus.datasource.dataindex.username=postgres
+quarkus.datasource.dataindex.password=postgres
+quarkus.datasource.dataindex.jdbc.url=jdbc:postgresql://localhost:5432/postgres
+quarkus.flyway.dataindex.locations=classpath:postgresql/data-index
+quarkus.flyway.dataindex.schemas=dataindex
+quarkus.flyway.dataindex.migrate-at-start=false
+quarkus.flyway.dataindex.clean-at-start=false
+
+# Jobs Service data source
+migrate.db.jobsservice=false
+quarkus.datasource.jobsservice.db-kind=postgresql
+quarkus.datasource.jobsservice.username=postgres
+quarkus.datasource.jobsservice.password=postgres
+quarkus.datasource.jobsservice.jdbc.url=jdbc:postgresql://localhost:5432/postgres
+quarkus.flyway.jobsservice.locations=classpath:postgresql/jobs-service
+quarkus.flyway.jobsservice.schemas=jobsservice

Review Comment:
   ```suggestion
   quarkus.flyway.jobsservice.schemas=jobs-service
   ```



##########
packages/kogito-db-migrator-tool/src/test/java/org/kie/kogito/postgresql/migrator/DBConnectionCheckerTest.java:
##########
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2024 Apache Software Foundation (ASF)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.kie.kogito.postgresql.migrator;
+
+import io.quarkus.test.Mock;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.mockito.Mockito;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+
+import static org.junit.jupiter.api.Assertions.*;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.Mockito.mockStatic;
+
+public class DBConnectionCheckerTest {
+    DBConnectionChecker dbConnectionChecker = new DBConnectionChecker();
+
+    @Mock
+    static DriverManager driverManager;
+
+    @BeforeAll
+    public static void init() {

Review Comment:
   package visibilty



##########
packages/kogito-db-migrator-tool/src/test/java/org/kie/kogito/postgresql/migrator/DBConnectionCheckerTest.java:
##########
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2024 Apache Software Foundation (ASF)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.kie.kogito.postgresql.migrator;
+
+import io.quarkus.test.Mock;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.mockito.Mockito;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+
+import static org.junit.jupiter.api.Assertions.*;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.Mockito.mockStatic;
+
+public class DBConnectionCheckerTest {

Review Comment:
   The trend is now to use package visibility for the Test classes and methods



##########
packages/kogito-db-migrator-tool/src/test/java/org/kie/kogito/postgresql/migrator/DBConnectionCheckerTest.java:
##########
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2024 Apache Software Foundation (ASF)

Review Comment:
   License header not good, we don't use year.



##########
packages/kogito-db-migrator-tool/src/test/java/org/kie/kogito/postgresql/migrator/MigrationServiceTest.java:
##########
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2024 Apache Software Foundation (ASF)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.kie.kogito.postgresql.migrator;
+
+import io.quarkus.test.Mock;
+import org.flywaydb.core.Flyway;
+import org.flywaydb.core.api.output.CleanResult;
+import org.flywaydb.core.api.output.MigrateResult;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import static org.mockito.Mockito.*;

Review Comment:
   we should avoid wildcard imports if possible



##########
packages/kogito-db-migrator-tool/src/test/java/org/kie/kogito/postgresql/migrator/MigrationServiceTest.java:
##########
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2024 Apache Software Foundation (ASF)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.kie.kogito.postgresql.migrator;
+
+import io.quarkus.test.Mock;
+import org.flywaydb.core.Flyway;
+import org.flywaydb.core.api.output.CleanResult;
+import org.flywaydb.core.api.output.MigrateResult;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import static org.mockito.Mockito.*;
+
+public class MigrationServiceTest {

Review Comment:
   The trend is now to use package visibility for the Test classes and methods



##########
packages/kogito-db-migrator-tool/src/test/java/org/kie/kogito/postgresql/migrator/DBMigratorTest.java:
##########
@@ -0,0 +1,94 @@
+/*
+ * Copyright 2024 Apache Software Foundation (ASF)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.kie.kogito.postgresql.migrator;
+
+import io.quarkus.test.Mock;
+import org.junit.Rule;
+import org.junit.contrib.java.lang.system.ExpectedSystemExit;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import java.sql.SQLException;
+
+import static org.mockito.Mockito.doThrow;
+import static org.mockito.Mockito.mock;
+
+public class DBMigratorTest {
+    @Rule
+    public final ExpectedSystemExit exitRule = ExpectedSystemExit.none();
+
+    @Mock
+    MigrationService migrationService;
+
+    @Mock
+    DBConnectionChecker dbConnectionChecker;
+
+    DBMigrator dbMigrator = new DBMigrator();
+
+    @BeforeEach
+    public void setupEach() {
+        migrationService = mock(MigrationService.class);
+        dbConnectionChecker = mock(DBConnectionChecker.class);
+    }
+
+    @Test
+    public void testMigratorWithNoMigrations() throws Exception {
+        dbMigrator.migrateDataIndex = false;
+        dbMigrator.migrateJobsService = false;
+
+        exitRule.expectSystemExitWithStatus(0);
+        dbMigrator.run();
+    }
+
+    @Test
+    public void testMigratorWithAllMigrations() throws Exception {
+        dbMigrator.migrateDataIndex = true;
+        dbMigrator.migrateJobsService = true;
+        dbMigrator.dbConnectionChecker = dbConnectionChecker;
+        dbMigrator.service = migrationService;
+
+        exitRule.expectSystemExitWithStatus(0);
+        dbMigrator.run();
+    }
+
+    @Test
+    public void testDataIndexMigrationWithException() throws Exception {
+        dbMigrator.migrateDataIndex = true;
+        dbMigrator.migrateJobsService = false;
+        dbMigrator.dbConnectionChecker = dbConnectionChecker;
+        dbMigrator.service = migrationService;
+
+        doThrow(new SQLException()).when(dbConnectionChecker).checkDataIndexDBConnection();
+
+        exitRule.expectSystemExitWithStatus(-1);
+        dbMigrator.run();

Review Comment:
   same here



##########
packages/kogito-db-migrator-tool/src/main/java/org/kie/kogito/postgresql/migrator/DBMigrator.java:
##########
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.kie.kogito.postgresql.migrator;
+
+import io.quarkus.runtime.Quarkus;
+import io.quarkus.runtime.QuarkusApplication;
+import io.quarkus.runtime.annotations.QuarkusMain;
+import jakarta.inject.Inject;
+import io.quarkus.logging.Log;
+
+import java.sql.SQLException;
+
+import org.eclipse.microprofile.config.inject.ConfigProperty;
+
+@QuarkusMain
+public class DBMigrator implements QuarkusApplication {
+
+    @Inject
+    MigrationService service;
+
+    @Inject
+    DBConnectionChecker dbConnectionChecker;
+
+    @ConfigProperty(name = "migrate.db.dataindex")
+    Boolean migrateDataIndex;
+
+    @ConfigProperty(name = "migrate.db.jobsservice")
+    Boolean migrateJobsService;
+
+    @Override
+    public int run(String... args) {
+        if (migrateDataIndex) {
+            try {
+                dbConnectionChecker.checkDataIndexDBConnection();
+            } catch (SQLException e) {
+                Log.error( "Error obtaining data index database connection. Cannot proceed, exiting.");
+                Quarkus.asyncExit(-1);
+                return -1;

Review Comment:
   Here we catch a potential exception, and return a specific exit code -1



##########
packages/kogito-db-migrator-tool/src/test/java/org/kie/kogito/postgresql/migrator/DBMigratorTest.java:
##########
@@ -0,0 +1,94 @@
+/*
+ * Copyright 2024 Apache Software Foundation (ASF)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.kie.kogito.postgresql.migrator;
+
+import io.quarkus.test.Mock;
+import org.junit.Rule;
+import org.junit.contrib.java.lang.system.ExpectedSystemExit;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import java.sql.SQLException;
+
+import static org.mockito.Mockito.doThrow;
+import static org.mockito.Mockito.mock;
+
+public class DBMigratorTest {
+    @Rule
+    public final ExpectedSystemExit exitRule = ExpectedSystemExit.none();
+
+    @Mock
+    MigrationService migrationService;
+
+    @Mock
+    DBConnectionChecker dbConnectionChecker;
+
+    DBMigrator dbMigrator = new DBMigrator();
+
+    @BeforeEach
+    public void setupEach() {
+        migrationService = mock(MigrationService.class);
+        dbConnectionChecker = mock(DBConnectionChecker.class);
+    }
+
+    @Test
+    public void testMigratorWithNoMigrations() throws Exception {
+        dbMigrator.migrateDataIndex = false;
+        dbMigrator.migrateJobsService = false;
+
+        exitRule.expectSystemExitWithStatus(0);
+        dbMigrator.run();
+    }
+
+    @Test
+    public void testMigratorWithAllMigrations() throws Exception {
+        dbMigrator.migrateDataIndex = true;
+        dbMigrator.migrateJobsService = true;
+        dbMigrator.dbConnectionChecker = dbConnectionChecker;
+        dbMigrator.service = migrationService;
+
+        exitRule.expectSystemExitWithStatus(0);
+        dbMigrator.run();
+    }
+
+    @Test
+    public void testDataIndexMigrationWithException() throws Exception {
+        dbMigrator.migrateDataIndex = true;
+        dbMigrator.migrateJobsService = false;
+        dbMigrator.dbConnectionChecker = dbConnectionChecker;
+        dbMigrator.service = migrationService;
+
+        doThrow(new SQLException()).when(dbConnectionChecker).checkDataIndexDBConnection();
+
+        exitRule.expectSystemExitWithStatus(-1);
+        dbMigrator.run();
+    }
+
+    @Test
+    public void testJobsServiceWithException() throws Exception {
+        dbMigrator.migrateDataIndex = false;
+        dbMigrator.migrateJobsService = true;
+        dbMigrator.dbConnectionChecker = dbConnectionChecker;
+        dbMigrator.service = migrationService;
+
+        doThrow(new SQLException()).when(dbConnectionChecker).checkJobsServiceDBConnection();
+
+        exitRule.expectSystemExitWithStatus(-2);
+        dbMigrator.run();

Review Comment:
   same here



##########
packages/kogito-db-migrator-tool-image/README.md:
##########
@@ -0,0 +1,116 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+     http://www.apache.org/licenses/LICENSE-2.0
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+-->
+
+# Kogito Postgres DB Migrator Tool Image
+
+This package contains the `Containerfile/Dockerfile` and scripts to build a container image for Kogito Postgres DB Migrator Tool. Details about the Kogito Postgres DB Migrator Tool can be found [here](../kogito-db-migrator-tool/README.md).
+
+## Additional requirements
+
+- docker
+
+## Build
+
+_NOTE_: Before performing this step, be sure that the Kogito Postgres DB Migrator Tool jar has been built and available for inclusion in the image.
+
+- Enable the image to be built:
+
+  ```bash
+  export KIE_TOOLS_BUILD__buildContainerImages=true
+  ```
+
+Run the following in the root folder of the repository to build the package:
+
+```bash
+pnpm -F @kie-tools/kogito-db-migrator-tool-image... build:prod
+```
+
+- Then check if the image is correctly stored:
+
+  ```bash
+  docker images
+  ```
+
+## Run
+
+- Start up a clean container with:
+
+  ```bash
+    docker run docker.io/apache/incubator-kie-kogito-service-db-migration-postgresql:latest
+  ```
+
+## Customization
+
+1. Run a container with custom environment variables:
+
+| NAME                                    | DESCRIPTION                                                                      | DEFAULT                                   |
+| --------------------------------------- | -------------------------------------------------------------------------------- | ----------------------------------------- |
+| MIGRATE_DB_DATAINDEX                    | Set to true if you want to migrate data index database, set to false otherwise   | false                                     |
+| QUARKUS_DATASOURCE_DATAINDEX_JDBC_URL   | Data index database url e.g. jdbc:postgresql://host.docker.internal:5432/di      | jdbc:postgresql://localhost:5432/postgres |
+| QUARKUS_DATASOURCE_DATAINDEX_USERNAME   | Data index database username                                                     | postgres                                  |
+| QUARKUS_DATASOURCE_DATAINDEX_PASSWORD   | Data index database password                                                     | postgres                                  |
+| QUARKUS_FLYWAY_DATAINDEX_SCHEMAS        | Data index database schema                                                       | dataindex                                 |
+| MIGRATE_DB_JOBSSERVICE                  | Set to true if you want to migrate jobs service database, set to false otherwise | false                                     |
+| QUARKUS_DATASOURCE_JOBSSERVICE_JDBC_URL | Jobs service database url e.g. jdbc:postgresql://host.docker.internal:5432/js    | jdbc:postgresql://localhost:5432/postgres |
+| QUARKUS_DATASOURCE_JOBSSERVICE_USERNAME | Jobs service database username                                                   | postgres                                  |
+| QUARKUS_DATASOURCE_JOBSSERVICE_PASSWORD | Jobs service database password                                                   | postgres                                  |
+| QUARKUS_FLYWAY_JOBSSERVICE_SCHEMAS      | Jobs service database schema                                                     | jobsservice                               |
+
+### Example
+
+An example to use diverse environment variables
+
+```bash
+   docker run \
+   --env MIGRATE_DB_DATAINDEX=true \
+   --env QUARKUS_DATASOURCE_DATAINDEX_JDBC_URL=<data-index-db-url e.g. jdbc:postgresql://host.docker.internal:5432/di> \
+   --env QUARKUS_DATASOURCE_DATAINDEX_USERNAME=<data-index-db-user> \
+   --env QUARKUS_DATASOURCE_DATAINDEX_PASSWORD=<data-index-db-password> \
+   --env QUARKUS_FLYWAY_DATAINDEX_SCHEMAS=dataindex \

Review Comment:
   ```suggestion
      --env QUARKUS_FLYWAY_DATAINDEX_SCHEMAS=data-index \
   ```



##########
packages/kogito-db-migrator-tool-image/README.md:
##########
@@ -0,0 +1,116 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+     http://www.apache.org/licenses/LICENSE-2.0
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+-->
+
+# Kogito Postgres DB Migrator Tool Image
+
+This package contains the `Containerfile/Dockerfile` and scripts to build a container image for Kogito Postgres DB Migrator Tool. Details about the Kogito Postgres DB Migrator Tool can be found [here](../kogito-db-migrator-tool/README.md).
+
+## Additional requirements
+
+- docker
+
+## Build
+
+_NOTE_: Before performing this step, be sure that the Kogito Postgres DB Migrator Tool jar has been built and available for inclusion in the image.
+
+- Enable the image to be built:
+
+  ```bash
+  export KIE_TOOLS_BUILD__buildContainerImages=true
+  ```
+
+Run the following in the root folder of the repository to build the package:
+
+```bash
+pnpm -F @kie-tools/kogito-db-migrator-tool-image... build:prod
+```
+
+- Then check if the image is correctly stored:
+
+  ```bash
+  docker images
+  ```
+
+## Run
+
+- Start up a clean container with:
+
+  ```bash
+    docker run docker.io/apache/incubator-kie-kogito-service-db-migration-postgresql:latest
+  ```
+
+## Customization
+
+1. Run a container with custom environment variables:
+
+| NAME                                    | DESCRIPTION                                                                      | DEFAULT                                   |
+| --------------------------------------- | -------------------------------------------------------------------------------- | ----------------------------------------- |
+| MIGRATE_DB_DATAINDEX                    | Set to true if you want to migrate data index database, set to false otherwise   | false                                     |
+| QUARKUS_DATASOURCE_DATAINDEX_JDBC_URL   | Data index database url e.g. jdbc:postgresql://host.docker.internal:5432/di      | jdbc:postgresql://localhost:5432/postgres |
+| QUARKUS_DATASOURCE_DATAINDEX_USERNAME   | Data index database username                                                     | postgres                                  |
+| QUARKUS_DATASOURCE_DATAINDEX_PASSWORD   | Data index database password                                                     | postgres                                  |
+| QUARKUS_FLYWAY_DATAINDEX_SCHEMAS        | Data index database schema                                                       | dataindex                                 |
+| MIGRATE_DB_JOBSSERVICE                  | Set to true if you want to migrate jobs service database, set to false otherwise | false                                     |
+| QUARKUS_DATASOURCE_JOBSSERVICE_JDBC_URL | Jobs service database url e.g. jdbc:postgresql://host.docker.internal:5432/js    | jdbc:postgresql://localhost:5432/postgres |
+| QUARKUS_DATASOURCE_JOBSSERVICE_USERNAME | Jobs service database username                                                   | postgres                                  |
+| QUARKUS_DATASOURCE_JOBSSERVICE_PASSWORD | Jobs service database password                                                   | postgres                                  |
+| QUARKUS_FLYWAY_JOBSSERVICE_SCHEMAS      | Jobs service database schema                                                     | jobsservice                               |

Review Comment:
   ```suggestion
   | QUARKUS_FLYWAY_JOBSSERVICE_SCHEMAS      | Jobs service database schema                                                     | jobs-service                               |
   ```



##########
packages/kogito-db-migrator-tool-image/README.md:
##########
@@ -0,0 +1,116 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+     http://www.apache.org/licenses/LICENSE-2.0
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+-->
+
+# Kogito Postgres DB Migrator Tool Image
+
+This package contains the `Containerfile/Dockerfile` and scripts to build a container image for Kogito Postgres DB Migrator Tool. Details about the Kogito Postgres DB Migrator Tool can be found [here](../kogito-db-migrator-tool/README.md).
+
+## Additional requirements
+
+- docker
+
+## Build
+
+_NOTE_: Before performing this step, be sure that the Kogito Postgres DB Migrator Tool jar has been built and available for inclusion in the image.
+
+- Enable the image to be built:
+
+  ```bash
+  export KIE_TOOLS_BUILD__buildContainerImages=true
+  ```
+
+Run the following in the root folder of the repository to build the package:
+
+```bash
+pnpm -F @kie-tools/kogito-db-migrator-tool-image... build:prod
+```
+
+- Then check if the image is correctly stored:
+
+  ```bash
+  docker images
+  ```
+
+## Run
+
+- Start up a clean container with:
+
+  ```bash
+    docker run docker.io/apache/incubator-kie-kogito-service-db-migration-postgresql:latest

Review Comment:
   I have built the image locally and executed the migration, it worked well :muscle: :
   
   see: https://gist.github.com/wmedvede/549ecb613e2c27d09f4978624c43253b
   
   The only weird thing is that in the logs I can see this:
   
   2024-12-17 17:24:01,255 WARN  [io.qua.run.con.ConfigRecorder] (main) Build time property cannot be changed at runtime:
    - **quarkus.platform.version is set to '3.8.6' but it is build time fixed to '999-SNAPSHOT'.** Did you change the property quarkus.platform.version after building the application?
   2024-12-17 17:24:01,476 INFO  [io.quarkus] (main) sonataflow-db-migrator on JVM (powered by Quarkus 3.8.6) started in 0.443s. 
   
   
   The quarkus.platform.version should never have been  999-SNAPSHOT :thinking: 



##########
packages/kogito-db-migrator-tool/src/main/resources/application.properties:
##########
@@ -0,0 +1,40 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+# Data Index data source
+migrate.db.dataindex=false
+quarkus.datasource.dataindex.db-kind=postgresql
+quarkus.datasource.dataindex.username=postgres
+quarkus.datasource.dataindex.password=postgres
+quarkus.datasource.dataindex.jdbc.url=jdbc:postgresql://localhost:5432/postgres
+quarkus.flyway.dataindex.locations=classpath:postgresql/data-index
+quarkus.flyway.dataindex.schemas=dataindex

Review Comment:
   In regular SonataFlow operator driven deployments of the DataIndex service, we default the DI schema name to
   
   <sonataflow-platform-name>-data-index-service, following that logic, Id suggest using data-index-service



##########
packages/kogito-db-migrator-tool/src/test/java/org/kie/kogito/postgresql/migrator/DBConnectionCheckerTest.java:
##########
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2024 Apache Software Foundation (ASF)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.kie.kogito.postgresql.migrator;
+
+import io.quarkus.test.Mock;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.mockito.Mockito;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+
+import static org.junit.jupiter.api.Assertions.*;

Review Comment:
   wildcard imports we should avoid if possible



##########
packages/kogito-db-migrator-tool-image/README.md:
##########
@@ -0,0 +1,116 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+     http://www.apache.org/licenses/LICENSE-2.0
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+-->
+
+# Kogito Postgres DB Migrator Tool Image
+
+This package contains the `Containerfile/Dockerfile` and scripts to build a container image for Kogito Postgres DB Migrator Tool. Details about the Kogito Postgres DB Migrator Tool can be found [here](../kogito-db-migrator-tool/README.md).
+
+## Additional requirements
+
+- docker
+
+## Build
+
+_NOTE_: Before performing this step, be sure that the Kogito Postgres DB Migrator Tool jar has been built and available for inclusion in the image.
+
+- Enable the image to be built:
+
+  ```bash
+  export KIE_TOOLS_BUILD__buildContainerImages=true
+  ```
+
+Run the following in the root folder of the repository to build the package:
+
+```bash
+pnpm -F @kie-tools/kogito-db-migrator-tool-image... build:prod
+```
+
+- Then check if the image is correctly stored:
+
+  ```bash
+  docker images
+  ```
+
+## Run
+
+- Start up a clean container with:
+
+  ```bash
+    docker run docker.io/apache/incubator-kie-kogito-service-db-migration-postgresql:latest
+  ```
+
+## Customization
+
+1. Run a container with custom environment variables:
+
+| NAME                                    | DESCRIPTION                                                                      | DEFAULT                                   |
+| --------------------------------------- | -------------------------------------------------------------------------------- | ----------------------------------------- |
+| MIGRATE_DB_DATAINDEX                    | Set to true if you want to migrate data index database, set to false otherwise   | false                                     |
+| QUARKUS_DATASOURCE_DATAINDEX_JDBC_URL   | Data index database url e.g. jdbc:postgresql://host.docker.internal:5432/di      | jdbc:postgresql://localhost:5432/postgres |
+| QUARKUS_DATASOURCE_DATAINDEX_USERNAME   | Data index database username                                                     | postgres                                  |
+| QUARKUS_DATASOURCE_DATAINDEX_PASSWORD   | Data index database password                                                     | postgres                                  |
+| QUARKUS_FLYWAY_DATAINDEX_SCHEMAS        | Data index database schema                                                       | dataindex                                 |
+| MIGRATE_DB_JOBSSERVICE                  | Set to true if you want to migrate jobs service database, set to false otherwise | false                                     |
+| QUARKUS_DATASOURCE_JOBSSERVICE_JDBC_URL | Jobs service database url e.g. jdbc:postgresql://host.docker.internal:5432/js    | jdbc:postgresql://localhost:5432/postgres |
+| QUARKUS_DATASOURCE_JOBSSERVICE_USERNAME | Jobs service database username                                                   | postgres                                  |
+| QUARKUS_DATASOURCE_JOBSSERVICE_PASSWORD | Jobs service database password                                                   | postgres                                  |
+| QUARKUS_FLYWAY_JOBSSERVICE_SCHEMAS      | Jobs service database schema                                                     | jobsservice                               |

Review Comment:
   same here



##########
packages/kogito-db-migrator-tool/src/test/java/org/kie/kogito/postgresql/migrator/DBMigratorTest.java:
##########
@@ -0,0 +1,94 @@
+/*
+ * Copyright 2024 Apache Software Foundation (ASF)

Review Comment:
   License header not good, we don't use year.



##########
packages/kogito-db-migrator-tool-image/README.md:
##########
@@ -0,0 +1,116 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+     http://www.apache.org/licenses/LICENSE-2.0
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+-->
+
+# Kogito Postgres DB Migrator Tool Image
+
+This package contains the `Containerfile/Dockerfile` and scripts to build a container image for Kogito Postgres DB Migrator Tool. Details about the Kogito Postgres DB Migrator Tool can be found [here](../kogito-db-migrator-tool/README.md).
+
+## Additional requirements
+
+- docker
+
+## Build
+
+_NOTE_: Before performing this step, be sure that the Kogito Postgres DB Migrator Tool jar has been built and available for inclusion in the image.
+
+- Enable the image to be built:
+
+  ```bash
+  export KIE_TOOLS_BUILD__buildContainerImages=true
+  ```
+
+Run the following in the root folder of the repository to build the package:
+
+```bash
+pnpm -F @kie-tools/kogito-db-migrator-tool-image... build:prod
+```
+
+- Then check if the image is correctly stored:
+
+  ```bash
+  docker images
+  ```
+
+## Run
+
+- Start up a clean container with:
+
+  ```bash
+    docker run docker.io/apache/incubator-kie-kogito-service-db-migration-postgresql:latest
+  ```
+
+## Customization
+
+1. Run a container with custom environment variables:
+
+| NAME                                    | DESCRIPTION                                                                      | DEFAULT                                   |
+| --------------------------------------- | -------------------------------------------------------------------------------- | ----------------------------------------- |
+| MIGRATE_DB_DATAINDEX                    | Set to true if you want to migrate data index database, set to false otherwise   | false                                     |
+| QUARKUS_DATASOURCE_DATAINDEX_JDBC_URL   | Data index database url e.g. jdbc:postgresql://host.docker.internal:5432/di      | jdbc:postgresql://localhost:5432/postgres |
+| QUARKUS_DATASOURCE_DATAINDEX_USERNAME   | Data index database username                                                     | postgres                                  |
+| QUARKUS_DATASOURCE_DATAINDEX_PASSWORD   | Data index database password                                                     | postgres                                  |
+| QUARKUS_FLYWAY_DATAINDEX_SCHEMAS        | Data index database schema                                                       | dataindex                                 |

Review Comment:
   to make it consistent with the comment in the application.properties



##########
packages/kogito-db-migrator-tool/src/test/java/org/kie/kogito/postgresql/migrator/MigrationServiceTest.java:
##########
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2024 Apache Software Foundation (ASF)

Review Comment:
   License header not good, we don't use year.



##########
packages/kogito-db-migrator-tool/src/test/java/org/kie/kogito/postgresql/migrator/DBConnectionCheckerTest.java:
##########
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2024 Apache Software Foundation (ASF)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.kie.kogito.postgresql.migrator;
+
+import io.quarkus.test.Mock;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.mockito.Mockito;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+
+import static org.junit.jupiter.api.Assertions.*;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.Mockito.mockStatic;
+
+public class DBConnectionCheckerTest {
+    DBConnectionChecker dbConnectionChecker = new DBConnectionChecker();
+
+    @Mock
+    static DriverManager driverManager;
+
+    @BeforeAll
+    public static void init() {
+        mockStatic(DriverManager.class);
+    }
+
+    @BeforeEach
+    public void setupEach() {

Review Comment:
   package visibilty, and same for all the other methods and classes



##########
packages/kogito-db-migrator-tool/src/test/java/org/kie/kogito/postgresql/migrator/MigrationServiceTest.java:
##########
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2024 Apache Software Foundation (ASF)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.kie.kogito.postgresql.migrator;
+
+import io.quarkus.test.Mock;
+import org.flywaydb.core.Flyway;
+import org.flywaydb.core.api.output.CleanResult;
+import org.flywaydb.core.api.output.MigrateResult;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import static org.mockito.Mockito.*;
+
+public class MigrationServiceTest {
+    @Mock
+    Flyway flyway;
+
+    MigrationService migrationService = new MigrationService();
+
+    @BeforeEach
+    public void setupEach() {
+        flyway = mock(Flyway.class);
+        when(flyway.migrate()).thenReturn(new MigrateResult("flywayVersion", "db", "schema"));
+        when(flyway.clean()).thenReturn(new CleanResult("flywayVersion", "db"));
+    }
+
+    @Test
+    public void testMigrateDataIndexWithNoClean() {
+        migrationService.cleanDataIndex = false;
+        migrationService.flywayDataIndex = flyway;
+        migrationService.migrateDataIndex();
+    }
+
+    @Test
+    public void testMigrateDataIndexWithClean() {
+        migrationService.cleanDataIndex = true;
+        migrationService.flywayDataIndex = flyway;
+        migrationService.migrateDataIndex();

Review Comment:
   same here



##########
packages/kogito-db-migrator-tool/src/test/java/org/kie/kogito/postgresql/migrator/MigrationServiceTest.java:
##########
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2024 Apache Software Foundation (ASF)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.kie.kogito.postgresql.migrator;
+
+import io.quarkus.test.Mock;
+import org.flywaydb.core.Flyway;
+import org.flywaydb.core.api.output.CleanResult;
+import org.flywaydb.core.api.output.MigrateResult;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import static org.mockito.Mockito.*;
+
+public class MigrationServiceTest {
+    @Mock
+    Flyway flyway;
+
+    MigrationService migrationService = new MigrationService();
+
+    @BeforeEach
+    public void setupEach() {
+        flyway = mock(Flyway.class);
+        when(flyway.migrate()).thenReturn(new MigrateResult("flywayVersion", "db", "schema"));
+        when(flyway.clean()).thenReturn(new CleanResult("flywayVersion", "db"));
+    }
+
+    @Test
+    public void testMigrateDataIndexWithNoClean() {
+        migrationService.cleanDataIndex = false;
+        migrationService.flywayDataIndex = flyway;
+        migrationService.migrateDataIndex();

Review Comment:
   if you are mocking Flyway, it could be nice to Mockito.verify that the expected flyway methods where executed.



##########
packages/kogito-db-migrator-tool/src/test/java/org/kie/kogito/postgresql/migrator/DBMigratorTest.java:
##########
@@ -0,0 +1,94 @@
+/*
+ * Copyright 2024 Apache Software Foundation (ASF)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.kie.kogito.postgresql.migrator;
+
+import io.quarkus.test.Mock;
+import org.junit.Rule;
+import org.junit.contrib.java.lang.system.ExpectedSystemExit;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import java.sql.SQLException;
+
+import static org.mockito.Mockito.doThrow;
+import static org.mockito.Mockito.mock;
+
+public class DBMigratorTest {
+    @Rule
+    public final ExpectedSystemExit exitRule = ExpectedSystemExit.none();
+
+    @Mock
+    MigrationService migrationService;
+
+    @Mock
+    DBConnectionChecker dbConnectionChecker;
+
+    DBMigrator dbMigrator = new DBMigrator();
+
+    @BeforeEach
+    public void setupEach() {
+        migrationService = mock(MigrationService.class);
+        dbConnectionChecker = mock(DBConnectionChecker.class);
+    }
+
+    @Test
+    public void testMigratorWithNoMigrations() throws Exception {
+        dbMigrator.migrateDataIndex = false;
+        dbMigrator.migrateJobsService = false;
+
+        exitRule.expectSystemExitWithStatus(0);
+        dbMigrator.run();

Review Comment:
   If you are mocking migrationService and dbConnectionChecker, it could be nice to Mockito.verify that the expected methods on each object were executed.



##########
packages/kogito-db-migrator-tool/src/test/java/org/kie/kogito/postgresql/migrator/DBMigratorTest.java:
##########
@@ -0,0 +1,94 @@
+/*
+ * Copyright 2024 Apache Software Foundation (ASF)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.kie.kogito.postgresql.migrator;
+
+import io.quarkus.test.Mock;
+import org.junit.Rule;
+import org.junit.contrib.java.lang.system.ExpectedSystemExit;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import java.sql.SQLException;
+
+import static org.mockito.Mockito.doThrow;
+import static org.mockito.Mockito.mock;
+
+public class DBMigratorTest {
+    @Rule
+    public final ExpectedSystemExit exitRule = ExpectedSystemExit.none();
+
+    @Mock
+    MigrationService migrationService;
+
+    @Mock
+    DBConnectionChecker dbConnectionChecker;
+
+    DBMigrator dbMigrator = new DBMigrator();
+
+    @BeforeEach
+    public void setupEach() {
+        migrationService = mock(MigrationService.class);
+        dbConnectionChecker = mock(DBConnectionChecker.class);
+    }
+
+    @Test
+    public void testMigratorWithNoMigrations() throws Exception {
+        dbMigrator.migrateDataIndex = false;
+        dbMigrator.migrateJobsService = false;
+
+        exitRule.expectSystemExitWithStatus(0);
+        dbMigrator.run();
+    }
+
+    @Test
+    public void testMigratorWithAllMigrations() throws Exception {
+        dbMigrator.migrateDataIndex = true;
+        dbMigrator.migrateJobsService = true;
+        dbMigrator.dbConnectionChecker = dbConnectionChecker;
+        dbMigrator.service = migrationService;
+
+        exitRule.expectSystemExitWithStatus(0);
+        dbMigrator.run();

Review Comment:
   same here, Mockito.verify ?



##########
packages/kogito-db-migrator-tool/src/test/java/org/kie/kogito/postgresql/migrator/MigrationServiceTest.java:
##########
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2024 Apache Software Foundation (ASF)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.kie.kogito.postgresql.migrator;
+
+import io.quarkus.test.Mock;
+import org.flywaydb.core.Flyway;
+import org.flywaydb.core.api.output.CleanResult;
+import org.flywaydb.core.api.output.MigrateResult;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import static org.mockito.Mockito.*;
+
+public class MigrationServiceTest {
+    @Mock
+    Flyway flyway;
+
+    MigrationService migrationService = new MigrationService();
+
+    @BeforeEach
+    public void setupEach() {
+        flyway = mock(Flyway.class);
+        when(flyway.migrate()).thenReturn(new MigrateResult("flywayVersion", "db", "schema"));
+        when(flyway.clean()).thenReturn(new CleanResult("flywayVersion", "db"));
+    }
+
+    @Test
+    public void testMigrateDataIndexWithNoClean() {
+        migrationService.cleanDataIndex = false;
+        migrationService.flywayDataIndex = flyway;
+        migrationService.migrateDataIndex();
+    }
+
+    @Test
+    public void testMigrateDataIndexWithClean() {
+        migrationService.cleanDataIndex = true;
+        migrationService.flywayDataIndex = flyway;
+        migrationService.migrateDataIndex();
+    }
+
+    @Test
+    public void testMigrateJobsServiceWithNoClean() {
+        migrationService.cleanJobsService = false;
+        migrationService.flywayJobsService = flyway;
+        migrationService.migrateJobsService();
+    }
+
+    @Test
+    public void testMigrateJobsServiceWithClean() {
+        migrationService.cleanJobsService = true;
+        migrationService.flywayJobsService = flyway;
+        migrationService.migrateJobsService();
+    }

Review Comment:
   same here



##########
packages/kogito-db-migrator-tool/src/test/java/org/kie/kogito/postgresql/migrator/DBMigratorTest.java:
##########
@@ -0,0 +1,94 @@
+/*
+ * Copyright 2024 Apache Software Foundation (ASF)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.kie.kogito.postgresql.migrator;
+
+import io.quarkus.test.Mock;
+import org.junit.Rule;
+import org.junit.contrib.java.lang.system.ExpectedSystemExit;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import java.sql.SQLException;
+
+import static org.mockito.Mockito.doThrow;
+import static org.mockito.Mockito.mock;
+
+public class DBMigratorTest {

Review Comment:
   The trend is now to use package visibility for the Test classes and methods



##########
packages/kogito-db-migrator-tool/src/main/java/org/kie/kogito/postgresql/migrator/DBMigrator.java:
##########
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.kie.kogito.postgresql.migrator;
+
+import io.quarkus.runtime.Quarkus;
+import io.quarkus.runtime.QuarkusApplication;
+import io.quarkus.runtime.annotations.QuarkusMain;
+import jakarta.inject.Inject;
+import io.quarkus.logging.Log;
+
+import java.sql.SQLException;
+
+import org.eclipse.microprofile.config.inject.ConfigProperty;
+
+@QuarkusMain
+public class DBMigrator implements QuarkusApplication {
+
+    @Inject
+    MigrationService service;
+
+    @Inject
+    DBConnectionChecker dbConnectionChecker;
+
+    @ConfigProperty(name = "migrate.db.dataindex")
+    Boolean migrateDataIndex;
+
+    @ConfigProperty(name = "migrate.db.jobsservice")
+    Boolean migrateJobsService;
+
+    @Override
+    public int run(String... args) {
+        if (migrateDataIndex) {
+            try {
+                dbConnectionChecker.checkDataIndexDBConnection();
+            } catch (SQLException e) {
+                Log.error( "Error obtaining data index database connection. Cannot proceed, exiting.");
+                Quarkus.asyncExit(-1);
+                return -1;
+            }
+            service.migrateDataIndex();
+        }
+
+        if (migrateJobsService) {
+            try {
+                dbConnectionChecker.checkJobsServiceDBConnection();
+            } catch (SQLException e) {
+                Log.error( "Error obtaining jobs service database connection. Cannot proceed, exiting.");
+                Quarkus.asyncExit(-2);
+                return -2;

Review Comment:
   same here, we catch the exception, and this time, we return the specific error code -2.
   
   Okay, so, are we returning specific -1 and -2 with the intention of giving a potential caller fine-grained information?
   
   if this is the case, what happens when the rest of the execution fails, for example:
   
               service.migrateDataIndex(); fails, or             service.migrateJobsService();
   
   no specific info?
   
   
   
   



##########
packages/kogito-db-migrator-tool-image/README.md:
##########
@@ -0,0 +1,116 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+     http://www.apache.org/licenses/LICENSE-2.0
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+-->
+
+# Kogito Postgres DB Migrator Tool Image
+
+This package contains the `Containerfile/Dockerfile` and scripts to build a container image for Kogito Postgres DB Migrator Tool. Details about the Kogito Postgres DB Migrator Tool can be found [here](../kogito-db-migrator-tool/README.md).
+
+## Additional requirements
+
+- docker
+
+## Build
+
+_NOTE_: Before performing this step, be sure that the Kogito Postgres DB Migrator Tool jar has been built and available for inclusion in the image.
+
+- Enable the image to be built:
+
+  ```bash
+  export KIE_TOOLS_BUILD__buildContainerImages=true
+  ```
+
+Run the following in the root folder of the repository to build the package:
+
+```bash
+pnpm -F @kie-tools/kogito-db-migrator-tool-image... build:prod
+```
+
+- Then check if the image is correctly stored:
+
+  ```bash
+  docker images
+  ```
+
+## Run
+
+- Start up a clean container with:
+
+  ```bash
+    docker run docker.io/apache/incubator-kie-kogito-service-db-migration-postgresql:latest
+  ```
+
+## Customization
+
+1. Run a container with custom environment variables:
+
+| NAME                                    | DESCRIPTION                                                                      | DEFAULT                                   |
+| --------------------------------------- | -------------------------------------------------------------------------------- | ----------------------------------------- |
+| MIGRATE_DB_DATAINDEX                    | Set to true if you want to migrate data index database, set to false otherwise   | false                                     |
+| QUARKUS_DATASOURCE_DATAINDEX_JDBC_URL   | Data index database url e.g. jdbc:postgresql://host.docker.internal:5432/di      | jdbc:postgresql://localhost:5432/postgres |
+| QUARKUS_DATASOURCE_DATAINDEX_USERNAME   | Data index database username                                                     | postgres                                  |
+| QUARKUS_DATASOURCE_DATAINDEX_PASSWORD   | Data index database password                                                     | postgres                                  |
+| QUARKUS_FLYWAY_DATAINDEX_SCHEMAS        | Data index database schema                                                       | dataindex                                 |

Review Comment:
   ```suggestion
   | QUARKUS_FLYWAY_DATAINDEX_SCHEMAS        | Data index database schema                                                       | data-index                                 |
   ```



##########
packages/maven-base/pom.xml:
##########
@@ -263,6 +265,12 @@
         <version>${version.org.mockito}</version>
         <scope>test</scope>
       </dependency>
+      <dependency>
+        <groupId>com.github.stefanbirkner</groupId>

Review Comment:
   would you mind double check here: see: https://www.apache.org/legal/resolved.html#weak-copyleft-licenses
   if we are safe by using this "Common Public License Version 1.0" library?
   
   maybe you guys @mareknovotny @domhanak know
   



##########
packages/kogito-db-migrator-tool-image/resources/incubator-kie-kogito-db-migrator-tool-image.yaml:
##########
@@ -0,0 +1,50 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+name: "docker.io/apache/incubator-kie-kogito-db-migrator-tool"
+version: "main"
+from: registry.access.redhat.com/ubi8/openjdk-17-runtime:1.20
+description: Flyway image for Data Index and Jobs Service database migration

Review Comment:
   ```suggestion
   description: DBMigratorTool image for Data Index and Jobs Service database migration
   ```



##########
packages/kogito-db-migrator-tool-image/README.md:
##########
@@ -0,0 +1,116 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+     http://www.apache.org/licenses/LICENSE-2.0
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+-->
+
+# Kogito Postgres DB Migrator Tool Image
+
+This package contains the `Containerfile/Dockerfile` and scripts to build a container image for Kogito Postgres DB Migrator Tool. Details about the Kogito Postgres DB Migrator Tool can be found [here](../kogito-db-migrator-tool/README.md).
+
+## Additional requirements
+
+- docker
+
+## Build
+
+_NOTE_: Before performing this step, be sure that the Kogito Postgres DB Migrator Tool jar has been built and available for inclusion in the image.
+
+- Enable the image to be built:
+
+  ```bash
+  export KIE_TOOLS_BUILD__buildContainerImages=true
+  ```
+
+Run the following in the root folder of the repository to build the package:
+
+```bash
+pnpm -F @kie-tools/kogito-db-migrator-tool-image... build:prod
+```
+
+- Then check if the image is correctly stored:
+
+  ```bash
+  docker images
+  ```
+
+## Run
+
+- Start up a clean container with:
+
+  ```bash
+    docker run docker.io/apache/incubator-kie-kogito-service-db-migration-postgresql:latest
+  ```
+
+## Customization
+
+1. Run a container with custom environment variables:
+
+| NAME                                    | DESCRIPTION                                                                      | DEFAULT                                   |
+| --------------------------------------- | -------------------------------------------------------------------------------- | ----------------------------------------- |
+| MIGRATE_DB_DATAINDEX                    | Set to true if you want to migrate data index database, set to false otherwise   | false                                     |
+| QUARKUS_DATASOURCE_DATAINDEX_JDBC_URL   | Data index database url e.g. jdbc:postgresql://host.docker.internal:5432/di      | jdbc:postgresql://localhost:5432/postgres |
+| QUARKUS_DATASOURCE_DATAINDEX_USERNAME   | Data index database username                                                     | postgres                                  |
+| QUARKUS_DATASOURCE_DATAINDEX_PASSWORD   | Data index database password                                                     | postgres                                  |
+| QUARKUS_FLYWAY_DATAINDEX_SCHEMAS        | Data index database schema                                                       | dataindex                                 |
+| MIGRATE_DB_JOBSSERVICE                  | Set to true if you want to migrate jobs service database, set to false otherwise | false                                     |
+| QUARKUS_DATASOURCE_JOBSSERVICE_JDBC_URL | Jobs service database url e.g. jdbc:postgresql://host.docker.internal:5432/js    | jdbc:postgresql://localhost:5432/postgres |
+| QUARKUS_DATASOURCE_JOBSSERVICE_USERNAME | Jobs service database username                                                   | postgres                                  |
+| QUARKUS_DATASOURCE_JOBSSERVICE_PASSWORD | Jobs service database password                                                   | postgres                                  |
+| QUARKUS_FLYWAY_JOBSSERVICE_SCHEMAS      | Jobs service database schema                                                     | jobsservice                               |
+
+### Example
+
+An example to use diverse environment variables
+
+```bash
+   docker run \
+   --env MIGRATE_DB_DATAINDEX=true \
+   --env QUARKUS_DATASOURCE_DATAINDEX_JDBC_URL=<data-index-db-url e.g. jdbc:postgresql://host.docker.internal:5432/di> \
+   --env QUARKUS_DATASOURCE_DATAINDEX_USERNAME=<data-index-db-user> \
+   --env QUARKUS_DATASOURCE_DATAINDEX_PASSWORD=<data-index-db-password> \
+   --env QUARKUS_FLYWAY_DATAINDEX_SCHEMAS=dataindex \
+   --env MIGRATE_DB_JOBSSERVICE=true \
+   --env QUARKUS_DATASOURCE_JOBSSERVICE_JDBC_URL=<jobs-service-db-url e.g. jdbc:postgresql://host.docker.internal:5432/js> \
+   --env QUARKUS_DATASOURCE_JOBSSERVICE_USERNAME=<jobs-service-db-user> \
+   --env QUARKUS_DATASOURCE_JOBSSERVICE_PASSWORD=<jobs-service-db-password> \
+   --env QUARKUS_FLYWAY_JOBSSERVICE_SCHEMAS=jobsservice \

Review Comment:
   ```suggestion
      --env QUARKUS_FLYWAY_JOBSSERVICE_SCHEMAS=jobs-service \
   ```



##########
packages/kogito-db-migrator-tool-image/README.md:
##########
@@ -0,0 +1,116 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+     http://www.apache.org/licenses/LICENSE-2.0
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+-->
+
+# Kogito Postgres DB Migrator Tool Image
+
+This package contains the `Containerfile/Dockerfile` and scripts to build a container image for Kogito Postgres DB Migrator Tool. Details about the Kogito Postgres DB Migrator Tool can be found [here](../kogito-db-migrator-tool/README.md).
+
+## Additional requirements
+
+- docker
+
+## Build
+
+_NOTE_: Before performing this step, be sure that the Kogito Postgres DB Migrator Tool jar has been built and available for inclusion in the image.
+
+- Enable the image to be built:
+
+  ```bash
+  export KIE_TOOLS_BUILD__buildContainerImages=true
+  ```
+
+Run the following in the root folder of the repository to build the package:
+
+```bash
+pnpm -F @kie-tools/kogito-db-migrator-tool-image... build:prod

Review Comment:
   while executing:
   
   export KIE_TOOLS_BUILD__buildContainerImages=true
   
   pnpm -F @kie-tools/kogito-db-migrator-tool-image... build:prod
   
   at some part of the build, I can see sonataflow-db-migrator-**null**.jar, sonataflow-db-migrator-**null**-sources.jar, sonataflow-db-migrator-**null**-test-sources.jar 
   
   this "**null**" does't look good I think. :thinking: 
   
   packages/kogito-db-migrator-tool build:prod$ pnpm pre-build && run-script-os
   [145 lines collapsed]
   │ [INFO] Installing /home/wmedvede/development/projects/kogito/incubator-kie-tools/packages/kogito-db-migrator-tool/.flattened-pom.xml to /home/wmedvede/.m2/repository/org/kie/kogito/sonataflow-db-migr…
   │ [INFO] Installing /home/wmedvede/development/projects/kogito/incubator-kie-tools/packages/kogito-db-migrator-tool/target/sonataflow-db-migrator-null.jar to /home/wmedvede/.m2/repository/org/kie/kogit…
   │ [INFO] Installing /home/wmedvede/development/projects/kogito/incubator-kie-tools/packages/kogito-db-migrator-tool/target/sonataflow-db-migrator-null-sources.jar to /home/wmedvede/.m2/repository/org/k…
   │ [INFO] Installing /home/wmedvede/development/projects/kogito/incubator-kie-tools/packages/kogito-db-migrator-tool/target/sonataflow-db-migrator-null-test-sources.jar to /home/wmedvede/.m2/repository/…
   
   
   



##########
packages/kogito-db-migrator-tool-image/resources/incubator-kie-kogito-db-migrator-tool-image.yaml:
##########
@@ -0,0 +1,50 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+name: "docker.io/apache/incubator-kie-kogito-db-migrator-tool"
+version: "main"
+from: registry.access.redhat.com/ubi8/openjdk-17-runtime:1.20
+description: Flyway image for Data Index and Jobs Service database migration

Review Comment:
   wdyt?



##########
packages/kogito-db-migrator-tool/src/main/resources/application.properties:
##########
@@ -0,0 +1,40 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+# Data Index data source
+migrate.db.dataindex=false
+quarkus.datasource.dataindex.db-kind=postgresql
+quarkus.datasource.dataindex.username=postgres
+quarkus.datasource.dataindex.password=postgres
+quarkus.datasource.dataindex.jdbc.url=jdbc:postgresql://localhost:5432/postgres
+quarkus.flyway.dataindex.locations=classpath:postgresql/data-index
+quarkus.flyway.dataindex.schemas=dataindex
+quarkus.flyway.dataindex.migrate-at-start=false
+quarkus.flyway.dataindex.clean-at-start=false
+
+# Jobs Service data source
+migrate.db.jobsservice=false
+quarkus.datasource.jobsservice.db-kind=postgresql
+quarkus.datasource.jobsservice.username=postgres
+quarkus.datasource.jobsservice.password=postgres
+quarkus.datasource.jobsservice.jdbc.url=jdbc:postgresql://localhost:5432/postgres
+quarkus.flyway.jobsservice.locations=classpath:postgresql/jobs-service
+quarkus.flyway.jobsservice.schemas=jobsservice

Review Comment:
   analogous reasoning as for the DI 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1892465882


##########
packages/kogito-db-migrator-tool-image/package.json:
##########
@@ -0,0 +1,44 @@
+{
+  "private": true,
+  "name": "@kie-tools/kogito-db-migrator-tool-image",
+  "version": "0.0.0",
+  "description": "",
+  "license": "Apache-2.0",
+  "homepage": "https://github.com/apache/incubator-kie-tools",
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/apache/incubator-kie-tools.git"
+  },
+  "bugs": {
+    "url": "https://github.com/apache/incubator-kie-tools/issues"
+  },
+  "scripts": {
+    "build": ". ./node_modules/@kie-tools/python-venv/venv/bin/activate && pnpm copy-assets && pnpm image:build && rimraf build && rimraf target && rimraf dist-tests-e2e",

Review Comment:
   We were cleaning up the directories we created during the build, with `rimraf build` however removed that deletion.
   Now you will see the build dir.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "wmedvede (via GitHub)" <gi...@apache.org>.
wmedvede commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1891330845


##########
packages/kogito-db-migrator-tool/pom.xml:
##########
@@ -31,7 +31,7 @@
 
   <modelVersion>4.0.0</modelVersion>
   <groupId>org.kie.kogito</groupId>
-  <artifactId>sonataflow-db-migrator</artifactId>
+  <artifactId>kogito-db-migrator-tool</artifactId>

Review Comment:
   :+1: 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "wmedvede (via GitHub)" <gi...@apache.org>.
wmedvede commented on PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#issuecomment-2596069297

   > 1. If we want to include "postgresql" in the name of the packages; and
   
   @tiagobento @rhkp @ricardozanini 
   Even while now the db-migrator only incorporate the sql files for postgresql, it is very close to be a multi database migrator :rocket:. In fact, I was about to suggest that in my reviews, by incorporating an additional parameter "db-type"...., but I didn't want to add more changes to not frustrate the PR author with more suggestions :).
   
   But I'm pretty sure that in the future... more db-types will come.
   
   So I'd vote for keeping the naming as is.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "tiagobento (via GitHub)" <gi...@apache.org>.
tiagobento commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1811476720


##########
packages/kogito-db-migrator-tool/env/index.js:
##########
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+const { varsWithName, composeEnv } = require("@kie-tools-scripts/build-env");
+
+module.exports = composeEnv([require("@kie-tools/root-env/env")], {
+  vars: varsWithName({}),
+  get env() {
+    return {
+      devDeploymentQuarkusApp: {
+        version: require("../package.json").version,
+      },

Review Comment:
   ?



##########
packages/kogito-db-migrator-tool/.gitignore:
##########


Review Comment:
   Why do you need so many things here?



##########
packages/kogito-db-migrator-tool/install.js:
##########
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+const { env } = require("./env");
+const { setupMavenConfigFile, installMvnw, buildTailFromPackageJsonDependencies } = require("@kie-tools/maven-base");
+
+setupMavenConfigFile(
+  `
+    --batch-mode
+    -Dstyle.color=always
+    -Drevision=${env.devDeploymentQuarkusApp.version}
+    -Dversion.quarkus=${env.versions.quarkus}
+    -Dversion.org.kie.kogito=${env.versions.kogito}

Review Comment:
   We don't need those here, as they come from `maven-base` already.



##########
packages/kogito-db-migrator-tool/install.js:
##########
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+const { env } = require("./env");
+const { setupMavenConfigFile, installMvnw, buildTailFromPackageJsonDependencies } = require("@kie-tools/maven-base");
+
+setupMavenConfigFile(
+  `
+    --batch-mode
+    -Dstyle.color=always
+    -Drevision=${env.devDeploymentQuarkusApp.version}
+    -Dversion.quarkus=${env.versions.quarkus}
+    -Dversion.org.kie.kogito=${env.versions.kogito}
+    -Dmaven.repo.local.tail=${buildTailFromPackageJsonDependencies()}
+`,
+  { ignoreDefault: true } // Can't have special <repositories> configuration that only works inside this repo.
+);
+
+installMvnw();

Review Comment:
   I don't think you need `mvnw` here.



##########
packages/kogito-db-migrator-tool/package.json:
##########
@@ -0,0 +1,33 @@
+{
+  "private": true,
+  "name": "@kie-tools/kogito-db-migrator-tool",
+  "version": "0.0.0",
+  "description": "",
+  "license": "Apache-2.0",
+  "homepage": "https://github.com/apache/incubator-kie-tools",
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/apache/incubator-kie-tools.git"
+  },
+  "bugs": {
+    "url": "https://github.com/apache/incubator-kie-tools/issues"
+  },
+  "scripts": {
+    "build:dev": "./build-db-migrator-jar.sh true",
+    "build:prod": "./build-db-migrator-jar.sh false",

Review Comment:
   These commands add an unnecessary indirection and don't work on Windows.



##########
packages/kogito-db-migrator-tool/src/main/cekit/image.yaml:
##########
@@ -0,0 +1,45 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+name: "docker.io/apache/incubator-kie-kogito-service-db-migration-postgresql"
+version: "999-SNAPSHOT"

Review Comment:
   I still see this file on PR... will it be removed?



##########
packages/kogito-db-migrator-tool/get-kogito-ddl-scripts.sh:
##########
@@ -0,0 +1,64 @@
+#!/bin/sh
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+set -x
+set -e
+
+# Script variables with default values. These values will be updated by hack/bump-version.sh, don't change it.
+DDL_VERSION=10.0.999-SNAPSHOT
+DDL_FILE=kogito-ddl-10.0.999-20241018.012042-73-db-scripts.zip

Review Comment:
   This needs to be parameterized.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "tiagobento (via GitHub)" <gi...@apache.org>.
tiagobento commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1821506218


##########
packages/kogito-db-migrator-tool/install.js:
##########
@@ -0,0 +1,18 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */

Review Comment:
   This install.js script is for the Maven module, not for the image.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1821498762


##########
packages/kogito-db-migrator-tool/README.md:
##########
@@ -0,0 +1,39 @@
+# Kogito Postgres DB Migrator Tool
+
+This is a java quarkus based postgres database migrator application for SonataFlow Data Index and Jobs Service applications for use by SonataFlow Operator.
+
+_NOTE_: This postgres database migrator application and its corresponding images are only envisaged to be made use of by SonataFlow Operator, Data Index and Jobs Service internally. Conversely this application is of no use outside the usecases involved with SonataFlow Operator, Data Index and Jobs Service.
+
+## Build jar file
+
+You can build the jar file with the script `build-db-migrator-jar.sh` which places the jar into /tmp/ kogito-db-migrator-tool directory for use by the corresponding image builder in package kogito-db-migrator-tool-image later, which can be found [here](../kogito-db-migrator-tool-image/README.md).
+
+```shell
+pnpm -F kogito-db-migrator-tool... build:dev
+```

Review Comment:
   Agreed. I have removed this small section.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "tiagobento (via GitHub)" <gi...@apache.org>.
tiagobento commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1816994612


##########
packages/kogito-db-migrator-tool/.dockerignore:
##########


Review Comment:
   Unnecessary file? There's no Docker in this package.



##########
packages/kogito-db-migrator-tool/.gitignore:
##########


Review Comment:
   Unnecessary file? This is all handled by the top-level .gitignore already.



##########
packages/kogito-db-migrator-tool/env/index.js:
##########
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+const { varsWithName, composeEnv, getOrDefault } = require("@kie-tools-scripts/build-env");
+
+module.exports = composeEnv([require("@kie-tools/root-env/env")], {
+  vars: varsWithName({
+    KOGITO_DB_MIGRATOR_TOOL__ddl_version: {
+      default: "10.0.999-SNAPSHOT",
+      description: "The version to use for ddl.",
+    },
+    KOGITO_DB_MIGRATOR_TOOL__ddl_file_name: {
+      default: "kogito-ddl-10.0.999-20241018.012042-73-db-scripts.zip",
+      description: "The file name for ddl.",
+    },
+    KOGITO_DB_MIGRATOR_TOOL__ddl_base_url: {
+      default: "https://repository.apache.org/content/groups/snapshots/org/kie/kogito/kogito-ddl",
+      description: "The url from where the ddl file will be downloaded.",
+    },

Review Comment:
   Default values here don't make sense. We can't have it point to a fixed version like that, especially a SNAPSHOT version.



##########
packages/kogito-db-migrator-tool/pom.xml:
##########
@@ -0,0 +1,200 @@
+<?xml version="1.0" ?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+-->
+<project
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
+  xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+>
+  <parent>
+    <groupId>org.kie</groupId>
+    <artifactId>kie-tools-maven-base</artifactId>
+    <version>${revision}</version>
+    <relativePath>./node_modules/@kie-tools/maven-base/pom.xml</relativePath>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.kie.kogito</groupId>
+  <artifactId>sonataflow-db-migrator</artifactId>
+  <properties>
+    <project.build.outputTimestamp>2024-11-01T00:00:00Z</project.build.outputTimestamp>
+    <quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
+    <quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
+    <quarkus.platform.version>3.13.0</quarkus.platform.version>

Review Comment:
   Yes, this is all on `maven-base` already, no need to have it here. And we're currently on Quarkus 3.8.6.



##########
packages/kogito-db-migrator-tool/install.js:
##########
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+const { env } = require("./env");
+const { setupMavenConfigFile, installMvnw, buildTailFromPackageJsonDependencies } = require("@kie-tools/maven-base");
+
+setupMavenConfigFile(
+  `
+    --batch-mode
+    -Dstyle.color=always
+    -Drevision=${env.kogitoDBMigratorTool.version}
+    -Dversion.quarkus=${env.versions.quarkus}
+    -Dversion.org.kie.kogito=${env.versions.kogito}
+    -Dmaven.repo.local.tail=${buildTailFromPackageJsonDependencies()}
+`,
+  { ignoreDefault: true } // Can't have special <repositories> configuration that only works inside this repo.

Review Comment:
   This is not necessary for this package, as it can (and does) declare `maven-base` as its parent.



##########
packages/kogito-db-migrator-tool/package.json:
##########
@@ -0,0 +1,33 @@
+{
+  "private": true,
+  "name": "@kie-tools/kogito-db-migrator-tool",
+  "version": "0.0.0",
+  "description": "",
+  "license": "Apache-2.0",
+  "homepage": "https://github.com/apache/incubator-kie-tools",
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/apache/incubator-kie-tools.git"
+  },
+  "bugs": {
+    "url": "https://github.com/apache/incubator-kie-tools/issues"
+  },
+  "scripts": {
+    "build:dev": "./build-db-migrator-jar.sh true",
+    "build:prod": "./build-db-migrator-jar.sh false",

Review Comment:
   Yeah, please don't externalize the build scripts. We don't need more indirection here. Especially with this un-nammed `true/false` argument.



##########
packages/kogito-db-migrator-tool/pom.xml:
##########
@@ -0,0 +1,200 @@
+<?xml version="1.0" ?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+-->
+<project
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
+  xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+>
+  <parent>
+    <groupId>org.kie</groupId>
+    <artifactId>kie-tools-maven-base</artifactId>
+    <version>${revision}</version>
+    <relativePath>./node_modules/@kie-tools/maven-base/pom.xml</relativePath>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.kie.kogito</groupId>
+  <artifactId>sonataflow-db-migrator</artifactId>
+  <properties>
+    <project.build.outputTimestamp>2024-11-01T00:00:00Z</project.build.outputTimestamp>
+    <quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
+    <quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
+    <quarkus.platform.version>3.13.0</quarkus.platform.version>
+    <skipITs>true</skipITs>
+
+    <jacoco.version>0.8.12</jacoco.version>
+    <systemrules.version>1.19.0</systemrules.version>

Review Comment:
   These should be in `maven-base` and the necessary plugins declared in `pluginManagement`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "ricardozanini (via GitHub)" <gi...@apache.org>.
ricardozanini commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1817238706


##########
packages/kogito-db-migrator-tool/pom.xml:
##########
@@ -0,0 +1,199 @@
+<?xml version="1.0" ?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+-->
+<project
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
+  xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+>
+  <parent>
+    <groupId>org.kie</groupId>
+    <artifactId>kie-tools-maven-base</artifactId>
+    <version>${revision}</version>
+    <relativePath>./node_modules/@kie-tools/maven-base/pom.xml</relativePath>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.kie.kogito</groupId>
+  <artifactId>sonataflow-db-migrator</artifactId>
+  <properties>
+    <quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
+    <quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
+    <quarkus.platform.version>3.13.0</quarkus.platform.version>
+    <skipITs>true</skipITs>
+
+    <jacoco.version>0.8.12</jacoco.version>
+    <systemrules.version>1.19.0</systemrules.version>
+  </properties>
+
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>${quarkus.platform.group-id}</groupId>
+        <artifactId>${quarkus.platform.artifact-id}</artifactId>
+        <version>${quarkus.platform.version}</version>
+        <type>pom</type>
+        <scope>import</scope>

Review Comment:
   No need to declare this. We already have it in `maven-base`.
   
   https://github.com/apache/incubator-kie-tools/blob/main/packages/maven-base/pom.xml#L210



##########
packages/kogito-db-migrator-tool/pom.xml:
##########
@@ -0,0 +1,199 @@
+<?xml version="1.0" ?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+-->
+<project
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
+  xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+>
+  <parent>
+    <groupId>org.kie</groupId>
+    <artifactId>kie-tools-maven-base</artifactId>
+    <version>${revision}</version>
+    <relativePath>./node_modules/@kie-tools/maven-base/pom.xml</relativePath>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.kie.kogito</groupId>
+  <artifactId>sonataflow-db-migrator</artifactId>
+  <properties>
+    <quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
+    <quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
+    <quarkus.platform.version>3.13.0</quarkus.platform.version>
+    <skipITs>true</skipITs>
+
+    <jacoco.version>0.8.12</jacoco.version>
+    <systemrules.version>1.19.0</systemrules.version>
+  </properties>
+
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>${quarkus.platform.group-id}</groupId>
+        <artifactId>${quarkus.platform.artifact-id}</artifactId>
+        <version>${quarkus.platform.version}</version>
+        <type>pom</type>
+        <scope>import</scope>

Review Comment:
   No need to declare this. We already have it in `maven-base`.
   
   https://github.com/apache/incubator-kie-tools/blob/main/packages/maven-base/pom.xml#L202-L208



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "ricardozanini (via GitHub)" <gi...@apache.org>.
ricardozanini commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1817238307


##########
packages/kogito-db-migrator-tool/pom.xml:
##########
@@ -0,0 +1,200 @@
+<?xml version="1.0" ?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+-->
+<project
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
+  xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+>
+  <parent>
+    <groupId>org.kie</groupId>
+    <artifactId>kie-tools-maven-base</artifactId>
+    <version>${revision}</version>
+    <relativePath>./node_modules/@kie-tools/maven-base/pom.xml</relativePath>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.kie.kogito</groupId>
+  <artifactId>sonataflow-db-migrator</artifactId>
+  <properties>
+    <project.build.outputTimestamp>2024-11-01T00:00:00Z</project.build.outputTimestamp>
+    <quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
+    <quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
+    <quarkus.platform.version>3.13.0</quarkus.platform.version>
+    <skipITs>true</skipITs>
+
+    <jacoco.version>0.8.12</jacoco.version>
+    <systemrules.version>1.19.0</systemrules.version>

Review Comment:
   @rhkp I think what @tiagobento means is that we can add as part of this PR, these versions there so we will have one point of upgrade when maintaining this repo.
   
   https://github.com/apache/incubator-kie-tools/blob/main/packages/maven-base/pom.xml#L210



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "ricardozanini (via GitHub)" <gi...@apache.org>.
ricardozanini commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1817237250


##########
packages/kogito-db-migrator-tool/pom.xml:
##########
@@ -0,0 +1,200 @@
+<?xml version="1.0" ?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+-->
+<project
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
+  xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+>
+  <parent>
+    <groupId>org.kie</groupId>
+    <artifactId>kie-tools-maven-base</artifactId>
+    <version>${revision}</version>
+    <relativePath>./node_modules/@kie-tools/maven-base/pom.xml</relativePath>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.kie.kogito</groupId>
+  <artifactId>sonataflow-db-migrator</artifactId>
+  <properties>
+    <project.build.outputTimestamp>2024-11-01T00:00:00Z</project.build.outputTimestamp>
+    <quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
+    <quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
+    <quarkus.platform.version>3.13.0</quarkus.platform.version>

Review Comment:
   No, here you're forcing the Quarkus version. Don't need to add that since the `maven-base` already configures Quarkus for us. Just declare your quarkus dependencies in this pom.xml.
   
   https://github.com/apache/incubator-kie-tools/blob/main/packages/maven-base/pom.xml#L202-L208



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1817163668


##########
packages/kogito-db-migrator-tool/get-kogito-ddl-scripts.sh:
##########
@@ -0,0 +1,64 @@
+#!/bin/sh
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+set -x
+set -e
+
+# Script variables with default values. These values will be updated by hack/bump-version.sh, don't change it.
+DDL_VERSION=10.0.999-SNAPSHOT
+DDL_FILE=kogito-ddl-10.0.999-20241018.012042-73-db-scripts.zip
+DDL_BASE_URL=https://repository.apache.org/content/groups/snapshots/org/kie/kogito/kogito-ddl

Review Comment:
   @ricardozanini Done.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1817402722


##########
packages/kogito-db-migrator-tool-image/resources/modules/kogito-postgres-db-migration-deps/module.yaml:
##########
@@ -0,0 +1,25 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+schema_version: 1
+name: org.kie.kogito.postgresql.db-migration-deps
+version: "main"
+artifacts:
+  - name: sonataflow-db-migrator-runner.jar
+    path: sonataflow-db-migrator-runner.jar
+    dest: /home/kogito

Review Comment:
   Done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "tiagobento (via GitHub)" <gi...@apache.org>.
tiagobento commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1930649569


##########
packages/kogito-db-migrator-tool-image/resources/incubator-kie-kogito-db-migrator-tool-image.yaml:
##########
@@ -0,0 +1,50 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+name: "docker.io/apache/incubator-kie-kogito-db-migrator-tool"
+version: "main"
+from: registry.access.redhat.com/ubi8/openjdk-17-runtime:1.20
+description: DBMigratorTool image for Data Index and Jobs Service database migration
+
+labels:
+  - name: "org.kie.kogito.version"
+    value: "### SET ME DURING BUILD PROCESS ###"
+  - name: "maintainer"
+    value: "Apache KIE <de...@kie.apache.org>"
+  - name: "io.k8s.description"
+    value: "Kogito DB Migration creates schemas and tables for Data Index and Jobs Service for PostgreSQL database"
+  - name: "io.k8s.display-name"
+    value: "Kogito DB Migration Tool for Data Index and Jobs Service - PostgreSQL"

Review Comment:
   Not generic too.



##########
packages/kogito-db-migrator-tool/README.md:
##########
@@ -0,0 +1,31 @@
+# Kogito PostgreSQL DB Migrator Tool
+
+This is a Java, Quarkus-based PostgreSQL database migrator application for Data-Index and Jobs Service applications for use by SonataFlow Operator.
+
+_NOTE_: This PostgreSQL database migrator application and its corresponding images are only envisaged to be made use of by SonataFlow Operator, Data Index and Jobs Service internally. Conversely this application is of no use outside the usecases involved with SonataFlow Operator, Data Index and Jobs Service applications.

Review Comment:
   This is still PostgreSQL-specific. If the package is going to be a generic DB migrator, please adjust accordingly stating so.



##########
packages/kogito-db-migrator-tool-image/README.md:
##########
@@ -0,0 +1,94 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+     http://www.apache.org/licenses/LICENSE-2.0
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+-->
+
+# Kogito PostgreSQL DB Migrator Tool Image
+
+This package contains the `Containerfile/Dockerfile` and scripts to build a container image for Kogito PostgreSQL DB Migrator Tool. Details about the Kogito PostgreSQL DB Migrator Tool can be found [here](../kogito-db-migrator-tool/README.md)

Review Comment:
   Same comment about being generic.



##########
packages/kogito-db-migrator-tool/src/main/java/org/kie/kogito/postgresql/migrator/MigrationService.java:
##########
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.kie.kogito.postgresql.migrator;

Review Comment:
   ```suggestion
   package org.kie.kogito.migrator.postgresql;
   ```



##########
packages/kogito-db-migrator-tool-image/package.json:
##########
@@ -0,0 +1,45 @@
+{
+  "private": true,
+  "name": "@kie-tools/kogito-db-migrator-tool-image",
+  "version": "0.0.0",
+  "description": "",
+  "license": "Apache-2.0",
+  "homepage": "https://github.com/apache/incubator-kie-tools",
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/apache/incubator-kie-tools.git"
+  },
+  "bugs": {
+    "url": "https://github.com/apache/incubator-kie-tools/issues"
+  },
+  "scripts": {
+    "build": "run-script-if --bool \"$(build-env containerImages.build)\" --then \"pnpm venv-activate\" \"pnpm copy-assets\" \"pnpm image:build\" \"rimraf target\" \"rimraf dist-tests-e2e\"",
+    "build:dev": "run-script-os",
+    "build:dev:linux": "pnpm build",
+    "build:dev:win32:darwin": "echo \"Build skipped on Windows and MacOS\"",
+    "build:prod": "run-script-os",
+    "build:prod:linux": "pnpm build",
+    "build:prod:win32:darwin": "echo \"Build skipped on Windows and MacOS\"",
+    "copy-assets": "run-script-os",
+    "copy-assets:linux:darwin": "rimraf build && cp -R ./node_modules/@kie-tools/sonataflow-image-common/resources build && cp -R resources/* build && mkdir -p build/modules/kogito-postgres-db-migration-deps/quarkus-app && cp -R ./node_modules/@kie-tools/kogito-db-migrator-tool/target/quarkus-app/* build/modules/kogito-postgres-db-migration-deps/quarkus-app",

Review Comment:
   Name of the module on `sonataflow-image-common` should be changed to `kogito-db-migrator/postgresql` instead of `kogito-postgres-db-migration-deps` probably?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "ricardozanini (via GitHub)" <gi...@apache.org>.
ricardozanini commented on PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#issuecomment-2551710432

   @rhkp @wmedvede 
   
   > however, the package is: kogito-db-migrator-tool
   
   That should be the name of the package, it's not sonataflow related.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "wmedvede (via GitHub)" <gi...@apache.org>.
wmedvede commented on PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#issuecomment-2551228494

   An**other general comment that I have just noted:**
   
   1. In the module Readme, we say that the migration tool is intended only for use in the context of the Sontaflow operator, etc.
   2. The produced artifact, is **sonataflow-db-migrator**
   ```
      <modelVersion>4.0.0</modelVersion>
     <groupId>org.kie.kogito</groupId>
     <artifactId>sonataflow-db-migrator</artifactId>
   ```
   
   however, the package is: **kogito-db-migrator-tool**
   
   For me it doesn't look consistent :thinking: 
   
   wdyt?
   @rgdoliveira @ricardozanini @domhanak  @rhkp 
   
   ![Screenshot from 2024-12-18 13-12-14](https://github.com/user-attachments/assets/60f1a6a9-9ee5-4a96-92c8-83458be5e336)
   
   
   Then, in the case of the image:
   
   The package is:  kogito-db-migrator-tool-image and we produce: apache/incubator-kie-kogito-db-migrator-tool, looks consistent.
   
   ![Screenshot from 2024-12-18 13-36-59](https://github.com/user-attachments/assets/9d48dc28-bac7-403c-b157-df37153088cf)
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1889301494


##########
packages/kogito-db-migrator-tool-image/README.md:
##########
@@ -0,0 +1,116 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+     http://www.apache.org/licenses/LICENSE-2.0
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+-->
+
+# Kogito Postgres DB Migrator Tool Image
+
+This package contains the `Containerfile/Dockerfile` and scripts to build a container image for Kogito Postgres DB Migrator Tool. Details about the Kogito Postgres DB Migrator Tool can be found [here](../kogito-db-migrator-tool/README.md).
+
+## Additional requirements
+
+- docker
+
+## Build
+
+_NOTE_: Before performing this step, be sure that the Kogito Postgres DB Migrator Tool jar has been built and available for inclusion in the image.
+
+- Enable the image to be built:
+
+  ```bash
+  export KIE_TOOLS_BUILD__buildContainerImages=true
+  ```
+
+Run the following in the root folder of the repository to build the package:
+
+```bash
+pnpm -F @kie-tools/kogito-db-migrator-tool-image... build:prod
+```
+
+- Then check if the image is correctly stored:
+
+  ```bash
+  docker images
+  ```
+
+## Run
+
+- Start up a clean container with:
+
+  ```bash
+    docker run docker.io/apache/incubator-kie-kogito-service-db-migration-postgresql:latest
+  ```
+
+## Customization
+
+1. Run a container with custom environment variables:
+
+| NAME                                    | DESCRIPTION                                                                      | DEFAULT                                   |
+| --------------------------------------- | -------------------------------------------------------------------------------- | ----------------------------------------- |
+| MIGRATE_DB_DATAINDEX                    | Set to true if you want to migrate data index database, set to false otherwise   | false                                     |
+| QUARKUS_DATASOURCE_DATAINDEX_JDBC_URL   | Data index database url e.g. jdbc:postgresql://host.docker.internal:5432/di      | jdbc:postgresql://localhost:5432/postgres |
+| QUARKUS_DATASOURCE_DATAINDEX_USERNAME   | Data index database username                                                     | postgres                                  |
+| QUARKUS_DATASOURCE_DATAINDEX_PASSWORD   | Data index database password                                                     | postgres                                  |
+| QUARKUS_FLYWAY_DATAINDEX_SCHEMAS        | Data index database schema                                                       | dataindex                                 |

Review Comment:
   Sure changed to `data-index-service` as in application properties.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "ricardozanini (via GitHub)" <gi...@apache.org>.
ricardozanini commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1919210932


##########
packages/sonataflow-image-common/resources/scripts/build-kogito-apps-components.sh:
##########
@@ -56,6 +56,9 @@ if [ ! -z "${CYPRESS_BINARY_URL}" ]; then
 fi
 
 case ${imageName} in
+    "incubator-kie-kogito-db-migrator-tool")
+        contextDir="db-migrator-tool/image"
+        ;;

Review Comment:
   No, we do not. This file should be gone as well as any reference to it. To my knowledge, this package here (image) should rely on the `db-migrator` one to have the application packaged into the image. That's why both packages live together in the same repo.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#issuecomment-2444987808

   > @rhkp Not sure this is WIP, but having these new env vars on `root-env` is not really the way to go. Can you please share your reasoning? Not sure if there are things missing on MANUAL.md that could help. Thanks!
   
   Hi @tiagobento,
   We have used a better approach using maven dependency plugin and changes to the root-env are rolled back.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "ricardozanini (via GitHub)" <gi...@apache.org>.
ricardozanini commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1821422715


##########
packages/kogito-db-migrator-tool-image/resources/kogito-db-migrator-tool-image.yaml:
##########
@@ -0,0 +1,49 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+name: "docker.io/apache/kogito-db-migrator-tool"

Review Comment:
   ```suggestion
   name: "docker.io/apache/incubator-kie-kogito-db-migrator-tool"
   ```



##########
packages/kogito-db-migrator-tool/install.js:
##########
@@ -0,0 +1,18 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */

Review Comment:
   You can copy from this file: https://github.com/apache/incubator-kie-tools/blob/main/packages/kogito-data-index-ephemeral-image/install.js



##########
packages/kogito-db-migrator-tool-image/env/index.js:
##########
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+const { varsWithName, composeEnv, getOrDefault } = require("@kie-tools-scripts/build-env");
+
+const rootEnv = require("@kie-tools/root-env/env");
+
+module.exports = composeEnv([rootEnv], {
+  vars: varsWithName({
+    KOGITO_DB_MIGRATOR_TOOL_IMAGE__registry: {
+      default: "docker.io",
+      description: "The image registry.",
+    },
+    KOGITO_DB_MIGRATOR_TOOL_IMAGE__account: {
+      default: "apache",
+      description: "The image registry account.",
+    },
+    KOGITO_DB_MIGRATOR_TOOL_IMAGE__name: {
+      default: "kogito-db-migrator-tool",

Review Comment:
   ```suggestion
         default: "incubator-kie-kogito-db-migrator-tool",
   ```



##########
packages/kogito-db-migrator-tool/package.json:
##########
@@ -0,0 +1,38 @@
+{
+  "private": true,
+  "name": "@kie-tools/kogito-db-migrator-tool",
+  "version": "0.0.0",
+  "description": "",
+  "license": "Apache-2.0",
+  "homepage": "https://github.com/apache/incubator-kie-tools",
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/apache/incubator-kie-tools.git"
+  },
+  "bugs": {
+    "url": "https://github.com/apache/incubator-kie-tools/issues"
+  },
+  "scripts": {
+    "build:dev": "pnpm pre-build && mvn clean install -DskipTests -Dquarkus.package.type=uber-jar && pnpm drop-jar && pnpm cleanup-ddl-dirs",
+    "build:prod": "pnpm pre-build && mvn clean install -DskipTests=$(build-env tests.run --not) -Dmaven.test.failure.ignore=$(build-env tests.ignoreFailures) -Dquarkus.package.type=uber-jar && pnpm drop-jar && pnpm cleanup-ddl-dirs",
+    "cleanup": "pnpm cleanup-drop-jar && pnpm cleanup-ddl-dirs",
+    "cleanup-ddl-dirs": "rimraf src/main/resources/ansi && rimraf src/main/resources/postgresql",
+    "cleanup-drop-jar": "rimraf /tmp/kogito-db-migrator-tool/ && mkdir -p /tmp/kogito-db-migrator-tool",
+    "drop-jar": "cp target/sonataflow-db-migrator-0.0.0-runner.jar /tmp/kogito-db-migrator-tool",

Review Comment:
   Instead, we can copy this jar in the image `package.json` from the `target` directory. Also, we are not using `uber-jar` for images, but `quarkus-app` instead.



##########
packages/kogito-db-migrator-tool-image/package.json:
##########
@@ -0,0 +1,38 @@
+{
+  "private": true,
+  "name": "@kie-tools/kogito-db-migrator-tool-image",
+  "version": "0.0.0",
+  "description": "",
+  "license": "Apache-2.0",
+  "homepage": "https://github.com/apache/incubator-kie-tools",
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/apache/incubator-kie-tools.git"
+  },
+  "bugs": {
+    "url": "https://github.com/apache/incubator-kie-tools/issues"
+  },
+  "scripts": {
+    "build": "pnpm copy-assets && pnpm image:build && rimraf build && rimraf target && rimraf dist-tests-e2e",
+    "build:dev": "pnpm build",
+    "build:prod": "pnpm build",
+    "copy-assets": "run-script-os",
+    "copy-assets:linux:darwin": "rimraf build && cp -R ./node_modules/@kie-tools/sonataflow-image-common/resources build && cp -R resources/* build",
+    "format": "prettier --write . --ignore-path=../../.prettierignore --ignore-path=../../.gitignore",
+    "image:build": "run-script-os",
+    "image:build:darwin:linux": "pnpm setup:env && ./resources/build-container-image.sh",
+    "image:build:win32": "echo \"Build skipped on Windows\"",
+    "install": "node install.js && pnpm format",
+    "setup:env": ". ./node_modules/@kie-tools/python-venv/venv/bin/activate && cross-env KOGITO_IMAGE_REGISTRY=$(build-env kogitoDbMigratorToolImage.registry) KOGITO_IMAGE_REGISTRY_ACCOUNT=$(build-env kogitoDbMigratorToolImage.account) KOGITO_IMAGE_NAME=$(build-env kogitoDbMigratorToolImage.name) KOGITO_IMAGE_TAG=$(build-env kogitoDbMigratorToolImage.buildTag) QUARKUS_PLATFORM_VERSION=$(build-env versions.quarkus) KOGITO_VERSION=$(build-env versions.kogito)"
+  },
+  "dependencies": {
+    "@kie-tools/kogito-db-migrator-tool": "workspace:*",
+    "@kie-tools/python-venv": "workspace:*",
+    "@kie-tools/root-env": "workspace:*",
+    "@kie-tools/sonataflow-image-common": "workspace:*",
+    "cross-env": "^7.0.3",
+    "replace-in-file": "^7.1.0",
+    "rimraf": "^3.0.2",
+    "run-script-os": "^1.1.6"

Review Comment:
   These are devDependencies, see: https://github.com/apache/incubator-kie-tools/blob/main/packages/kogito-data-index-ephemeral-image/package.json#L35-L43



##########
packages/kogito-db-migrator-tool/pom.xml:
##########
@@ -0,0 +1,165 @@
+<?xml version="1.0" ?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+-->
+<project
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
+  xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+>
+  <parent>
+    <groupId>org.kie</groupId>
+    <artifactId>kie-tools-maven-base</artifactId>
+    <version>${revision}</version>
+    <relativePath>./node_modules/@kie-tools/maven-base/pom.xml</relativePath>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.kie.kogito</groupId>
+  <artifactId>sonataflow-db-migrator</artifactId>
+
+  <dependencies>
+    <dependency>
+      <groupId>io.quarkus</groupId>
+      <artifactId>quarkus-flyway</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.quarkus</groupId>
+      <artifactId>quarkus-jdbc-postgresql</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.quarkus</groupId>
+      <artifactId>quarkus-arc</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.quarkus</groupId>
+      <artifactId>quarkus-junit5</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-junit-jupiter</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-core</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>com.github.stefanbirkner</groupId>
+      <artifactId>system-rules</artifactId>
+      <version>${version.com.github.stefanbirkner.systemrules}</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <testSourceDirectory>src/test/java</testSourceDirectory>
+    <plugins>
+      <!-- Use mvn dependency:unpack command to unzip ddl files and mvn dependency:copy to copy into destination -->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <version>3.8.1</version>

Review Comment:
   This version must come from `maven-base`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1889319714


##########
packages/kogito-db-migrator-tool-image/README.md:
##########
@@ -0,0 +1,116 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+     http://www.apache.org/licenses/LICENSE-2.0
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+-->
+
+# Kogito Postgres DB Migrator Tool Image
+
+This package contains the `Containerfile/Dockerfile` and scripts to build a container image for Kogito Postgres DB Migrator Tool. Details about the Kogito Postgres DB Migrator Tool can be found [here](../kogito-db-migrator-tool/README.md).
+
+## Additional requirements
+
+- docker
+
+## Build
+
+_NOTE_: Before performing this step, be sure that the Kogito Postgres DB Migrator Tool jar has been built and available for inclusion in the image.
+
+- Enable the image to be built:
+
+  ```bash
+  export KIE_TOOLS_BUILD__buildContainerImages=true
+  ```
+
+Run the following in the root folder of the repository to build the package:
+
+```bash
+pnpm -F @kie-tools/kogito-db-migrator-tool-image... build:prod

Review Comment:
   The null appears when ${revision} variable is not set.
   You can add properties section in pom.xml (of either db-migrator-tool or even maven-base package) as follows
   `  <properties>
       <revision>1.2.3</revision>
     </properties>`
   
   Which will have revision above instead of null, as below:
   `packages/kogito-db-migrator-tool build:prod: [INFO] --- install:3.1.3:install (default-install) @ sonataflow-db-migrator ---
   packages/kogito-db-migrator-tool build:prod: [INFO] Installing /home/ubuntu/flpath-1775/incubator-kie-tools/packages/kogito-db-migrator-tool/.flattened-pom.xml to /home/ubuntu/.m2/repository/org/kie/kogito/sonataflow-db-migrator/1.2.3/sonataflow-db-migrator-1.2.3.pom
   packages/kogito-db-migrator-tool build:prod: [INFO] Installing /home/ubuntu/flpath-1775/incubator-kie-tools/packages/kogito-db-migrator-tool/target/sonataflow-db-migrator-1.2.3.jar to /home/ubuntu/.m2/repository/org/kie/kogito/sonataflow-db-migrator/1.2.3/sonataflow-db-migrator-1.2.3.jar
   packages/kogito-db-migrator-tool build:prod: [INFO] Installing /home/ubuntu/flpath-1775/incubator-kie-tools/packages/kogito-db-migrator-tool/target/sonataflow-db-migrator-1.2.3-sources.jar to /home/ubuntu/.m2/repository/org/kie/kogito/sonataflow-db-migrator/1.2.3/sonataflow-db-migrator-1.2.3-sources.jar
   packages/kogito-db-migrator-tool build:prod: [INFO] Installing /home/ubuntu/flpath-1775/incubator-kie-tools/packages/kogito-db-migrator-tool/target/sonataflow-db-migrator-1.2.3-test-sources.jar to /home/ubuntu/.m2/repository/org/kie/kogito/sonataflow-db-migrator/1.2.3/sonataflow-db-migrator-1.2.3-test-sources.jar
   packages/kogito-db-migrator-tool build:prod: [INFO] ------------------------------------------------------------------------
   packages/kogito-db-migrator-tool build:prod: [INFO] BUILD SUCCESS
   `



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1892480866


##########
packages/kogito-db-migrator-tool/pom.xml:
##########
@@ -31,7 +31,7 @@
 
   <modelVersion>4.0.0</modelVersion>
   <groupId>org.kie.kogito</groupId>
-  <artifactId>sonataflow-db-migrator</artifactId>
+  <artifactId>kogito-db-migrator-tool</artifactId>

Review Comment:
   There is no specific actionable comment here, so marking as resolved. Please let me know if otherwise.



##########
packages/maven-base/pom.xml:
##########
@@ -265,12 +264,6 @@
         <version>${version.org.mockito}</version>
         <scope>test</scope>
       </dependency>
-      <dependency>

Review Comment:
   There is no specific actionable comment here, so marking as resolved. Please let me know if otherwise.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "wmedvede (via GitHub)" <gi...@apache.org>.
wmedvede commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1891844042


##########
packages/kogito-db-migrator-tool-image/package.json:
##########
@@ -0,0 +1,44 @@
+{
+  "private": true,
+  "name": "@kie-tools/kogito-db-migrator-tool-image",
+  "version": "0.0.0",
+  "description": "",
+  "license": "Apache-2.0",
+  "homepage": "https://github.com/apache/incubator-kie-tools",
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/apache/incubator-kie-tools.git"
+  },
+  "bugs": {
+    "url": "https://github.com/apache/incubator-kie-tools/issues"
+  },
+  "scripts": {
+    "build": ". ./node_modules/@kie-tools/python-venv/venv/bin/activate && pnpm copy-assets && pnpm image:build && rimraf build && rimraf target && rimraf dist-tests-e2e",

Review Comment:
   I don't understand why this image has a different pattern in the scripts than for example the Data Index Postgresql one.
   
   Not sure if this different pattern might be related with the issue commented here: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1890155297
   
   But I have seen the following weird pattern:
   See image below, when we build the DI image, I can see that a **build**  directory was generated, and the specified artifacts copied there, etc.
   However, for the migrator image, no **build** directory was generated.
   
   ![Screenshot from 2024-12-19 13-08-53](https://github.com/user-attachments/assets/c4ceef31-a395-44c4-a980-5b059f3c0fac)
   
   



##########
packages/kogito-db-migrator-tool-image/resources/modules/kogito-postgres-db-migration-deps/module.yaml:
##########
@@ -0,0 +1,26 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+schema_version: 1
+name: org.kie.kogito.postgresql.db-migration-deps
+version: "main"
+artifacts:
+  # The following artifact comes from the package kogito-db-migrator-tool during the pnpm build:dev phase
+  - name: sonataflow-db-migrator-quarkus-app

Review Comment:
   I think this now should be named as: **kogito-db-migrator-tool-quarkus-app**



##########
packages/kogito-db-migrator-tool-image/install.js:
##########
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+const { execSync } = require("child_process");
+const fs = require("fs");
+
+const { env } = require("./env");
+const path = require("path");
+const pythonVenvDir = path.dirname(require.resolve("@kie-tools/python-venv/package.json"));
+const sonataflowImageCommonDir = path.dirname(require.resolve("@kie-tools/sonataflow-image-common/package.json"));
+const replaceInFile = require("replace-in-file");
+
+const activateCmd =
+  process.platform === "win32"
+    ? `${pythonVenvDir}\\venv\\Scripts\\Activate.bat`
+    : `. ${pythonVenvDir}/venv/bin/activate`;
+
+execSync(
+  `${activateCmd} && \
+  python3 ${sonataflowImageCommonDir}/resources/scripts/versions_manager.py --bump-to ${env.kogitoDbMigratorToolImage.buildTag} --source-folder ./resources`,
+  { stdio: "inherit" }
+);
+
+// Find and read the -image.yaml file
+const resourcesPath = path.resolve(__dirname, "./resources");
+const files = fs.readdirSync(resourcesPath);
+const imageYamlFiles = files.filter((fileName) => fileName.endsWith("image.yaml"));
+if (imageYamlFiles.length !== 1) {
+  throw new Error("There should only be one image.yaml file on ./resources!");
+}
+const originalYamlPath = path.join(resourcesPath, imageYamlFiles[0]);
+let imageYaml = fs.readFileSync(originalYamlPath, "utf8");
+
+const imageUrl = `${env.kogitoDbMigratorToolImage.registry}/${env.kogitoDbMigratorToolImage.account}/${env.kogitoDbMigratorToolImage.name}`;
+
+// Replace the whole string between quotes ("") with the image name
+imageYaml = imageYaml.replace(/(?<=")(.*incubator-kie-kogito-service-db-migration-postgresql.*)(?=")/gm, imageUrl);

Review Comment:
   This replace should now use: 
   
   imageYaml = imageYaml.replace(/(?<=")(.*kie-kogito-db-migrator-tool.*)(?=")/gm, imageUrl);
   
   to be consistent with the name, and the same usages in other images.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1824551472


##########
packages/kogito-db-migrator-tool/install.js:
##########
@@ -0,0 +1,18 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */

Review Comment:
   Added back.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1878555365


##########
packages/kogito-db-migrator-tool-image/resources/incubator-kie-kogito-db-migrator-tool-image.yaml:
##########
@@ -0,0 +1,49 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+name: "docker.io/apache/incubator-kie-kogito-db-migrator-tool"
+version: "main"
+from: registry.access.redhat.com/ubi8/openjdk-17-runtime:1.20
+description: Flyway image for Data Index and Jobs Service database migration
+
+labels:
+  - name: "org.kie.kogito.version"
+    value: "### SET ME DURING BUILD PROCESS ###"
+  - name: "maintainer"
+    value: "Apache KIE <de...@kie.apache.org>"
+  - name: "io.k8s.description"
+    value: "Kogito DB Migration creates schemas and tables for Data Index and Jobs Service for PostgreSQL database"
+  - name: "io.k8s.display-name"
+    value: "Kogito DB Migration for Data Index and Jobs Service - PostgreSQL"
+  - name: "io.openshift.tags"
+    value: "kogito,db-migration"
+
+modules:
+  repositories:
+    - path: modules
+  install:
+    - name: org.kie.kogito.system.user

Review Comment:
   Added: `- name: org.kie.kogito.project.versions`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "ricardozanini (via GitHub)" <gi...@apache.org>.
ricardozanini commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1876826823


##########
packages/kogito-db-migrator-tool-image/package.json:
##########
@@ -0,0 +1,44 @@
+{
+  "private": true,
+  "name": "@kie-tools/kogito-db-migrator-tool-image",
+  "version": "0.0.0",
+  "description": "",
+  "license": "Apache-2.0",
+  "homepage": "https://github.com/apache/incubator-kie-tools",
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/apache/incubator-kie-tools.git"
+  },
+  "bugs": {
+    "url": "https://github.com/apache/incubator-kie-tools/issues"
+  },
+  "scripts": {
+    "build": ". ./node_modules/@kie-tools/python-venv/venv/bin/activate && pnpm copy-assets && pnpm image:build && rimraf build && rimraf target && rimraf dist-tests-e2e && rimraf resources/modules/kogito-postgres-db-migration-deps/quarkus-app",
+    "build:dev": "run-script-os",
+    "build:dev:linux": "pnpm build",
+    "build:dev:win32:darwin": "echo \"Build skipped on Windows and MacOS\"",
+    "build:prod": "run-script-os",
+    "build:prod:linux": "pnpm build",
+    "build:prod:win32:darwin": "echo \"Build skipped on Windows and MacOS\"",
+    "copy-assets": "run-script-os",
+    "copy-assets:linux:darwin": "rimraf build && cp -R ./node_modules/@kie-tools/sonataflow-image-common/resources build && mkdir -p resources/modules/kogito-postgres-db-migration-deps/quarkus-app && cp -R ./node_modules/@kie-tools/kogito-db-migrator-tool/target/quarkus-app/* resources/modules/kogito-postgres-db-migration-deps/quarkus-app && cp -R resources/* build ",

Review Comment:
   Why are you copying the artifacts to `resources` and not directly to `build`?  We should not modify this directory during build.



##########
packages/kogito-db-migrator-tool-image/resources/modules/kogito-postgres-db-migration-deps/module.yaml:
##########
@@ -0,0 +1,25 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+schema_version: 1
+name: org.kie.kogito.postgresql.db-migration-deps
+version: "main"
+artifacts:
+  - name: sonataflow-db-migrator-quarkus-app

Review Comment:
   Please add a note here saying that this artifact comes from the package `kogito-db-migrator-tool` during the `pnpm build:dev` phase.



##########
packages/kogito-db-migrator-tool-image/resources/incubator-kie-kogito-db-migrator-tool-image.yaml:
##########
@@ -0,0 +1,49 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+name: "docker.io/apache/incubator-kie-kogito-db-migrator-tool"
+version: "main"
+from: registry.access.redhat.com/ubi8/openjdk-17-runtime:1.20
+description: Flyway image for Data Index and Jobs Service database migration
+
+labels:
+  - name: "org.kie.kogito.version"
+    value: "### SET ME DURING BUILD PROCESS ###"
+  - name: "maintainer"
+    value: "Apache KIE <de...@kie.apache.org>"
+  - name: "io.k8s.description"
+    value: "Kogito DB Migration creates schemas and tables for Data Index and Jobs Service for PostgreSQL database"
+  - name: "io.k8s.display-name"
+    value: "Kogito DB Migration for Data Index and Jobs Service - PostgreSQL"
+  - name: "io.openshift.tags"
+    value: "kogito,db-migration"
+
+modules:
+  repositories:
+    - path: modules
+  install:
+    - name: org.kie.kogito.system.user

Review Comment:
   Please also add the "kogito-versions" module. So we will have the `KOGITO_VERSION` and `QUARKUS_PLATFORM_VERSION` in the image env context.



##########
packages/kogito-db-migrator-tool-image/package.json:
##########
@@ -0,0 +1,44 @@
+{
+  "private": true,
+  "name": "@kie-tools/kogito-db-migrator-tool-image",
+  "version": "0.0.0",
+  "description": "",
+  "license": "Apache-2.0",
+  "homepage": "https://github.com/apache/incubator-kie-tools",
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/apache/incubator-kie-tools.git"
+  },
+  "bugs": {
+    "url": "https://github.com/apache/incubator-kie-tools/issues"
+  },
+  "scripts": {
+    "build": ". ./node_modules/@kie-tools/python-venv/venv/bin/activate && pnpm copy-assets && pnpm image:build && rimraf build && rimraf target && rimraf dist-tests-e2e && rimraf resources/modules/kogito-postgres-db-migration-deps/quarkus-app",
+    "build:dev": "run-script-os",
+    "build:dev:linux": "pnpm build",
+    "build:dev:win32:darwin": "echo \"Build skipped on Windows and MacOS\"",
+    "build:prod": "run-script-os",
+    "build:prod:linux": "pnpm build",
+    "build:prod:win32:darwin": "echo \"Build skipped on Windows and MacOS\"",
+    "copy-assets": "run-script-os",
+    "copy-assets:linux:darwin": "rimraf build && cp -R ./node_modules/@kie-tools/sonataflow-image-common/resources build && mkdir -p resources/modules/kogito-postgres-db-migration-deps/quarkus-app && cp -R ./node_modules/@kie-tools/kogito-db-migrator-tool/target/quarkus-app/* resources/modules/kogito-postgres-db-migration-deps/quarkus-app && cp -R resources/* build ",
+    "format": "prettier --write . --ignore-path=../../.prettierignore --ignore-path=../../.gitignore",
+    "image:build": "run-script-os",
+    "image:build:linux": "pnpm setup:env && cekit --descriptor build/incubator-kie-kogito-db-migrator-tool-image.yaml -v build docker",
+    "image:build:win32:darwin": "echo \"Build skipped on Windows and MacOS\"",
+    "install": "node install.js && pnpm format",
+    "setup:env": ". ./node_modules/@kie-tools/python-venv/venv/bin/activate && cross-env KOGITO_IMAGE_REGISTRY=$(build-env kogitoDbMigratorToolImage.registry) KOGITO_IMAGE_REGISTRY_ACCOUNT=$(build-env kogitoDbMigratorToolImage.account) KOGITO_IMAGE_NAME=$(build-env kogitoDbMigratorToolImage.name) KOGITO_IMAGE_TAG=$(build-env kogitoDbMigratorToolImage.buildTag) QUARKUS_PLATFORM_VERSION=$(build-env versions.quarkus) KOGITO_VERSION=$(build-env versions.kogito)"

Review Comment:
   This action does nothing if we don't use the Makefile from the common package.



##########
packages/kogito-db-migrator-tool-image/package.json:
##########
@@ -0,0 +1,44 @@
+{
+  "private": true,
+  "name": "@kie-tools/kogito-db-migrator-tool-image",
+  "version": "0.0.0",
+  "description": "",
+  "license": "Apache-2.0",
+  "homepage": "https://github.com/apache/incubator-kie-tools",
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/apache/incubator-kie-tools.git"
+  },
+  "bugs": {
+    "url": "https://github.com/apache/incubator-kie-tools/issues"
+  },
+  "scripts": {
+    "build": ". ./node_modules/@kie-tools/python-venv/venv/bin/activate && pnpm copy-assets && pnpm image:build && rimraf build && rimraf target && rimraf dist-tests-e2e && rimraf resources/modules/kogito-postgres-db-migration-deps/quarkus-app",
+    "build:dev": "run-script-os",
+    "build:dev:linux": "pnpm build",
+    "build:dev:win32:darwin": "echo \"Build skipped on Windows and MacOS\"",
+    "build:prod": "run-script-os",
+    "build:prod:linux": "pnpm build",
+    "build:prod:win32:darwin": "echo \"Build skipped on Windows and MacOS\"",
+    "copy-assets": "run-script-os",
+    "copy-assets:linux:darwin": "rimraf build && cp -R ./node_modules/@kie-tools/sonataflow-image-common/resources build && mkdir -p resources/modules/kogito-postgres-db-migration-deps/quarkus-app && cp -R ./node_modules/@kie-tools/kogito-db-migrator-tool/target/quarkus-app/* resources/modules/kogito-postgres-db-migration-deps/quarkus-app && cp -R resources/* build ",
+    "format": "prettier --write . --ignore-path=../../.prettierignore --ignore-path=../../.gitignore",
+    "image:build": "run-script-os",
+    "image:build:linux": "pnpm setup:env && cekit --descriptor build/incubator-kie-kogito-db-migrator-tool-image.yaml -v build docker",

Review Comment:
   Why not use our `sonataflow-common-image` Makefile?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1878749180


##########
packages/kogito-db-migrator-tool-image/package.json:
##########
@@ -0,0 +1,44 @@
+{
+  "private": true,
+  "name": "@kie-tools/kogito-db-migrator-tool-image",
+  "version": "0.0.0",
+  "description": "",
+  "license": "Apache-2.0",
+  "homepage": "https://github.com/apache/incubator-kie-tools",
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/apache/incubator-kie-tools.git"
+  },
+  "bugs": {
+    "url": "https://github.com/apache/incubator-kie-tools/issues"
+  },
+  "scripts": {
+    "build": ". ./node_modules/@kie-tools/python-venv/venv/bin/activate && pnpm copy-assets && pnpm image:build && rimraf build && rimraf target && rimraf dist-tests-e2e && rimraf resources/modules/kogito-postgres-db-migration-deps/quarkus-app",
+    "build:dev": "run-script-os",
+    "build:dev:linux": "pnpm build",
+    "build:dev:win32:darwin": "echo \"Build skipped on Windows and MacOS\"",
+    "build:prod": "run-script-os",
+    "build:prod:linux": "pnpm build",
+    "build:prod:win32:darwin": "echo \"Build skipped on Windows and MacOS\"",
+    "copy-assets": "run-script-os",
+    "copy-assets:linux:darwin": "rimraf build && cp -R ./node_modules/@kie-tools/sonataflow-image-common/resources build && mkdir -p resources/modules/kogito-postgres-db-migration-deps/quarkus-app && cp -R ./node_modules/@kie-tools/kogito-db-migrator-tool/target/quarkus-app/* resources/modules/kogito-postgres-db-migration-deps/quarkus-app && cp -R resources/* build ",
+    "format": "prettier --write . --ignore-path=../../.prettierignore --ignore-path=../../.gitignore",
+    "image:build": "run-script-os",
+    "image:build:linux": "pnpm setup:env && cekit --descriptor build/incubator-kie-kogito-db-migrator-tool-image.yaml -v build docker",
+    "image:build:win32:darwin": "echo \"Build skipped on Windows and MacOS\"",
+    "install": "node install.js && pnpm format",
+    "setup:env": ". ./node_modules/@kie-tools/python-venv/venv/bin/activate && cross-env KOGITO_IMAGE_REGISTRY=$(build-env kogitoDbMigratorToolImage.registry) KOGITO_IMAGE_REGISTRY_ACCOUNT=$(build-env kogitoDbMigratorToolImage.account) KOGITO_IMAGE_NAME=$(build-env kogitoDbMigratorToolImage.name) KOGITO_IMAGE_TAG=$(build-env kogitoDbMigratorToolImage.buildTag) QUARKUS_PLATFORM_VERSION=$(build-env versions.quarkus) KOGITO_VERSION=$(build-env versions.kogito)"

Review Comment:
   Now we are using the sonataflow-image-common's make file.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "ricardozanini (via GitHub)" <gi...@apache.org>.
ricardozanini commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1822704355


##########
packages/kogito-db-migrator-tool-image/install.js:
##########
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+const { execSync } = require("child_process");
+const fs = require("fs");
+
+const { env } = require("./env");
+const path = require("path");
+const pythonVenvDir = path.dirname(require.resolve("@kie-tools/python-venv/package.json"));
+const sonataflowImageCommonDir = path.dirname(require.resolve("@kie-tools/sonataflow-image-common/package.json"));
+const replaceInFile = require("replace-in-file");
+
+const activateCmd =
+  process.platform === "win32"
+    ? `${pythonVenvDir}\\venv\\Scripts\\Activate.bat`
+    : `. ${pythonVenvDir}/venv/bin/activate`;
+
+execSync(
+  `${activateCmd} && \
+  python3 ${sonataflowImageCommonDir}/resources/scripts/versions_manager.py --bump-to ${env.kogitoDbMigratorToolImage.buildTag} --source-folder ./resources`,
+  { stdio: "inherit" }
+);
+
+// Find and read the -image.yaml file
+const resourcesPath = path.resolve(__dirname, "./resources");
+const files = fs.readdirSync(resourcesPath);
+const imageYamlFiles = files.filter((fileName) => fileName.endsWith("image.yaml"));
+if (imageYamlFiles.length !== 1) {
+  throw new Error("There should only be one image.yaml file on ./resources!");
+}
+const originalYamlPath = path.join(resourcesPath, imageYamlFiles[0]);
+let imageYaml = fs.readFileSync(originalYamlPath, "utf8");
+
+const imageUrl = `${env.kogitoDbMigratorToolImage.registry}/${env.kogitoDbMigratorToolImage.account}/${env.kogitoDbMigratorToolImage.name}`;
+
+// Replace the whole string between quotes ("") with the image name
+imageYaml = imageYaml.replace(/(?<=")(.*incubator-kie-kogito-service-db-migration-postgresql.*)(?=")/gm, imageUrl);

Review Comment:
   @tiagobento this is renaming the images correctly. 
   @rhkp, forget about my other comment; the install.js  in the image seems fine.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1823368234


##########
packages/kogito-db-migrator-tool-image/resources/kogito-db-migrator-tool-image.yaml:
##########
@@ -0,0 +1,49 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+name: "docker.io/apache/kogito-db-migrator-tool"
+version: "main"

Review Comment:
   Yes, we are making use of `index.js` to set env vars for image attribs and `install.js`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1814997354


##########
packages/kogito-db-migrator-tool-image/build-container-image.sh:
##########
@@ -0,0 +1,40 @@
+#!/bin/sh
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+set -x
+set -e
+
+CEKIT_BUILDER=docker
+SOURCE_FILE=/tmp/kogito-db-migrator-tool/sonataflow-db-migrator-0.0.0-runner.jar
+TARGET_FILE=./cekit/modules/kogito-postgres-db-migration-deps/sonataflow-db-migrator-runner.jar
+
+if [ -f "$SOURCE_FILE" ]; then
+   echo "The file: $SOURCE_FILE found and will be used to build image."
+   rm -f $TARGET_FILE
+   cp $SOURCE_FILE $TARGET_FILE
+
+   # Build the container image
+   cd ./cekit || exit
+   cekit -v build "$CEKIT_BUILDER"
+   rm -f $TARGET_FILE
+else
+   echo "The file: $SOURCE_FILE not found. Please build kogito-db-migrator-tool package first before building the image."
+   exit 1
+fi

Review Comment:
   Hey @ricardozanini, Are you referring to `package.json`? 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1924310948


##########
packages/sonataflow-image-common/resources/scripts/build-kogito-apps-components.sh:
##########
@@ -56,6 +56,9 @@ if [ ! -z "${CYPRESS_BINARY_URL}" ]; then
 fi
 
 case ${imageName} in
+    "incubator-kie-kogito-db-migrator-tool")
+        contextDir="db-migrator-tool/image"
+        ;;

Review Comment:
   @ricardozanini @tiagobento 
   
   - The initial/original implementation was independent of `sonataflow-image-common`. 
   - However on Dec 09, 2024 based on this [comment](https://github.com/apache/incubator-kie-tools/pull/2697?new_mergebox=false#discussion_r1876832455) by @ricardozanini we started using sonataflow-image-common.
   - Thus sonataflow-image-common package is vital for the current implementation and we cannot remove this file.
   
   Please advise.
   
   PS: If I understand it right other images are making use of this too and we are in-line with established practice?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "tiagobento (via GitHub)" <gi...@apache.org>.
tiagobento commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1917107876


##########
packages/sonataflow-image-common/resources/scripts/build-kogito-apps-components.sh:
##########
@@ -56,6 +56,9 @@ if [ ! -z "${CYPRESS_BINARY_URL}" ]; then
 fi
 
 case ${imageName} in
+    "incubator-kie-kogito-db-migrator-tool")
+        contextDir="db-migrator-tool/image"
+        ;;

Review Comment:
   Do we still need this? I thought this file was only used when we still had the build happening inside the images @ricardozanini 



##########
packages/kogito-db-migrator-tool/README.md:
##########
@@ -0,0 +1,31 @@
+# Kogito Postgres DB Migrator Tool

Review Comment:
   Postgres mentioned here but not in the package name. Why is that please?



##########
packages/kogito-db-migrator-tool/env/index.js:
##########
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+const { varsWithName, composeEnv } = require("@kie-tools-scripts/build-env");
+
+module.exports = composeEnv([require("@kie-tools/root-env/env"), require("@kie-tools/maven-base/env")], {
+  vars: varsWithName({}),
+  get env() {
+    return {
+      kogitoDBMigratorTool: {

Review Comment:
   ```suggestion
         kogitoDbMigratorTool: {
   ```



##########
packages/maven-base/pom.xml:
##########
@@ -408,6 +409,25 @@
           </execution>
         </executions>
       </plugin>
+      <plugin>
+        <groupId>org.jacoco</groupId>
+        <artifactId>jacoco-maven-plugin</artifactId>
+        <version> ${version.jacoco.maven.plugin} </version>
+        <executions>
+          <execution>
+            <goals>
+              <goal>prepare-agent</goal>
+            </goals>
+          </execution>
+          <execution>
+            <id>report</id>
+            <phase>prepare-package</phase>
+            <goals>
+              <goal>report</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>

Review Comment:
   Configuring this here will enable this plugin for all Maven-based packages of `kie-tools`. I guess we need to move this under `<pluginManagement>` and configure its execution only in the packages that want to execute it as part of its build.



##########
packages/kogito-db-migrator-tool-image/README.md:
##########
@@ -0,0 +1,116 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+     http://www.apache.org/licenses/LICENSE-2.0
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+-->
+
+# Kogito Postgres DB Migrator Tool Image
+
+This package contains the `Containerfile/Dockerfile` and scripts to build a container image for Kogito Postgres DB Migrator Tool. Details about the Kogito Postgres DB Migrator Tool can be found [here](../kogito-db-migrator-tool/README.md)
+
+## Additional requirements
+
+- docker
+
+## Build
+
+_NOTE_: Before performing this step, be sure that the Kogito Postgres DB Migrator Tool jar has been built and available for inclusion in the image.
+
+- Enable the image to be built:
+
+  ```bash
+  export KIE_TOOLS_BUILD__buildContainerImages=true
+  ```
+
+Run the following in the root folder of the repository to build the package:
+
+```bash
+pnpm -F @kie-tools/kogito-db-migrator-tool-image... build:prod
+```
+
+- Then check if the image is correctly stored:
+
+  ```bash
+  docker images
+  ```
+
+## Run
+
+- Start up a clean container with:
+
+  ```bash
+    docker run docker.io/apache/incubator-kie-kogito-service-db-migration-postgresql:latest

Review Comment:
   `latest` is not the correct tag version here. It should be `main`.



##########
packages/kogito-db-migrator-tool-image/resources/incubator-kie-kogito-db-migrator-tool-image.yaml:
##########
@@ -0,0 +1,50 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+name: "docker.io/apache/incubator-kie-kogito-db-migrator-tool"
+version: "main"
+from: registry.access.redhat.com/ubi8/openjdk-17-runtime:1.20
+description: DBMigratorTool image for Data Index and Jobs Service database migration
+
+labels:
+  - name: "org.kie.kogito.version"
+    value: "### SET ME DURING BUILD PROCESS ###"
+  - name: "maintainer"
+    value: "Apache KIE <de...@kie.apache.org>"
+  - name: "io.k8s.description"
+    value: "Kogito DB Migration creates schemas and tables for Data Index and Jobs Service for PostgreSQL database"
+  - name: "io.k8s.display-name"
+    value: "Kogito DB Migration for Data Index and Jobs Service - PostgreSQL"

Review Comment:
   ```suggestion
       value: "Kogito DB Migration Tool for Data Index and Jobs Service - PostgreSQL"
   ```



##########
packages/kogito-db-migrator-tool-image/README.md:
##########
@@ -0,0 +1,116 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+     http://www.apache.org/licenses/LICENSE-2.0
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+-->
+

Review Comment:
   Please focus the README on describing and using, leaving build instructions at the end. README files are targeted towards consumers, not developers.



##########
.gitignore:
##########
@@ -347,6 +347,7 @@ turbo.json
 packages/*/.idea
 examples/*/.idea
 
-
+# Jar files
+**/*.jar

Review Comment:
   If this is specific to the new package, please use its .gitignore for adding this rule.



##########
packages/kogito-db-migrator-tool/README.md:
##########
@@ -0,0 +1,31 @@
+# Kogito Postgres DB Migrator Tool
+
+This is a Java, Quarkus-based PostgreSQL database migrator application for Data-Index and Jobs Service applications for use by SonataFlow Operator.
+
+_NOTE_: This postgres database migrator application and its corresponding images are only envisaged to be made use of by SonataFlow Operator, Data Index and Jobs Service internally. Conversely this application is of no use outside the usecases involved with SonataFlow Operator, Data Index and Jobs Service applications.

Review Comment:
   Same here.. Postgres is mentioned.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1813399721


##########
packages/kogito-db-migrator-tool/install.js:
##########
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+const { env } = require("./env");
+const { setupMavenConfigFile, installMvnw, buildTailFromPackageJsonDependencies } = require("@kie-tools/maven-base");
+
+setupMavenConfigFile(
+  `
+    --batch-mode
+    -Dstyle.color=always
+    -Drevision=${env.devDeploymentQuarkusApp.version}
+    -Dversion.quarkus=${env.versions.quarkus}
+    -Dversion.org.kie.kogito=${env.versions.kogito}

Review Comment:
   @ricardozanini as conveyed by @tiagobento , as these vars are coming from `maven-base`, I am resolving this. Please feel free to un-resolve if needed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1811348569


##########
packages/kogito-db-migrator-tool/src/main/cekit/modules/kogito-postgres-db-migration-deps/install:
##########
@@ -0,0 +1,32 @@
+#!/bin/sh
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+set -x
+set -e
+
+useradd -m kogito

Review Comment:
   Not applicable as the cekit build is not relevant in this package and is now removed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1811348569


##########
packages/kogito-db-migrator-tool/src/main/cekit/modules/kogito-postgres-db-migration-deps/install:
##########
@@ -0,0 +1,32 @@
+#!/bin/sh
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+set -x
+set -e
+
+useradd -m kogito

Review Comment:
   Not applicable as the cekit build is not relevant in this package.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "ricardozanini (via GitHub)" <gi...@apache.org>.
ricardozanini commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1821364830


##########
packages/kogito-db-migrator-tool/pom.xml:
##########
@@ -0,0 +1,165 @@
+<?xml version="1.0" ?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+-->
+<project
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
+  xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+>
+  <parent>
+    <groupId>org.kie</groupId>
+    <artifactId>kie-tools-maven-base</artifactId>
+    <version>${revision}</version>
+    <relativePath>./node_modules/@kie-tools/maven-base/pom.xml</relativePath>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.kie.kogito</groupId>
+  <artifactId>sonataflow-db-migrator</artifactId>
+
+  <dependencies>
+    <dependency>
+      <groupId>io.quarkus</groupId>
+      <artifactId>quarkus-flyway</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.quarkus</groupId>
+      <artifactId>quarkus-jdbc-postgresql</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.quarkus</groupId>
+      <artifactId>quarkus-arc</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>io.quarkus</groupId>
+      <artifactId>quarkus-junit5</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-junit-jupiter</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.mockito</groupId>
+      <artifactId>mockito-core</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>com.github.stefanbirkner</groupId>
+      <artifactId>system-rules</artifactId>
+      <version>${version.com.github.stefanbirkner.systemrules}</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <testSourceDirectory>src/test/java</testSourceDirectory>
+    <plugins>
+      <!-- Use mvn dependency:unpack command to unzip ddl files and mvn dependency:copy to copy into destination -->
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <version>3.8.1</version>
+        <configuration>
+          <artifactItems>
+            <artifactItem>
+              <groupId>org.kie.kogito</groupId>
+              <artifactId>kogito-ddl</artifactId>
+              <version>10.0.999-SNAPSHOT</version>

Review Comment:
   @rhkp yes, that must come from the maven-base pom.xml



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1823268005


##########
packages/kogito-db-migrator-tool/install.js:
##########
@@ -0,0 +1,18 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */

Review Comment:
   Okay noted. Resolving this one.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "tiagobento (via GitHub)" <gi...@apache.org>.
tiagobento commented on PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#issuecomment-2443119638

   @rhkp Not sure this is WIP, but having these new env vars on `root-env` is not really the way to go. Can you please share your reasoning? Not sure if there are things missing on MANUAL.md that could help. Thanks!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1821444258


##########
packages/kogito-db-migrator-tool-image/resources/build-container-image.sh:
##########
@@ -0,0 +1,35 @@
+#!/bin/sh
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+set -x
+set -e
+
+CEKIT_BUILDER=docker
+SOURCE_FILE=/tmp/kogito-db-migrator-tool/sonataflow-db-migrator-0.0.0-runner.jar

Review Comment:
   @tiagobento The DB Migrator Jar built by package DB Migrator is placed in /tmp directory which is later used by DB Migrator Image to build image.
   Not sure if DB Migrator can build jar and place directly in DB Migrator Image directory? If yes, the /tmp directory can be avoided. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "tiagobento (via GitHub)" <gi...@apache.org>.
tiagobento commented on PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#issuecomment-2590548172

   Will take a look during this week.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "wmedvede (via GitHub)" <gi...@apache.org>.
wmedvede commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1893871189


##########
packages/kogito-db-migrator-tool-image/README.md:
##########
@@ -0,0 +1,116 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+     http://www.apache.org/licenses/LICENSE-2.0
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+-->
+
+# Kogito Postgres DB Migrator Tool Image
+
+This package contains the `Containerfile/Dockerfile` and scripts to build a container image for Kogito Postgres DB Migrator Tool. Details about the Kogito Postgres DB Migrator Tool can be found [here](../kogito-db-migrator-tool/README.md).
+
+## Additional requirements
+
+- docker
+
+## Build
+
+_NOTE_: Before performing this step, be sure that the Kogito Postgres DB Migrator Tool jar has been built and available for inclusion in the image.
+
+- Enable the image to be built:
+
+  ```bash
+  export KIE_TOOLS_BUILD__buildContainerImages=true
+  ```
+
+Run the following in the root folder of the repository to build the package:
+
+```bash
+pnpm -F @kie-tools/kogito-db-migrator-tool-image... build:prod
+```
+
+- Then check if the image is correctly stored:
+
+  ```bash
+  docker images
+  ```
+
+## Run
+
+- Start up a clean container with:
+
+  ```bash
+    docker run docker.io/apache/incubator-kie-kogito-service-db-migration-postgresql:latest

Review Comment:
   > Hi @wmedvede and @ricardozanini, I spent more time on this one.
   > 
   > **EXECUTE DB MIGRATOR JAVA JAR IN TERMINAL(WITHOUT IMAGE I MEAN)**
   > 
   > * The execution of the DB migrator with `java -jar target/quarkus-app/quarkus-run.jar` gives identical results whether the export QUARKUS_PLATFORM_VERSION=3.8.6 variable is set or not.
   > * Meaning in any of the situation above I am not seeing 999-SNAPSHOTS log.
   > * Please note the WARN message for 999-SNAPSHOT comes from `[io.qua.run.con.ConfigRecorder]` package, when we are using image and I do not at all see this package in the logs in these scenarios.
   > 
   > **COMPARE DB MIGRATOR IMAGE build FOLDERS**
   > 
   > * I compared TWO directories one built with env vars set and another without setting one.
   > * The files are identical in this case too.
   > * And not sure where the 999-SNAPSHOT appears from in the logs when the image is built without setting export QUARKUS_PLATFORM_VERSION=3.8.6.
   
   I have built again locally and executed both scenarios:
   
   **java -jar target/quarkus-app/quarkus-run.jar:** 
   
   **Produce NO Warnings:**
   
   see full execution log here: https://gist.github.com/wmedvede/b3631a99b041bd66afdda5e9cb3120b1
   
    --/ __ \/ / / / _ | / _ \/ //_/ / / / __/ 
    -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \   
   --\___\_\____/_/ |_/_/|_/_/|_|\____/___/   
   2024-12-20 13:03:31,609 INFO  [io.quarkus] (main) kogito-db-migrator-tool 0.0.0 on JVM (powered by Quarkus 3.8.6) started in 0.469s. 
   2024-12-20 13:03:31,615 INFO  [io.quarkus] (main) Profile prod activated. 
   2024-12-20 13:03:31,615 INFO  [io.quarkus] (main) Installed features: [agroal, cdi, flyway, jdbc-postgresql, narayana-jta, smallrye-context-propagation]
   2024-12-20 13:03:31,626 INFO  [org.kie.kog.pos.mig.DBConnectionChecker] (main) Checking DB connection: jdbc:postgresql://localhost:5432/data-index - success
   
   
   **Image execution:**  **docker run  docker.io/apache/incubator-kie-kogito-db-migrator-tool:main bla bla**
   
   **Produce warnings**
   
   see full execution log here: https://gist.github.com/wmedvede/f7ad4a7ca9df7201438ab053b96dd38b
   
   __  ____  __  _____   ___  __ ____  ______ 
    --/ __ \/ / / / _ | / _ \/ //_/ / / / __/ 
    -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \   
   --\___\_\____/_/ |_/_/|_/_/|_|\____/___/   
   **2024-12-20 12:07:29,367 WARN  [io.qua.run.con.ConfigRecorder] (main) Build time property cannot be changed at runtime:
    - quarkus.platform.version is set to '3.8.6' but it is build time fixed to '999-SNAPSHOT'. Did you change the property** quarkus.platform.version after building the application?
   2024-12-20 12:07:29,599 INFO  [io.quarkus] (main) kogito-db-migrator-tool 0.0.0 on JVM (powered by Quarkus 3.8.6) started in 0.476s. 
   
   
   
   @rhkp @ricardozanini I conclude that the issue is introduced during the image build process, while the quarkus-run.jar is fine. Apart of doing the review, I have spent some time trying to see where issue comes from, but couldn't find.
   
   Maybe someone else with fresh eyes can take a look and identify, I think it should be a silly nitpick.
   
   @rgdoliveira @domhanak or maybe @fantonangeli , would you mind guys take look?
    
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "wmedvede (via GitHub)" <gi...@apache.org>.
wmedvede commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1893871189


##########
packages/kogito-db-migrator-tool-image/README.md:
##########
@@ -0,0 +1,116 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+     http://www.apache.org/licenses/LICENSE-2.0
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+-->
+
+# Kogito Postgres DB Migrator Tool Image
+
+This package contains the `Containerfile/Dockerfile` and scripts to build a container image for Kogito Postgres DB Migrator Tool. Details about the Kogito Postgres DB Migrator Tool can be found [here](../kogito-db-migrator-tool/README.md).
+
+## Additional requirements
+
+- docker
+
+## Build
+
+_NOTE_: Before performing this step, be sure that the Kogito Postgres DB Migrator Tool jar has been built and available for inclusion in the image.
+
+- Enable the image to be built:
+
+  ```bash
+  export KIE_TOOLS_BUILD__buildContainerImages=true
+  ```
+
+Run the following in the root folder of the repository to build the package:
+
+```bash
+pnpm -F @kie-tools/kogito-db-migrator-tool-image... build:prod
+```
+
+- Then check if the image is correctly stored:
+
+  ```bash
+  docker images
+  ```
+
+## Run
+
+- Start up a clean container with:
+
+  ```bash
+    docker run docker.io/apache/incubator-kie-kogito-service-db-migration-postgresql:latest

Review Comment:
   > Hi @wmedvede and @ricardozanini, I spent more time on this one.
   > 
   > **EXECUTE DB MIGRATOR JAVA JAR IN TERMINAL(WITHOUT IMAGE I MEAN)**
   > 
   > * The execution of the DB migrator with `java -jar target/quarkus-app/quarkus-run.jar` gives identical results whether the export QUARKUS_PLATFORM_VERSION=3.8.6 variable is set or not.
   > * Meaning in any of the situation above I am not seeing 999-SNAPSHOTS log.
   > * Please note the WARN message for 999-SNAPSHOT comes from `[io.qua.run.con.ConfigRecorder]` package, when we are using image and I do not at all see this package in the logs in these scenarios.
   > 
   > **COMPARE DB MIGRATOR IMAGE build FOLDERS**
   > 
   > * I compared TWO directories one built with env vars set and another without setting one.
   > * The files are identical in this case too.
   > * And not sure where the 999-SNAPSHOT appears from in the logs when the image is built without setting export QUARKUS_PLATFORM_VERSION=3.8.6.
   
   I have built again locally and executed both scenarios:
   
   **java -jar target/quarkus-app/quarkus-run.jar:** 
   
   **Produce NO Warnings:**
   
   see full execution log here: https://gist.github.com/wmedvede/b3631a99b041bd66afdda5e9cb3120b1
   
    --/ __ \/ / / / _ | / _ \/ //_/ / / / __/ 
    -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \   
   --\___\_\____/_/ |_/_/|_/_/|_|\____/___/   
   2024-12-20 13:03:31,609 INFO  [io.quarkus] (main) kogito-db-migrator-tool 0.0.0 on JVM (powered by Quarkus 3.8.6) started in 0.469s. 
   2024-12-20 13:03:31,615 INFO  [io.quarkus] (main) Profile prod activated. 
   2024-12-20 13:03:31,615 INFO  [io.quarkus] (main) Installed features: [agroal, cdi, flyway, jdbc-postgresql, narayana-jta, smallrye-context-propagation]
   2024-12-20 13:03:31,626 INFO  [org.kie.kog.pos.mig.DBConnectionChecker] (main) Checking DB connection: jdbc:postgresql://localhost:5432/data-index - success
   
   
   **Image execution:**  **docker run  docker.io/apache/incubator-kie-kogito-db-migrator-tool:main bla bla**
   
   **Produce warnings**
   
   see full execution log here: https://gist.github.com/wmedvede/f7ad4a7ca9df7201438ab053b96dd38b
   
   __  ____  __  _____   ___  __ ____  ______ 
    --/ __ \/ / / / _ | / _ \/ //_/ / / / __/ 
    -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \   
   --\___\_\____/_/ |_/_/|_/_/|_|\____/___/   
   2024-12-20 12:07:29,367 WARN  [io.qua.run.con.ConfigRecorder] (main) Build time property cannot be changed at runtime:
    - **quarkus.platform.version is set to '3.8.6' but it is build time fixed to '999-SNAPSHOT'. Did you change the property quarkus.platform.version after building the application?**
   2024-12-20 12:07:29,599 INFO  [io.quarkus] (main) kogito-db-migrator-tool 0.0.0 on JVM (powered by Quarkus 3.8.6) started in 0.476s. 
   
   
   
   @rhkp @ricardozanini I conclude that the issue is introduced during the image build process, while the quarkus-run.jar is fine. Apart of doing the review, I have spent some time trying to see where issue comes from, but couldn't find.
   
   Maybe someone else with fresh eyes can take a look and identify, I think it should be a silly nitpick.
   
   @rgdoliveira @domhanak or maybe @fantonangeli , would you mind guys take look?
    
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "wmedvede (via GitHub)" <gi...@apache.org>.
wmedvede commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1890155297


##########
packages/kogito-db-migrator-tool-image/README.md:
##########
@@ -0,0 +1,116 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+     http://www.apache.org/licenses/LICENSE-2.0
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+-->
+
+# Kogito Postgres DB Migrator Tool Image
+
+This package contains the `Containerfile/Dockerfile` and scripts to build a container image for Kogito Postgres DB Migrator Tool. Details about the Kogito Postgres DB Migrator Tool can be found [here](../kogito-db-migrator-tool/README.md).
+
+## Additional requirements
+
+- docker
+
+## Build
+
+_NOTE_: Before performing this step, be sure that the Kogito Postgres DB Migrator Tool jar has been built and available for inclusion in the image.
+
+- Enable the image to be built:
+
+  ```bash
+  export KIE_TOOLS_BUILD__buildContainerImages=true
+  ```
+
+Run the following in the root folder of the repository to build the package:
+
+```bash
+pnpm -F @kie-tools/kogito-db-migrator-tool-image... build:prod
+```
+
+- Then check if the image is correctly stored:
+
+  ```bash
+  docker images
+  ```
+
+## Run
+
+- Start up a clean container with:
+
+  ```bash
+    docker run docker.io/apache/incubator-kie-kogito-service-db-migration-postgresql:latest

Review Comment:
   I took the latest commits
   I have deleted previous image
   I have re-build this image
   
   I can still see:
   
   2024-12-18 11:39:32,878 WARN  [io.qua.run.con.ConfigRecorder] (main) Build time property cannot be changed at runtime:
    - **quarkus.platform.version is set to '3.8.6' but it is build time fixed to '999-SNAPSHOT'. Did you change the property quarkus.platform.version after building the application?**
   
   https://gist.github.com/wmedvede/aff0a7afa3ed948bce894fdc6e9f5854
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "wmedvede (via GitHub)" <gi...@apache.org>.
wmedvede commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1891336864


##########
packages/maven-base/pom.xml:
##########
@@ -265,12 +264,6 @@
         <version>${version.org.mockito}</version>
         <scope>test</scope>
       </dependency>
-      <dependency>

Review Comment:
   :+1: 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "ricardozanini (via GitHub)" <gi...@apache.org>.
ricardozanini merged PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "ricardozanini (via GitHub)" <gi...@apache.org>.
ricardozanini commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1858777920


##########
.gitignore:
##########
@@ -346,3 +346,7 @@ turbo.json
 # IntelliJ projects should be on _intellij-projects folder, never on specific packages.
 packages/*/.idea
 examples/*/.idea
+
+# kogito-db-migrator-tool
+packages/kogito-db-migrator-tool/src/main/resources/postgresql
+packages/kogito-db-migrator-tool/src/main/resources/ansi

Review Comment:
   @tiagobento that problem regarding gitignore per package is solved, right? So can we move this to `packages/kogito-db-migrator-tool`?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "wmedvede (via GitHub)" <gi...@apache.org>.
wmedvede commented on PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#issuecomment-2606628608

   > I think in this `wave` of implementation we are focussing on `postgreSQL` so I would suggest to keep it that way:
   
   I'd personally prefer to keep the package names `kogito-db-migrator-tool` and `kogito-db-migrator-tool-image`, considering that as commented before, this work is very close to be a multi db migrator. Potential DB candidate to add in the short term could be H2, see: https://github.com/apache/incubator-kie-kogito-apps/blob/538f33c4a6a6e9c564cd172b32d7632cd792b1a0/data-index/data-index-storage/data-index-storage-jpa/src/test/resources/application.properties
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1924310948


##########
packages/sonataflow-image-common/resources/scripts/build-kogito-apps-components.sh:
##########
@@ -56,6 +56,9 @@ if [ ! -z "${CYPRESS_BINARY_URL}" ]; then
 fi
 
 case ${imageName} in
+    "incubator-kie-kogito-db-migrator-tool")
+        contextDir="db-migrator-tool/image"
+        ;;

Review Comment:
   @ricardozanini @tiagobento 
   
   - The initial/original implementation was independent of `sonataflow-image-common`. However on Dec 09, 2024 based on this [comment](https://github.com/apache/incubator-kie-tools/pull/2697?new_mergebox=false#discussion_r1876832455) by @ricardozanini we started using sonataflow-image-common.
   - Thus sonataflow-image-common package is vital for the current implementation and we cannot remove this file.
   
   Please advise.
   
   PS: If I understand it right other images are making use of this too and we are in-line with other established practice?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1823256866


##########
packages/kogito-db-migrator-tool/package.json:
##########
@@ -0,0 +1,38 @@
+{
+  "private": true,
+  "name": "@kie-tools/kogito-db-migrator-tool",
+  "version": "0.0.0",
+  "description": "",
+  "license": "Apache-2.0",
+  "homepage": "https://github.com/apache/incubator-kie-tools",
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/apache/incubator-kie-tools.git"
+  },
+  "bugs": {
+    "url": "https://github.com/apache/incubator-kie-tools/issues"
+  },
+  "scripts": {
+    "build:dev": "pnpm pre-build && mvn clean install -DskipTests -Dquarkus.package.type=uber-jar && pnpm drop-jar && pnpm cleanup-ddl-dirs",
+    "build:prod": "pnpm pre-build && mvn clean install -DskipTests=$(build-env tests.run --not) -Dmaven.test.failure.ignore=$(build-env tests.ignoreFailures) -Dquarkus.package.type=uber-jar && pnpm drop-jar && pnpm cleanup-ddl-dirs",
+    "cleanup": "pnpm cleanup-drop-jar && pnpm cleanup-ddl-dirs",
+    "cleanup-ddl-dirs": "rimraf src/main/resources/ansi && rimraf src/main/resources/postgresql",
+    "cleanup-drop-jar": "rimraf /tmp/kogito-db-migrator-tool/ && mkdir -p /tmp/kogito-db-migrator-tool",
+    "drop-jar": "cp target/sonataflow-db-migrator-0.0.0-runner.jar /tmp/kogito-db-migrator-tool",

Review Comment:
   As conveyed by @ricardozanini we are now using target directory instead of /tmp directory.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1817162158


##########
packages/kogito-db-migrator-tool/env/index.js:
##########
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+const { varsWithName, composeEnv, getOrDefault } = require("@kie-tools-scripts/build-env");
+
+module.exports = composeEnv([require("@kie-tools/root-env/env")], {
+  vars: varsWithName({
+    KOGITO_DB_MIGRATOR_TOOL__ddl_version: {
+      default: "10.0.999-SNAPSHOT",
+      description: "The version to use for ddl.",
+    },
+    KOGITO_DB_MIGRATOR_TOOL__ddl_file_name: {
+      default: "kogito-ddl-10.0.999-20241018.012042-73-db-scripts.zip",
+      description: "The file name for ddl.",
+    },
+    KOGITO_DB_MIGRATOR_TOOL__ddl_base_url: {
+      default: "https://repository.apache.org/content/groups/snapshots/org/kie/kogito/kogito-ddl",
+      description: "The url from where the ddl file will be downloaded.",
+    },

Review Comment:
   Hey @tiagobento @ricardozanini ,
   I have implemented this based on comment by @ricardozanini [here](https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1811294321).
   What is it that we need? Keep this or roll-back to earlier version?
   Both of you please decide and advise.
   Thanks.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1817405420


##########
packages/kogito-db-migrator-tool/pom.xml:
##########
@@ -0,0 +1,200 @@
+<?xml version="1.0" ?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+-->
+<project
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
+  xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+>
+  <parent>
+    <groupId>org.kie</groupId>
+    <artifactId>kie-tools-maven-base</artifactId>
+    <version>${revision}</version>
+    <relativePath>./node_modules/@kie-tools/maven-base/pom.xml</relativePath>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.kie.kogito</groupId>
+  <artifactId>sonataflow-db-migrator</artifactId>
+  <properties>
+    <project.build.outputTimestamp>2024-11-01T00:00:00Z</project.build.outputTimestamp>
+    <quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
+    <quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
+    <quarkus.platform.version>3.13.0</quarkus.platform.version>
+    <skipITs>true</skipITs>
+
+    <jacoco.version>0.8.12</jacoco.version>
+    <systemrules.version>1.19.0</systemrules.version>

Review Comment:
   Correct, I was able to move these versions into maven-base and use in db migrator tool pom.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "ricardozanini (via GitHub)" <gi...@apache.org>.
ricardozanini commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1815049692


##########
packages/kogito-db-migrator-tool/pom.xml:
##########
@@ -0,0 +1,200 @@
+<?xml version="1.0" ?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+-->
+<project
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
+  xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+>
+  <parent>
+    <groupId>org.kie</groupId>
+    <artifactId>kie-tools-maven-base</artifactId>
+    <version>${revision}</version>
+    <relativePath>./node_modules/@kie-tools/maven-base/pom.xml</relativePath>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.kie.kogito</groupId>
+  <artifactId>sonataflow-db-migrator</artifactId>
+  <properties>
+    <project.build.outputTimestamp>2024-11-01T00:00:00Z</project.build.outputTimestamp>
+    <quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
+    <quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
+    <quarkus.platform.version>3.13.0</quarkus.platform.version>

Review Comment:
   This must be parameterized, no @tiagobento ?



##########
packages/kogito-db-migrator-tool/install.js:
##########
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+const { env } = require("./env");
+const { setupMavenConfigFile, installMvnw, buildTailFromPackageJsonDependencies } = require("@kie-tools/maven-base");
+
+setupMavenConfigFile(
+  `
+    --batch-mode
+    -Dstyle.color=always
+    -Drevision=${env.devDeploymentQuarkusApp.version}

Review Comment:
   No, this variable name comes from `env/index.js`. You are copying the same variable name which we should not do it.



##########
packages/kogito-db-migrator-tool-image/cekit/image.yaml:
##########
@@ -0,0 +1,52 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+name: "docker.io/apache/incubator-kie-kogito-service-db-migration-postgresql"
+version: "999-SNAPSHOT"
+from: registry.access.redhat.com/ubi8/openjdk-17-runtime:1.20
+description: Flyway image for DI/JS database migration
+
+labels:
+  - name: "org.kie.kogito.version"
+    value: "### SET ME DURING BUILD PROCESS ###"
+  - name: "maintainer"
+    value: "Apache KIE <de...@kie.apache.org>"
+  - name: "io.k8s.description"
+    value: "Kogito DB Migration creates schemas and tables for Data Index and Jobs Service for PostgreSQL database"
+  - name: "io.k8s.display-name"
+    value: "Kogito DB Migration for Data Index and Jobs Service - PostgreSQL"
+  - name: "io.openshift.tags"
+    value: "kogito,db-migration"
+
+modules:
+  repositories:
+    - name: sonataflow-image-common
+      path: ../../sonataflow-image-common/resources/modules/kogito-system-user
+    - name: kogito-db-migrator-tool-image
+      path: modules
+  install:
+    - name: org.kie.kogito.system.user
+    - name: kogito-postgres-db-migration-deps

Review Comment:
   Please use the same format `org.kie.kogito.postgresql.db-migration-deps`



##########
packages/kogito-db-migrator-tool/pom.xml:
##########
@@ -0,0 +1,200 @@
+<?xml version="1.0" ?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+-->
+<project
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
+  xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+>
+  <parent>
+    <groupId>org.kie</groupId>
+    <artifactId>kie-tools-maven-base</artifactId>
+    <version>${revision}</version>
+    <relativePath>./node_modules/@kie-tools/maven-base/pom.xml</relativePath>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.kie.kogito</groupId>
+  <artifactId>sonataflow-db-migrator</artifactId>
+  <properties>
+    <project.build.outputTimestamp>2024-11-01T00:00:00Z</project.build.outputTimestamp>
+    <quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
+    <quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
+    <quarkus.platform.version>3.13.0</quarkus.platform.version>
+    <skipITs>true</skipITs>
+
+    <jacoco.version>0.8.12</jacoco.version>
+    <systemrules.version>1.19.0</systemrules.version>

Review Comment:
   How do we manage these versions here @tiagobento?



##########
packages/kogito-db-migrator-tool-image/cekit/image.yaml:
##########
@@ -0,0 +1,52 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+name: "docker.io/apache/incubator-kie-kogito-service-db-migration-postgresql"
+version: "999-SNAPSHOT"
+from: registry.access.redhat.com/ubi8/openjdk-17-runtime:1.20
+description: Flyway image for DI/JS database migration
+
+labels:
+  - name: "org.kie.kogito.version"
+    value: "### SET ME DURING BUILD PROCESS ###"
+  - name: "maintainer"
+    value: "Apache KIE <de...@kie.apache.org>"
+  - name: "io.k8s.description"
+    value: "Kogito DB Migration creates schemas and tables for Data Index and Jobs Service for PostgreSQL database"
+  - name: "io.k8s.display-name"
+    value: "Kogito DB Migration for Data Index and Jobs Service - PostgreSQL"
+  - name: "io.openshift.tags"
+    value: "kogito,db-migration"
+
+modules:
+  repositories:
+    - name: sonataflow-image-common
+      path: ../../sonataflow-image-common/resources/modules/kogito-system-user
+    - name: kogito-db-migrator-tool-image
+      path: modules

Review Comment:
   ```suggestion
        - path: modules
   ```



##########
packages/kogito-db-migrator-tool/README.md:
##########
@@ -0,0 +1,25 @@
+# kogito-db-migrator
+
+This is a java quarkus based postgres database migrator application for Sonataflow Data Index and Jobs Service applications for use by SonataFlow Operator.

Review Comment:
   Not resolved



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1815050325


##########
packages/kogito-db-migrator-tool/env/index.js:
##########
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+const { varsWithName, composeEnv } = require("@kie-tools-scripts/build-env");
+
+module.exports = composeEnv([require("@kie-tools/root-env/env")], {
+  vars: varsWithName({}),
+  get env() {
+    return {
+      devDeploymentQuarkusApp: {
+        version: require("../package.json").version,
+      },

Review Comment:
   Oh Okay, thanks for clarification.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1815613773


##########
packages/kogito-db-migrator-tool-image/package.json:
##########
@@ -0,0 +1,26 @@
+{
+  "private": true,
+  "name": "@kie-tools/kogito-db-migrator-tool-image",
+  "version": "0.0.0",
+  "description": "",
+  "license": "Apache-2.0",
+  "homepage": "https://github.com/apache/incubator-kie-tools",
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/apache/incubator-kie-tools.git"
+  },
+  "bugs": {
+    "url": "https://github.com/apache/incubator-kie-tools/issues"
+  },
+  "scripts": {
+    "build": "./build-container-image.sh",
+    "build:dev": "pnpm build",
+    "build:prod": "pnpm build",

Review Comment:
   Added image:build commands in `package.json`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1821476956


##########
packages/kogito-db-migrator-tool/package.json:
##########
@@ -0,0 +1,38 @@
+{
+  "private": true,
+  "name": "@kie-tools/kogito-db-migrator-tool",
+  "version": "0.0.0",
+  "description": "",
+  "license": "Apache-2.0",
+  "homepage": "https://github.com/apache/incubator-kie-tools",
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/apache/incubator-kie-tools.git"
+  },
+  "bugs": {
+    "url": "https://github.com/apache/incubator-kie-tools/issues"
+  },
+  "scripts": {
+    "build:dev": "pnpm pre-build && mvn clean install -DskipTests -Dquarkus.package.type=uber-jar && pnpm drop-jar && pnpm cleanup-ddl-dirs",
+    "build:prod": "pnpm pre-build && mvn clean install -DskipTests=$(build-env tests.run --not) -Dmaven.test.failure.ignore=$(build-env tests.ignoreFailures) -Dquarkus.package.type=uber-jar && pnpm drop-jar && pnpm cleanup-ddl-dirs",
+    "cleanup": "pnpm cleanup-drop-jar && pnpm cleanup-ddl-dirs",
+    "cleanup-ddl-dirs": "rimraf src/main/resources/ansi && rimraf src/main/resources/postgresql",
+    "cleanup-drop-jar": "rimraf /tmp/kogito-db-migrator-tool/ && mkdir -p /tmp/kogito-db-migrator-tool",
+    "drop-jar": "cp target/sonataflow-db-migrator-0.0.0-runner.jar /tmp/kogito-db-migrator-tool",
+    "pre-build": " pnpm cleanup && mvn dependency:unpack"

Review Comment:
   Updated to include only postgresql directory.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1813311406


##########
packages/kogito-db-migrator-tool-image/env/index.js:
##########
@@ -0,0 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+console.log("index.js");

Review Comment:
   I agree this file is not needed is now removed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "tiagobento (via GitHub)" <gi...@apache.org>.
tiagobento commented on PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#issuecomment-2596116058

   I'm fine with either approach @wmedvede, just as long as the name of package is clear and the intentions and scope of the new packages are well defined.
   
   If you want to evolve a single package into a multi-db migration tool, that's fine for me. As well as if you want to have one package per db migration tool. Finding the right granularity is more of an art than a science, so even if the strategy chosen today doesn't evolve well, we can always change. The package abstraction is flexible enough to accommodate for changes like that, so please feel free to proceed in the way you feel is best now.
   
   My request is just that the names and descriptions align with this initial strategy. Thx!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1893221918


##########
packages/kogito-db-migrator-tool-image/README.md:
##########
@@ -0,0 +1,116 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+     http://www.apache.org/licenses/LICENSE-2.0
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+-->
+
+# Kogito Postgres DB Migrator Tool Image
+
+This package contains the `Containerfile/Dockerfile` and scripts to build a container image for Kogito Postgres DB Migrator Tool. Details about the Kogito Postgres DB Migrator Tool can be found [here](../kogito-db-migrator-tool/README.md).
+
+## Additional requirements
+
+- docker
+
+## Build
+
+_NOTE_: Before performing this step, be sure that the Kogito Postgres DB Migrator Tool jar has been built and available for inclusion in the image.
+
+- Enable the image to be built:
+
+  ```bash
+  export KIE_TOOLS_BUILD__buildContainerImages=true
+  ```
+
+Run the following in the root folder of the repository to build the package:
+
+```bash
+pnpm -F @kie-tools/kogito-db-migrator-tool-image... build:prod
+```
+
+- Then check if the image is correctly stored:
+
+  ```bash
+  docker images
+  ```
+
+## Run
+
+- Start up a clean container with:
+
+  ```bash
+    docker run docker.io/apache/incubator-kie-kogito-service-db-migration-postgresql:latest

Review Comment:
   Hi @wmedvede and @ricardozanini,
   I spent more time on this one. 
   
   **EXECUTE DB MIGRATOR JAVA JAR IN TERMINAL(WITHOUT IMAGE I MEAN)**
   - The execution of the DB migrator with `java -jar target/quarkus-app/quarkus-run.jar` gives identical results whether the export QUARKUS_PLATFORM_VERSION=3.8.6 variable is set or not.
   - Meaning in any of the situation above I am not seeing 999-SNAPSHOTS log.
   - Please note the WARN message for 999-SNAPSHOT comes from `[io.qua.run.con.ConfigRecorder]` package, when we are using image and I do not at all see this package in the logs in these scenarios.
   
   **COMPARE DB MIGRATOR IMAGE build FOLDERS**
   - I compared TWO directories one built with env vars set and another without setting one.
   - The files are identical in this case too.
   - And not sure where the 999-SNAPSHOT appears from in the logs when the image is built without setting export QUARKUS_PLATFORM_VERSION=3.8.6.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1824760636


##########
packages/kogito-db-migrator-tool/package.json:
##########
@@ -0,0 +1,38 @@
+{
+  "private": true,
+  "name": "@kie-tools/kogito-db-migrator-tool",
+  "version": "0.0.0",
+  "description": "",
+  "license": "Apache-2.0",
+  "homepage": "https://github.com/apache/incubator-kie-tools",
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/apache/incubator-kie-tools.git"
+  },
+  "bugs": {
+    "url": "https://github.com/apache/incubator-kie-tools/issues"
+  },
+  "scripts": {
+    "build:dev": "pnpm pre-build && mvn clean install -DskipTests -Dquarkus.package.type=uber-jar && pnpm drop-jar && pnpm cleanup-ddl-dirs",
+    "build:prod": "pnpm pre-build && mvn clean install -DskipTests=$(build-env tests.run --not) -Dmaven.test.failure.ignore=$(build-env tests.ignoreFailures) -Dquarkus.package.type=uber-jar && pnpm drop-jar && pnpm cleanup-ddl-dirs",
+    "cleanup": "pnpm cleanup-drop-jar && pnpm cleanup-ddl-dirs",
+    "cleanup-ddl-dirs": "rimraf src/main/resources/ansi && rimraf src/main/resources/postgresql",
+    "cleanup-drop-jar": "rimraf /tmp/kogito-db-migrator-tool/ && mkdir -p /tmp/kogito-db-migrator-tool",

Review Comment:
   Updated as discussed here: https://kie.zulipchat.com/#narrow/dm/284023,295056,698891-group/near/479889841



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1823253840


##########
packages/kogito-db-migrator-tool/package.json:
##########
@@ -0,0 +1,38 @@
+{
+  "private": true,
+  "name": "@kie-tools/kogito-db-migrator-tool",
+  "version": "0.0.0",
+  "description": "",
+  "license": "Apache-2.0",
+  "homepage": "https://github.com/apache/incubator-kie-tools",
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/apache/incubator-kie-tools.git"
+  },
+  "bugs": {
+    "url": "https://github.com/apache/incubator-kie-tools/issues"
+  },
+  "scripts": {
+    "build:dev": "pnpm pre-build && mvn clean install -DskipTests -Dquarkus.package.type=uber-jar && pnpm drop-jar && pnpm cleanup-ddl-dirs",
+    "build:prod": "pnpm pre-build && mvn clean install -DskipTests=$(build-env tests.run --not) -Dmaven.test.failure.ignore=$(build-env tests.ignoreFailures) -Dquarkus.package.type=uber-jar && pnpm drop-jar && pnpm cleanup-ddl-dirs",
+    "cleanup": "pnpm cleanup-drop-jar && pnpm cleanup-ddl-dirs",
+    "cleanup-ddl-dirs": "rimraf src/main/resources/ansi && rimraf src/main/resources/postgresql",
+    "cleanup-drop-jar": "rimraf /tmp/kogito-db-migrator-tool/ && mkdir -p /tmp/kogito-db-migrator-tool",
+    "drop-jar": "cp target/sonataflow-db-migrator-0.0.0-runner.jar /tmp/kogito-db-migrator-tool",

Review Comment:
   Updated to make use of `fast-jar` and now copying from `target` directory instead of `/tmp`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1813406810


##########
packages/kogito-db-migrator-tool/get-kogito-ddl-scripts.sh:
##########
@@ -0,0 +1,64 @@
+#!/bin/sh
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+set -x
+set -e
+
+# Script variables with default values. These values will be updated by hack/bump-version.sh, don't change it.
+DDL_VERSION=10.0.999-SNAPSHOT
+DDL_FILE=kogito-ddl-10.0.999-20241018.012042-73-db-scripts.zip

Review Comment:
   I think it is. https://github.com/rhkp/incubator-kie-tools/blob/flpath-1775-pr1/packages/kogito-db-migrator-tool/get-kogito-ddl-scripts.sh#L40-#L46



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1813398633


##########
packages/kogito-db-migrator-tool/install.js:
##########
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+const { env } = require("./env");
+const { setupMavenConfigFile, installMvnw, buildTailFromPackageJsonDependencies } = require("@kie-tools/maven-base");
+
+setupMavenConfigFile(
+  `
+    --batch-mode
+    -Dstyle.color=always
+    -Drevision=${env.devDeploymentQuarkusApp.version}

Review Comment:
   I guess, as conveyed by @tiagobento in comment below these env vars come from `maven-base`!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "ricardozanini (via GitHub)" <gi...@apache.org>.
ricardozanini commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1815040185


##########
packages/kogito-db-migrator-tool/install.js:
##########
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+const { env } = require("./env");
+const { setupMavenConfigFile, installMvnw, buildTailFromPackageJsonDependencies } = require("@kie-tools/maven-base");
+
+setupMavenConfigFile(
+  `
+    --batch-mode
+    -Dstyle.color=always
+    -Drevision=${env.devDeploymentQuarkusApp.version}
+    -Dversion.quarkus=${env.versions.quarkus}
+    -Dversion.org.kie.kogito=${env.versions.kogito}

Review Comment:
   This is fine, usually we wrapper them in `env/index.js`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1815042802


##########
packages/kogito-db-migrator-tool/package.json:
##########
@@ -0,0 +1,33 @@
+{
+  "private": true,
+  "name": "@kie-tools/kogito-db-migrator-tool",
+  "version": "0.0.0",
+  "description": "",
+  "license": "Apache-2.0",
+  "homepage": "https://github.com/apache/incubator-kie-tools",
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/apache/incubator-kie-tools.git"
+  },
+  "bugs": {
+    "url": "https://github.com/apache/incubator-kie-tools/issues"
+  },
+  "scripts": {
+    "build:dev": "./build-db-migrator-jar.sh true",
+    "build:prod": "./build-db-migrator-jar.sh false",

Review Comment:
   Like other SonataFlow components we will only support Mac/Linux platforms. However we will improve the package.json, which will show a message on that build on Windows platforms is not supported.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1811349079


##########
packages/kogito-db-migrator-tool/src/main/cekit/image.yaml:
##########
@@ -0,0 +1,45 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+name: "docker.io/apache/incubator-kie-kogito-service-db-migration-postgresql"
+version: "999-SNAPSHOT"
+from: registry.access.redhat.com/ubi8/openjdk-17-runtime:1.19
+description: Flyway image for DI/JS database migration
+
+labels:
+  - name: "org.kie.kogito.version"
+    value: "999-SNAPSHOT"

Review Comment:
   Not applicable as the cekit build is not relevant in this package and is now removed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1813315212


##########
.gitignore:
##########
@@ -346,3 +346,6 @@ turbo.json
 # IntelliJ projects should be on _intellij-projects folder, never on specific packages.
 packages/*/.idea
 examples/*/.idea
+
+# Jar files
+**/*.jar

Review Comment:
   This has been removed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1814997354


##########
packages/kogito-db-migrator-tool-image/build-container-image.sh:
##########
@@ -0,0 +1,40 @@
+#!/bin/sh
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+set -x
+set -e
+
+CEKIT_BUILDER=docker
+SOURCE_FILE=/tmp/kogito-db-migrator-tool/sonataflow-db-migrator-0.0.0-runner.jar
+TARGET_FILE=./cekit/modules/kogito-postgres-db-migration-deps/sonataflow-db-migrator-runner.jar
+
+if [ -f "$SOURCE_FILE" ]; then
+   echo "The file: $SOURCE_FILE found and will be used to build image."
+   rm -f $TARGET_FILE
+   cp $SOURCE_FILE $TARGET_FILE
+
+   # Build the container image
+   cd ./cekit || exit
+   cekit -v build "$CEKIT_BUILDER"
+   rm -f $TARGET_FILE
+else
+   echo "The file: $SOURCE_FILE not found. Please build kogito-db-migrator-tool package first before building the image."
+   exit 1
+fi

Review Comment:
   Hey @ricardozanini, Are you referring to `package.json`? 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1813321983


##########
packages/kogito-db-migrator-tool/.gitignore:
##########


Review Comment:
   Removed the entry for .jar files



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1889349348


##########
packages/kogito-db-migrator-tool-image/README.md:
##########
@@ -0,0 +1,116 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+     http://www.apache.org/licenses/LICENSE-2.0
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+-->
+
+# Kogito Postgres DB Migrator Tool Image
+
+This package contains the `Containerfile/Dockerfile` and scripts to build a container image for Kogito Postgres DB Migrator Tool. Details about the Kogito Postgres DB Migrator Tool can be found [here](../kogito-db-migrator-tool/README.md).
+
+## Additional requirements
+
+- docker
+
+## Build
+
+_NOTE_: Before performing this step, be sure that the Kogito Postgres DB Migrator Tool jar has been built and available for inclusion in the image.
+
+- Enable the image to be built:
+
+  ```bash
+  export KIE_TOOLS_BUILD__buildContainerImages=true
+  ```
+
+Run the following in the root folder of the repository to build the package:
+
+```bash
+pnpm -F @kie-tools/kogito-db-migrator-tool-image... build:prod
+```
+
+- Then check if the image is correctly stored:
+
+  ```bash
+  docker images
+  ```
+
+## Run
+
+- Start up a clean container with:
+
+  ```bash
+    docker run docker.io/apache/incubator-kie-kogito-service-db-migration-postgresql:latest

Review Comment:
   This indicates some issue with the env you may have used. May be some old image is lingering there. The latest logs can be found here and it nowhere refers to `999-SNAPSHOT`.
   
   https://gist.github.com/rhkp/bbee2c6654068ad7009cff1319280312
   
   I built the image using:
   `pnpm --stream=true -F kogito-db-migrator-tool-image... build:prod`
   
   And executed with (please change params based on your needs)
   `docker run --network=host  --env MIGRATE_DB_DATAINDEX=true  --env QUARKUS_DATASOURCE_DATAINDEX_JDBC_URL=jdbc:postgresql://127.0.0.1:5432/di  --env QUARKUS_DATASOURCE_DATAINDEX_USERNAME=postgres   --env QUARKUS_DATASOURCE_DATAINDEX_PASSWORD=postgres  --env QUARKUS_FLYWAY_DATAINDEX_SCHEMAS=di  --env MIGRATE_DB_JOBSSERVICE=true  --env QUARKUS_DATASOURCE_JOBSSERVICE_JDBC_URL=jdbc:postgresql://127.0.0.1:5432/js  --env QUARKUS_DATASOURCE_JOBSSERVICE_USERNAME=postgres  --env QUARKUS_DATASOURCE_JOBSSERVICE_PASSWORD=postgres  --env QUARKUS_FLYWAY_JOBSSERVICE_SCHEMAS=js  docker.io/apache/incubator-kie-kogito-db-migrator-tool:main`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1889298250


##########
packages/kogito-db-migrator-tool/src/main/java/org/kie/kogito/postgresql/migrator/DBMigrator.java:
##########
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.kie.kogito.postgresql.migrator;
+
+import io.quarkus.runtime.Quarkus;
+import io.quarkus.runtime.QuarkusApplication;
+import io.quarkus.runtime.annotations.QuarkusMain;
+import jakarta.inject.Inject;
+import io.quarkus.logging.Log;
+
+import java.sql.SQLException;
+
+import org.eclipse.microprofile.config.inject.ConfigProperty;
+
+@QuarkusMain
+public class DBMigrator implements QuarkusApplication {
+
+    @Inject
+    MigrationService service;
+
+    @Inject
+    DBConnectionChecker dbConnectionChecker;
+
+    @ConfigProperty(name = "migrate.db.dataindex")
+    Boolean migrateDataIndex;
+
+    @ConfigProperty(name = "migrate.db.jobsservice")
+    Boolean migrateJobsService;
+
+    @Override
+    public int run(String... args) {
+        if (migrateDataIndex) {
+            try {
+                dbConnectionChecker.checkDataIndexDBConnection();
+            } catch (SQLException e) {
+                Log.error( "Error obtaining data index database connection. Cannot proceed, exiting.");
+                Quarkus.asyncExit(-1);
+                return -1;
+            }
+            service.migrateDataIndex();
+        }
+
+        if (migrateJobsService) {
+            try {
+                dbConnectionChecker.checkJobsServiceDBConnection();
+            } catch (SQLException e) {
+                Log.error( "Error obtaining jobs service database connection. Cannot proceed, exiting.");
+                Quarkus.asyncExit(-2);
+                return -2;

Review Comment:
   Correct. Added exception handling for 
   `service.migrateDataIndex(); fails, or             service.migrateJobsService();` 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1889299373


##########
packages/kogito-db-migrator-tool-image/resources/incubator-kie-kogito-db-migrator-tool-image.yaml:
##########
@@ -0,0 +1,50 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+name: "docker.io/apache/incubator-kie-kogito-db-migrator-tool"
+version: "main"
+from: registry.access.redhat.com/ubi8/openjdk-17-runtime:1.20
+description: Flyway image for Data Index and Jobs Service database migration

Review Comment:
   Sure.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on code in PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#discussion_r1917309601


##########
packages/maven-base/pom.xml:
##########
@@ -408,6 +409,25 @@
           </execution>
         </executions>
       </plugin>
+      <plugin>
+        <groupId>org.jacoco</groupId>
+        <artifactId>jacoco-maven-plugin</artifactId>
+        <version> ${version.jacoco.maven.plugin} </version>
+        <executions>
+          <execution>
+            <goals>
+              <goal>prepare-agent</goal>
+            </goals>
+          </execution>
+          <execution>
+            <id>report</id>
+            <phase>prepare-package</phase>
+            <goals>
+              <goal>report</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>

Review Comment:
   I agree. 
   I have moved this locally to DB Migrator Package as indeed only DB Migrator is making use of it and no other package needs it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2659: [SonataFlow] Migrate DBMigration Image from SonataFlow operator repository to kie-tools [incubator-kie-tools]

Posted by "rhkp (via GitHub)" <gi...@apache.org>.
rhkp commented on PR #2697:
URL: https://github.com/apache/incubator-kie-tools/pull/2697#issuecomment-2607573477

   > > I think in this `wave` of implementation we are focussing on `postgreSQL` so I would suggest to keep it that way:
   > 
   > I'd personally prefer to keep the package names `kogito-db-migrator-tool` and `kogito-db-migrator-tool-image`, considering that as commented before, this work is very close to be a multi db migrator. Potential DB candidate to add in the short term could be H2, see: https://github.com/apache/incubator-kie-kogito-apps/blob/538f33c4a6a6e9c564cd172b32d7632cd792b1a0/data-index/data-index-storage/data-index-storage-jpa/src/test/resources/application.properties
   
   Reverted back to original names.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org