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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
