From 762306a8ab85ac7c04ff062c1d6d15dec67514cf Mon Sep 17 00:00:00 2001 From: fantonangeli Date: Mon, 18 Nov 2024 18:29:22 +0100 Subject: [PATCH 01/10] Rewrite all request to the DI using env vars --- .../README.md | 19 +++++++++++++++++++ .../management-console/configure-httpd.sh | 16 +++++++++++++++- .../build/defaultEnvJson.ts | 1 - .../env/index.js | 5 ----- .../src/AppConstants.ts | 19 +++++++++++++++++++ .../src/env/EnvJson.ts | 1 - .../src/index.tsx | 3 +++ .../webpack.config.ts | 7 ++++--- 8 files changed, 60 insertions(+), 11 deletions(-) create mode 100644 packages/sonataflow-management-console-webapp/src/AppConstants.ts diff --git a/packages/sonataflow-management-console-image/README.md b/packages/sonataflow-management-console-image/README.md index da8611713a2..6589d7a8f60 100644 --- a/packages/sonataflow-management-console-image/README.md +++ b/packages/sonataflow-management-console-image/README.md @@ -109,6 +109,25 @@ The port used internally on the container can be changed: When building, set the `SONATAFLOW_MANAGEMENT_CONSOLE__port` environment variable to any port you want, and the Containerfile will be built using that port. +## Run the Docker Image Locally + +1. This command will start the container and configure it to access your local data-index service from the container. + Replace `` with the IP address of your host machine. + + ```bash + docker run --rm -it -p 8080:8080 \ + -e SONATAFLOW_MANAGEMENT_CONSOLE_KOGITO_ENV_MODE='DEV' \ + -e SONATAFLOW_MANAGEMENT_CONSOLE_DATA_INDEX_ENDPOINT='http://:4000/graphql' \ + docker.io/apache/incubator-kie-sonataflow-management-console:main + ``` + +2. In a separate terminal, start Sonataflow Dev App for the Data Index service. + + ```bash + cd ../sonataflow-dev-app + pnpm start + ``` + --- Apache KIE (incubating) is an effort undergoing incubation at The Apache Software diff --git a/packages/sonataflow-management-console-image/resources/modules/sonataflow/management-console/configure-httpd.sh b/packages/sonataflow-management-console-image/resources/modules/sonataflow/management-console/configure-httpd.sh index e3cfcfef92c..1eb3f249ba0 100644 --- a/packages/sonataflow-management-console-image/resources/modules/sonataflow/management-console/configure-httpd.sh +++ b/packages/sonataflow-management-console-image/resources/modules/sonataflow/management-console/configure-httpd.sh @@ -31,8 +31,22 @@ sed -i "s/Listen 80/Listen ${SONATAFLOW_MANAGEMENT_CONSOLE_PORT}/g" "${HTTPD_MAI sed -i "s/#ServerName www.example.com:80/ServerName 127.0.0.1:${SONATAFLOW_MANAGEMENT_CONSOLE_PORT}/g" "${HTTPD_MAIN_CONF_PATH}/httpd.conf" sed -i '$ a ServerTokens Prod' "${HTTPD_MAIN_CONF_PATH}/httpd.conf" sed -i '$ a ServerSignature Off' "${HTTPD_MAIN_CONF_PATH}/httpd.conf" -sed -i -e '//a RewriteEngine on\n RewriteCond %{REQUEST_FILENAME} -f [OR]\n RewriteCond %{REQUEST_FILENAME} -d\n RewriteRule ^ - [L]\n RewriteRule ^ index.html [L]' "${HTTPD_MAIN_CONF_PATH}/httpd.conf" +# Add RewriteRules +sed -i -e '//a \ + RewriteEngine on \ + # Data Index rewrite rules \ + RewriteCond %{REQUEST_URI} ^\/graphql([\/\?$]|$) \ + RewriteCond %{ENV:SONATAFLOW_MANAGEMENT_CONSOLE_DATA_INDEX_ENDPOINT} ^$ \ + RewriteRule ^.*$ - [R=503,L] \ + RewriteCond %{REQUEST_URI} ^\/graphql([\/\?$]|$) \ + RewriteCond %{ENV:SONATAFLOW_MANAGEMENT_CONSOLE_DATA_INDEX_ENDPOINT} ^(.*)$ \ + RewriteRule ^.*$ %1 [P,L]\n \ + RewriteCond %{REQUEST_FILENAME} -f [OR] \ + RewriteCond %{REQUEST_FILENAME} -d \ + RewriteRule ^ - [L] \ + RewriteRule ^ index.html [L]\n' \ + "${HTTPD_MAIN_CONF_PATH}/httpd.conf" # Set the required paths mkdir -p "${MGMT_CONSOLE_HOME}/launch" diff --git a/packages/sonataflow-management-console-webapp/build/defaultEnvJson.ts b/packages/sonataflow-management-console-webapp/build/defaultEnvJson.ts index f3d602ea355..a7bf9981245 100644 --- a/packages/sonataflow-management-console-webapp/build/defaultEnvJson.ts +++ b/packages/sonataflow-management-console-webapp/build/defaultEnvJson.ts @@ -33,7 +33,6 @@ export const defaultEnvJson: EnvJson = { KOGITO_CONSOLES_KEYCLOAK_REALM: "kogito", KOGITO_CONSOLES_KEYCLOAK_UPDATE_TOKEN_VALIDITY: 30, KOGITO_CONSOLES_KEYCLOAK_URL: "http://localhost:8280", - SONATAFLOW_MANAGEMENT_CONSOLE_DATA_INDEX_ENDPOINT: buildEnv.sonataflowManagementConsoleWebapp.sonataflowDataIndexUrl, SONATAFLOW_MANAGEMENT_CONSOLE_KOGITO_APP_NAME: "SonataFlow Management Console", SONATAFLOW_MANAGEMENT_CONSOLE_KOGITO_APP_VERSION: version, SONATAFLOW_MANAGEMENT_CONSOLE_KOGITO_ENV_MODE: buildEnv.sonataflowManagementConsoleWebapp.sonataflowEnvMode, diff --git a/packages/sonataflow-management-console-webapp/env/index.js b/packages/sonataflow-management-console-webapp/env/index.js index 0c418cfb794..89f9adce5dd 100644 --- a/packages/sonataflow-management-console-webapp/env/index.js +++ b/packages/sonataflow-management-console-webapp/env/index.js @@ -21,10 +21,6 @@ const { varsWithName, composeEnv, getOrDefault } = require("@kie-tools-scripts/b module.exports = composeEnv([require("@kie-tools/root-env/env")], { vars: varsWithName({ - SONATAFLOW_MANAGEMENT_CONSOLE_WEBAPP__sonataflowDataIndexUrl: { - default: "http://localhost:4000/graphql", - description: "URL for the Data Index service", - }, SONATAFLOW_MANAGEMENT_CONSOLE_WEBAPP__sonataflowEnvMode: { default: "DEV", description: "DEV or PROD. PROD enables Keycloak integration", @@ -41,7 +37,6 @@ module.exports = composeEnv([require("@kie-tools/root-env/env")], { get env() { return { sonataflowManagementConsoleWebapp: { - sonataflowDataIndexUrl: getOrDefault(this.vars.SONATAFLOW_MANAGEMENT_CONSOLE_WEBAPP__sonataflowDataIndexUrl), sonataflowEnvMode: getOrDefault(this.vars.SONATAFLOW_MANAGEMENT_CONSOLE_WEBAPP__sonataflowEnvMode), host: getOrDefault(this.vars.SONATAFLOW_MANAGEMENT_CONSOLE_WEBAPP__host), port: getOrDefault(this.vars.SONATAFLOW_MANAGEMENT_CONSOLE_WEBAPP__port), diff --git a/packages/sonataflow-management-console-webapp/src/AppConstants.ts b/packages/sonataflow-management-console-webapp/src/AppConstants.ts new file mode 100644 index 00000000000..9c6e155a435 --- /dev/null +++ b/packages/sonataflow-management-console-webapp/src/AppConstants.ts @@ -0,0 +1,19 @@ +/** + * 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. + */ +export const DATA_INDEX_ENDPOINT = "/graphql"; diff --git a/packages/sonataflow-management-console-webapp/src/env/EnvJson.ts b/packages/sonataflow-management-console-webapp/src/env/EnvJson.ts index ae330fffb65..fda26e4dd8b 100644 --- a/packages/sonataflow-management-console-webapp/src/env/EnvJson.ts +++ b/packages/sonataflow-management-console-webapp/src/env/EnvJson.ts @@ -23,5 +23,4 @@ export interface EnvJson extends KogitoConsolesKeycloakEnv { SONATAFLOW_MANAGEMENT_CONSOLE_KOGITO_ENV_MODE: "DEV" | "PROD"; SONATAFLOW_MANAGEMENT_CONSOLE_KOGITO_APP_NAME: string; SONATAFLOW_MANAGEMENT_CONSOLE_KOGITO_APP_VERSION: string; - SONATAFLOW_MANAGEMENT_CONSOLE_DATA_INDEX_ENDPOINT: string; } diff --git a/packages/sonataflow-management-console-webapp/src/index.tsx b/packages/sonataflow-management-console-webapp/src/index.tsx index 52a3859d1d6..bb372a0ad39 100644 --- a/packages/sonataflow-management-console-webapp/src/index.tsx +++ b/packages/sonataflow-management-console-webapp/src/index.tsx @@ -40,6 +40,9 @@ import { import { initEnv } from "./env/Env"; import { ENV_PREFIX } from "./env/EnvConstants"; import { EnvJson } from "./env/EnvJson"; +import { DATA_INDEX_ENDPOINT } from "./AppConstants"; + +window["DATA_INDEX_ENDPOINT"] = DATA_INDEX_ENDPOINT; const onLoadFailure = (): void => { ReactDOM.render(, document.getElementById("root")); diff --git a/packages/sonataflow-management-console-webapp/webpack.config.ts b/packages/sonataflow-management-console-webapp/webpack.config.ts index 92fa753a8f8..ea2da2d02a6 100644 --- a/packages/sonataflow-management-console-webapp/webpack.config.ts +++ b/packages/sonataflow-management-console-webapp/webpack.config.ts @@ -195,13 +195,14 @@ export default async (webpackEnv: any, webpackArgv: any) => { }, progress: true, }, - proxy: { - "/svg": { + proxy: [ + { + context: (path, req) => req.method === "POST" || path.startsWith("/graphql") || path === "/q/openapi.json", target: "http://localhost:4000", secure: false, changeOrigin: true, }, - }, + ], }, }, ]; From d4fce7d2e50f24b5bc1f017aaa79a5a21fa88cbd Mon Sep 17 00:00:00 2001 From: fantonangeli Date: Tue, 19 Nov 2024 14:50:59 +0100 Subject: [PATCH 02/10] Fix communication error between MGMT deployment and DI deployment on OCP using SSL. --- .../modules/sonataflow/management-console/configure-httpd.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/sonataflow-management-console-image/resources/modules/sonataflow/management-console/configure-httpd.sh b/packages/sonataflow-management-console-image/resources/modules/sonataflow/management-console/configure-httpd.sh index 1eb3f249ba0..41948f03401 100644 --- a/packages/sonataflow-management-console-image/resources/modules/sonataflow/management-console/configure-httpd.sh +++ b/packages/sonataflow-management-console-image/resources/modules/sonataflow/management-console/configure-httpd.sh @@ -31,6 +31,7 @@ sed -i "s/Listen 80/Listen ${SONATAFLOW_MANAGEMENT_CONSOLE_PORT}/g" "${HTTPD_MAI sed -i "s/#ServerName www.example.com:80/ServerName 127.0.0.1:${SONATAFLOW_MANAGEMENT_CONSOLE_PORT}/g" "${HTTPD_MAIN_CONF_PATH}/httpd.conf" sed -i '$ a ServerTokens Prod' "${HTTPD_MAIN_CONF_PATH}/httpd.conf" sed -i '$ a ServerSignature Off' "${HTTPD_MAIN_CONF_PATH}/httpd.conf" +sed -i '$ a SSLProxyEngine on' "${HTTPD_MAIN_CONF_PATH}/httpd.conf" # Add RewriteRules sed -i -e '//a \ From 7a647dd7ab6a8e67f2773a935e7489d69d903a42 Mon Sep 17 00:00:00 2001 From: fantonangeli Date: Thu, 5 Dec 2024 19:07:42 +0100 Subject: [PATCH 03/10] Use of SONATAFLOW_DEV_APP_DELAY --- packages/sonataflow-dev-app/README.md | 12 ++++++++++++ packages/sonataflow-dev-app/src/server.js | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/packages/sonataflow-dev-app/README.md b/packages/sonataflow-dev-app/README.md index 1a60602207f..f790b0594fe 100644 --- a/packages/sonataflow-dev-app/README.md +++ b/packages/sonataflow-dev-app/README.md @@ -29,6 +29,18 @@ To run the development app, use the following command: `pnpm start` +# Configuration + +The `SonataFlow Dev App` can be configured via environment variables: + +- _SONATAFLOW_DEV_APP_DELAY_: Defines the server's response delay in milliseconds + +For example: + +```bash +$ export SONATAFLOW_DEV_APP_DELAY=500 +``` + ### GraphQL Modifications This section covers modifications to the GraphQL database. diff --git a/packages/sonataflow-dev-app/src/server.js b/packages/sonataflow-dev-app/src/server.js index f885872b496..cad9439830e 100644 --- a/packages/sonataflow-dev-app/src/server.js +++ b/packages/sonataflow-dev-app/src/server.js @@ -36,7 +36,7 @@ const data = require("./MockData/graphql"); const controller = require("./MockData/controllers"); const typeDefs = require("./MockData/types"); -const DEFAULT_TIMEOUT = 2000; +const DEFAULT_DELAY = Number(process.env.SONATAFLOW_DEV_APP_DELAY || 2000); const swaggerOptions = { swaggerOptions: { @@ -96,7 +96,7 @@ app.post("/forms/:formName", controller.saveFormContent); app.post(/^\/(service|hello|systout|jsongreet|order|yamlgreet)$/, controller.startProcessInstance); -function timeout(ms = DEFAULT_TIMEOUT) { +function timeout(ms = DEFAULT_DELAY) { return new Promise((resolve) => setTimeout(resolve, ms)); } From 5987d34ad25824ac8128cc60058c133d09d25a5c Mon Sep 17 00:00:00 2001 From: fantonangeli Date: Thu, 5 Dec 2024 19:27:21 +0100 Subject: [PATCH 04/10] Features tests WIP --- .gitignore | 1 + .../package.json | 9 +- ...e-sonataflow-management-console-image.yaml | 2 +- .../sonataflow-management-console.feature | 37 ++++++ .../sonataflow-devmode/.vscode/launch.json | 22 ++++ .../sonataflow-devmode/.vscode/settings.json | 13 +++ .../resources/greet.sw.json | 67 +++++++++++ .../sonataflow-devmode/src/RunTests.java | 105 ++++++++++++++++++ 8 files changed, 253 insertions(+), 3 deletions(-) create mode 100644 packages/sonataflow-management-console-image/test-resources/tests/features/sonataflow-management-console.feature create mode 100644 packages/sonataflow-management-console-image/test-resources/tests/shell/sonataflow-devmode/.vscode/launch.json create mode 100644 packages/sonataflow-management-console-image/test-resources/tests/shell/sonataflow-devmode/.vscode/settings.json create mode 100644 packages/sonataflow-management-console-image/test-resources/tests/shell/sonataflow-devmode/resources/greet.sw.json create mode 100644 packages/sonataflow-management-console-image/test-resources/tests/shell/sonataflow-devmode/src/RunTests.java diff --git a/.gitignore b/.gitignore index 0fa740642fb..f265d137bbc 100644 --- a/.gitignore +++ b/.gitignore @@ -324,6 +324,7 @@ packages/scesim-marshaller/**/ts-gen !packages/sonataflow-image-common/test-resources/ !packages/sonataflow-builder-image/test-resources/ !packages/sonataflow-devmode-image/test-resources/ +!packages/sonataflow-management-console-image/test-resources/ # kogito-images: excluding test-resources !packages/kogito-data-index-ephemeral-image/test-resources/ diff --git a/packages/sonataflow-management-console-image/package.json b/packages/sonataflow-management-console-image/package.json index 04933271fc7..5e472682a4f 100644 --- a/packages/sonataflow-management-console-image/package.json +++ b/packages/sonataflow-management-console-image/package.json @@ -14,12 +14,14 @@ }, "scripts": { "build:dev": "pnpm cleanup && pnpm env-json:schema:generate && pnpm copy:assets && run-script-if --bool \"$(build-env containerImages.build)\" --then \"pnpm image:cekit:build\"", - "build:prod": "pnpm cleanup && pnpm env-json:schema:generate && pnpm copy:assets && run-script-if --bool \"$(build-env containerImages.build)\" --then \"pnpm image:cekit:build\"", + "build:prod": "pnpm cleanup && pnpm env-json:schema:generate && pnpm copy:assets && run-script-if --bool \"$(build-env containerImages.build)\" --then \"pnpm image:cekit:build && pnpm image:test\"", "cleanup": "rimraf dist-dev && mkdir dist-dev", "copy:assets": "pnpm copy:webapp-assets && pnpm copy:image-env-to-json", "copy:image-env-to-json": "run-script-os", "copy:image-env-to-json:linux:darwin": "cp ./node_modules/@kie-tools/image-env-to-json/dist/linux/image-env-to-json-standalone ./dist-dev/", "copy:image-env-to-json:win32": "pnpm powershell \"Copy-Item ./node_modules/@kie-tools/image-env-to-json/dist/linux/image-env-to-json-standalone ./dist-dev/\"", + "copy:test-assets": "run-script-os", + "copy:test-assets:linux:darwin": "cp -R test-resources/* dist-dev", "copy:webapp-assets": "run-script-os", "copy:webapp-assets:linux:darwin": "cp -R ./node_modules/@kie-tools/sonataflow-management-console-webapp/dist/ ./dist-dev/sonataflow-management-console-webapp", "copy:webapp-assets:win32": "pnpm powershell \"Copy-Item -R ./node_modules/@kie-tools/sonataflow-management-console-webapp/dist/ ./dist-dev/sonataflow-management-console-webapp\"", @@ -28,7 +30,10 @@ "image:cekit:build:linux": "pnpm image:cekit:copy && pnpm image:cekit:setup:env make -C ./dist-dev build", "image:cekit:build:win32:darwin": "echo \"Build skipped on macOS and Windows\"", "image:cekit:copy": "cp -R ./node_modules/@kie-tools/sonataflow-image-common/resources/* ./dist-dev/ && cp -R resources/* ./dist-dev/", - "image:cekit:setup:env": ". ./node_modules/@kie-tools/python-venv/venv/bin/activate && cross-env KOGITO_IMAGE_REGISTRY=$(build-env sonataflowManagementConsoleImageEnv.registry) KOGITO_IMAGE_REGISTRY_ACCOUNT=$(build-env sonataflowManagementConsoleImageEnv.account) KOGITO_IMAGE_NAME=$(build-env sonataflowManagementConsoleImageEnv.name) KOGITO_IMAGE_TAG=$(build-env sonataflowManagementConsoleImageEnv.buildTag) QUARKUS_PLATFORM_VERSION=$(build-env versions.quarkus) KOGITO_VERSION=$(build-env versions.kogito) SONATAFLOW_MANAGEMENT_CONSOLE_PORT=$(build-env sonataflowManagementConsoleImageEnv.port)" + "image:cekit:setup:env": ". ./node_modules/@kie-tools/python-venv/venv/bin/activate && cross-env KOGITO_IMAGE_REGISTRY=$(build-env sonataflowManagementConsoleImageEnv.registry) KOGITO_IMAGE_REGISTRY_ACCOUNT=$(build-env sonataflowManagementConsoleImageEnv.account) KOGITO_IMAGE_NAME=$(build-env sonataflowManagementConsoleImageEnv.name) KOGITO_IMAGE_TAG=$(build-env sonataflowManagementConsoleImageEnv.buildTag) QUARKUS_PLATFORM_VERSION=$(build-env versions.quarkus) KOGITO_VERSION=$(build-env versions.kogito) SONATAFLOW_MANAGEMENT_CONSOLE_PORT=$(build-env sonataflowManagementConsoleImageEnv.port)", + "image:test": "run-script-if --ignore-errors \"$(build-env tests.ignoreFailures)\" --bool \"$(build-env endToEndTests.run)\" --then \"mkdir -p dist-dev/target/test/results\" \"run-script-os\" --finally \"cp -R dist-dev/target/test/results dist-tests-e2e/\"", + "image:test:darwin:win32": "echo \"Tests skipped on macOS and Windows\"", + "image:test:linux": "pnpm copy:test-assets && pnpm image:cekit:setup:env SONATAFLOW_MANAGEMENT_CONSOLE_DATA_INDEX_ENDPOINT='http://host.docker.internal:4000/graphql' make -C ./dist-dev test-image" }, "devDependencies": { "@kie-tools/image-env-to-json": "workspace:*", diff --git a/packages/sonataflow-management-console-image/resources/incubator-kie-sonataflow-management-console-image.yaml b/packages/sonataflow-management-console-image/resources/incubator-kie-sonataflow-management-console-image.yaml index 01ebf37e650..78817971c6f 100644 --- a/packages/sonataflow-management-console-image/resources/incubator-kie-sonataflow-management-console-image.yaml +++ b/packages/sonataflow-management-console-image/resources/incubator-kie-sonataflow-management-console-image.yaml @@ -16,7 +16,7 @@ # specific language governing permissions and limitations # under the License. # -- name: "docker.io/apache/incubator-kie-sonataflow-devmode" +- name: "docker.io/apache/incubator-kie-sonataflow-management-console" from: "registry.access.redhat.com/ubi9/httpd-24:1-336.1725850633" version: "0.0.0" description: "SonataFlow Management Console Image" diff --git a/packages/sonataflow-management-console-image/test-resources/tests/features/sonataflow-management-console.feature b/packages/sonataflow-management-console-image/test-resources/tests/features/sonataflow-management-console.feature new file mode 100644 index 00000000000..33789d17012 --- /dev/null +++ b/packages/sonataflow-management-console-image/test-resources/tests/features/sonataflow-management-console.feature @@ -0,0 +1,37 @@ +@docker.io/apache/incubator-kie-sonataflow-management-console +Feature: Serverless Workflow Management Console images + + Scenario: verify that the home page is served + When container is started with env + | variable | value | + Then container log should contain httpd -D FOREGROUND + Then check that page is served + | property | value | + | port | 8080 | + | path | / | + | request_method | GET | + | wait | 480 | + | expected_status_code | 200 | + + Scenario: Verify that the rewrite rule for /graphql is in httpd.conf + When container is started with env + | variable | value | + Then container log should contain httpd -D FOREGROUND + Then file /etc/httpd/conf/httpd.conf should contain /graphql + + + Scenario: verify that the data-index is available from the container + When container is started with env + | variable | value | + | SONATAFLOW_MANAGEMENT_CONSOLE_DATA_INDEX_ENDPOINT | http://192.168.138.171:4000/graphql | + Then container log should contain httpd -D FOREGROUND + Then check that page is served + | property | value | + | port | 8080 | + | path | /graphql | + | request_method | POST | + | request_body | { "query": "{ProcessInstances{ id } }" } | + | content_type | application/json | + | wait | 15 | + | expected_status_code | 200 | + | expected_phrase | "data":{"ProcessInstances | diff --git a/packages/sonataflow-management-console-image/test-resources/tests/shell/sonataflow-devmode/.vscode/launch.json b/packages/sonataflow-management-console-image/test-resources/tests/shell/sonataflow-devmode/.vscode/launch.json new file mode 100644 index 00000000000..82cbbc6179c --- /dev/null +++ b/packages/sonataflow-management-console-image/test-resources/tests/shell/sonataflow-devmode/.vscode/launch.json @@ -0,0 +1,22 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "java", + "name": "RunTests-port-4004", + "request": "attach", + "hostName": "localhost", + "port": 4004 + }, + { + "type": "java", + "name": "Debug (Launch) - RunTests", + "request": "launch", + "mainClass": "RunTests", + "projectName": "RunTests" + } + ] +} diff --git a/packages/sonataflow-management-console-image/test-resources/tests/shell/sonataflow-devmode/.vscode/settings.json b/packages/sonataflow-management-console-image/test-resources/tests/shell/sonataflow-devmode/.vscode/settings.json new file mode 100644 index 00000000000..b57ea44670f --- /dev/null +++ b/packages/sonataflow-management-console-image/test-resources/tests/shell/sonataflow-devmode/.vscode/settings.json @@ -0,0 +1,13 @@ +{ + "java.import.gradle.enabled": false, + "java.import.maven.enabled": false, + "java.eclipse.downloadSources": true, + "files.exclude": { + "bin/": true, + ".eclipse/": true, + ".project": true, + ".classpath": true, + "build.gradle": true + }, + "java.completion.importOrder": ["", "javax", "java", "#"] +} diff --git a/packages/sonataflow-management-console-image/test-resources/tests/shell/sonataflow-devmode/resources/greet.sw.json b/packages/sonataflow-management-console-image/test-resources/tests/shell/sonataflow-devmode/resources/greet.sw.json new file mode 100644 index 00000000000..a619b3b8bc7 --- /dev/null +++ b/packages/sonataflow-management-console-image/test-resources/tests/shell/sonataflow-devmode/resources/greet.sw.json @@ -0,0 +1,67 @@ +{ + "id": "jsongreet", + "version": "1.0", + "name": "Greeting workflow", + "description": "JSON based greeting workflow", + "start": "ChooseOnLanguage", + "functions": [ + { + "name": "greetFunction", + "type": "custom", + "operation": "sysout" + } + ], + "states": [ + { + "name": "ChooseOnLanguage", + "type": "switch", + "dataConditions": [ + { + "condition": "${ .language == \"English\" }", + "transition": "GreetInEnglish" + }, + { + "condition": "${ .language == \"Spanish\" }", + "transition": "GreetInSpanish" + } + ], + "defaultCondition": { + "transition": "GreetInEnglish" + } + }, + { + "name": "GreetInEnglish", + "type": "inject", + "data": { + "greeting": "Hello from JSON Workflow, " + }, + "transition": "GreetPerson" + }, + { + "name": "GreetInSpanish", + "type": "inject", + "data": { + "greeting": "Saludos desde JSON Workflow, " + }, + "transition": "GreetPerson" + }, + { + "name": "GreetPerson", + "type": "operation", + "actions": [ + { + "name": "greetAction", + "functionRef": { + "refName": "greetFunction", + "arguments": { + "message": ".greeting+.name" + } + } + } + ], + "end": { + "terminate": true + } + } + ] +} diff --git a/packages/sonataflow-management-console-image/test-resources/tests/shell/sonataflow-devmode/src/RunTests.java b/packages/sonataflow-management-console-image/test-resources/tests/shell/sonataflow-devmode/src/RunTests.java new file mode 100644 index 00000000000..473be499be2 --- /dev/null +++ b/packages/sonataflow-management-console-image/test-resources/tests/shell/sonataflow-devmode/src/RunTests.java @@ -0,0 +1,105 @@ +///usr/bin/env jbang "$0" "$@" ; exit $? + +/* + * 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. + */ + +//DEPS org.slf4j:slf4j-simple:2.0.9 + +// Junit console to start the test engine: +//DEPS org.junit.platform:junit-platform-console:1.10.1 + +// engine to run the tests (tests are written with Junit5): +//DEPS org.junit.jupiter:junit-jupiter-engine:5.10.1 + +// testcontainers +//DEPS org.testcontainers:testcontainers:1.19.3 +//DEPS org.testcontainers:junit-jupiter:1.19.3 + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.net.http.HttpResponse.BodyHandlers; +import java.nio.file.Paths; +import java.time.Duration; +import org.junit.jupiter.api.Test; +import org.junit.platform.console.ConsoleLauncher; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.testcontainers.containers.BindMode; +import org.testcontainers.containers.GenericContainer; +import org.testcontainers.containers.output.Slf4jLogConsumer; +import org.testcontainers.containers.wait.strategy.Wait; +import org.testcontainers.junit.jupiter.Container; +import org.testcontainers.junit.jupiter.Testcontainers; + +@Testcontainers +public class RunTests { + + private static Logger LOGGER = LoggerFactory.getLogger(RunTests.class); + + private Slf4jLogConsumer logConsumer = new Slf4jLogConsumer(LOGGER); + + @Container + private GenericContainer devModeImage = new GenericContainer(getTestImage()) + .withEnv("MAVEN_ARGS_APPEND", "-Ddebug=false -Dquarkus.devservices.enabled=false") + .withFileSystemBind(getScriptDirPath() + "/resources", + "/home/kogito/serverless-workflow-project/src/main/resources", BindMode.READ_ONLY) + .withExposedPorts(8080) + .waitingFor(Wait.forHttp("/jsongreet")) + .withStartupTimeout(Duration.ofMinutes(2)) + .withLogConsumer(logConsumer); + + @Test + public void testBuiltContainerAnswerCorrectly() throws URISyntaxException, IOException, InterruptedException { + devModeImage.start(); + HttpRequest request = HttpRequest.newBuilder() + .uri(new URI( + "http://" + devModeImage.getHost() + ":" + devModeImage.getFirstMappedPort() + "/jsongreet")) + .header("Content-Type", "application/json") + .header("Accept", "application/json") + .timeout(Duration.ofSeconds(10)) + .POST(HttpRequest.BodyPublishers + .ofString("{\"workflowdata\" : {\"name\": \"John\", \"language\": \"English\"}}")) + .build(); + HttpResponse response = HttpClient.newHttpClient().send(request, BodyHandlers.ofString()); + assertEquals(201, response.statusCode()); + } + + public static void main(String... args) throws Exception { + ConsoleLauncher.main("--select-class=" + RunTests.class.getName(), + "--reports-dir=" + Paths.get(getOutputDir()).toString()); + } + + static String getTestImage() { + return System.getenv("TEST_IMAGE"); + } + + static String getOutputDir() { + return System.getenv("OUTPUT_DIR"); + } + + static String getScriptDirPath() { + return System.getenv("TESTS_SCRIPT_DIR_PATH"); + } +} \ No newline at end of file From 2290370652ed50551625e342479e9dca4f377529 Mon Sep 17 00:00:00 2001 From: fantonangeli Date: Thu, 5 Dec 2024 19:30:28 +0100 Subject: [PATCH 05/10] Calculate the ip --- packages/sonataflow-management-console-image/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/sonataflow-management-console-image/package.json b/packages/sonataflow-management-console-image/package.json index 5e472682a4f..bf3e6a591f1 100644 --- a/packages/sonataflow-management-console-image/package.json +++ b/packages/sonataflow-management-console-image/package.json @@ -33,7 +33,7 @@ "image:cekit:setup:env": ". ./node_modules/@kie-tools/python-venv/venv/bin/activate && cross-env KOGITO_IMAGE_REGISTRY=$(build-env sonataflowManagementConsoleImageEnv.registry) KOGITO_IMAGE_REGISTRY_ACCOUNT=$(build-env sonataflowManagementConsoleImageEnv.account) KOGITO_IMAGE_NAME=$(build-env sonataflowManagementConsoleImageEnv.name) KOGITO_IMAGE_TAG=$(build-env sonataflowManagementConsoleImageEnv.buildTag) QUARKUS_PLATFORM_VERSION=$(build-env versions.quarkus) KOGITO_VERSION=$(build-env versions.kogito) SONATAFLOW_MANAGEMENT_CONSOLE_PORT=$(build-env sonataflowManagementConsoleImageEnv.port)", "image:test": "run-script-if --ignore-errors \"$(build-env tests.ignoreFailures)\" --bool \"$(build-env endToEndTests.run)\" --then \"mkdir -p dist-dev/target/test/results\" \"run-script-os\" --finally \"cp -R dist-dev/target/test/results dist-tests-e2e/\"", "image:test:darwin:win32": "echo \"Tests skipped on macOS and Windows\"", - "image:test:linux": "pnpm copy:test-assets && pnpm image:cekit:setup:env SONATAFLOW_MANAGEMENT_CONSOLE_DATA_INDEX_ENDPOINT='http://host.docker.internal:4000/graphql' make -C ./dist-dev test-image" + "image:test:linux": "pnpm copy:test-assets && pnpm image:cekit:setup:env SONATAFLOW_MANAGEMENT_CONSOLE_DATA_INDEX_ENDPOINT='http://$(hostname -I | awk '{print $1}'):4000/graphql' make -C ./dist-dev test-image" }, "devDependencies": { "@kie-tools/image-env-to-json": "workspace:*", From 6e5507e264ad73b1b1f13d1a39db437bff7196ff Mon Sep 17 00:00:00 2001 From: fantonangeli Date: Mon, 9 Dec 2024 18:02:11 +0100 Subject: [PATCH 06/10] Fixes comment: https://github.com/apache/incubator-kie-tools/pull/2750#discussion_r1871906338 --- .gitignore | 1 - packages/sonataflow-management-console-image/.gitignore | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 packages/sonataflow-management-console-image/.gitignore diff --git a/.gitignore b/.gitignore index f265d137bbc..0fa740642fb 100644 --- a/.gitignore +++ b/.gitignore @@ -324,7 +324,6 @@ packages/scesim-marshaller/**/ts-gen !packages/sonataflow-image-common/test-resources/ !packages/sonataflow-builder-image/test-resources/ !packages/sonataflow-devmode-image/test-resources/ -!packages/sonataflow-management-console-image/test-resources/ # kogito-images: excluding test-resources !packages/kogito-data-index-ephemeral-image/test-resources/ diff --git a/packages/sonataflow-management-console-image/.gitignore b/packages/sonataflow-management-console-image/.gitignore new file mode 100644 index 00000000000..398b262e2cd --- /dev/null +++ b/packages/sonataflow-management-console-image/.gitignore @@ -0,0 +1,2 @@ +!packages/sonataflow-management-console-image/test-resources/ + From 891451b68468bcf0cc550e8a577222134110f241 Mon Sep 17 00:00:00 2001 From: fantonangeli Date: Tue, 10 Dec 2024 18:57:57 +0100 Subject: [PATCH 07/10] Setup tests and use of docker bridge ip --- .../package.json | 5 +- .../sonataflow-management-console.feature | 12 +- pnpm-lock.yaml | 234 +++++++++++++++--- 3 files changed, 203 insertions(+), 48 deletions(-) diff --git a/packages/sonataflow-management-console-image/package.json b/packages/sonataflow-management-console-image/package.json index bf3e6a591f1..f1b6ccd9906 100644 --- a/packages/sonataflow-management-console-image/package.json +++ b/packages/sonataflow-management-console-image/package.json @@ -33,18 +33,21 @@ "image:cekit:setup:env": ". ./node_modules/@kie-tools/python-venv/venv/bin/activate && cross-env KOGITO_IMAGE_REGISTRY=$(build-env sonataflowManagementConsoleImageEnv.registry) KOGITO_IMAGE_REGISTRY_ACCOUNT=$(build-env sonataflowManagementConsoleImageEnv.account) KOGITO_IMAGE_NAME=$(build-env sonataflowManagementConsoleImageEnv.name) KOGITO_IMAGE_TAG=$(build-env sonataflowManagementConsoleImageEnv.buildTag) QUARKUS_PLATFORM_VERSION=$(build-env versions.quarkus) KOGITO_VERSION=$(build-env versions.kogito) SONATAFLOW_MANAGEMENT_CONSOLE_PORT=$(build-env sonataflowManagementConsoleImageEnv.port)", "image:test": "run-script-if --ignore-errors \"$(build-env tests.ignoreFailures)\" --bool \"$(build-env endToEndTests.run)\" --then \"mkdir -p dist-dev/target/test/results\" \"run-script-os\" --finally \"cp -R dist-dev/target/test/results dist-tests-e2e/\"", "image:test:darwin:win32": "echo \"Tests skipped on macOS and Windows\"", - "image:test:linux": "pnpm copy:test-assets && pnpm image:cekit:setup:env SONATAFLOW_MANAGEMENT_CONSOLE_DATA_INDEX_ENDPOINT='http://$(hostname -I | awk '{print $1}'):4000/graphql' make -C ./dist-dev test-image" + "image:test:linux": "pnpm copy:test-assets && pnpm start-server-and-test start:sonataflow-dev-app http-get://0.0.0.0:4000/graphql 'pnpm image:cekit:setup:env make -C ./dist-dev test-image'", + "start:sonataflow-dev-app": "SONATAFLOW_DEV_APP_DELAY=0 npm --prefix ./node_modules/@kie-tools/sonataflow-dev-app run start" }, "devDependencies": { "@kie-tools/image-env-to-json": "workspace:*", "@kie-tools/python-venv": "workspace:*", "@kie-tools/root-env": "workspace:*", + "@kie-tools/sonataflow-dev-app": "workspace:*", "@kie-tools/sonataflow-image-common": "workspace:*", "@kie-tools/sonataflow-management-console-image-env": "workspace:*", "@kie-tools/sonataflow-management-console-webapp": "workspace:*", "cross-env": "^7.0.3", "rimraf": "^3.0.2", "run-script-os": "^1.1.6", + "start-server-and-test": "^2.0.3", "ts-json-schema-generator": "^1.1.2" } } diff --git a/packages/sonataflow-management-console-image/test-resources/tests/features/sonataflow-management-console.feature b/packages/sonataflow-management-console-image/test-resources/tests/features/sonataflow-management-console.feature index 33789d17012..f9fb23a1109 100644 --- a/packages/sonataflow-management-console-image/test-resources/tests/features/sonataflow-management-console.feature +++ b/packages/sonataflow-management-console-image/test-resources/tests/features/sonataflow-management-console.feature @@ -2,8 +2,7 @@ Feature: Serverless Workflow Management Console images Scenario: verify that the home page is served - When container is started with env - | variable | value | + When container is ready Then container log should contain httpd -D FOREGROUND Then check that page is served | property | value | @@ -14,16 +13,15 @@ Feature: Serverless Workflow Management Console images | expected_status_code | 200 | Scenario: Verify that the rewrite rule for /graphql is in httpd.conf - When container is started with env - | variable | value | + When container is ready Then container log should contain httpd -D FOREGROUND Then file /etc/httpd/conf/httpd.conf should contain /graphql Scenario: verify that the data-index is available from the container When container is started with env - | variable | value | - | SONATAFLOW_MANAGEMENT_CONSOLE_DATA_INDEX_ENDPOINT | http://192.168.138.171:4000/graphql | + | variable | value | + | SONATAFLOW_MANAGEMENT_CONSOLE_DATA_INDEX_ENDPOINT | http://172.18.0.1:4000/graphql | Then container log should contain httpd -D FOREGROUND Then check that page is served | property | value | @@ -32,6 +30,6 @@ Feature: Serverless Workflow Management Console images | request_method | POST | | request_body | { "query": "{ProcessInstances{ id } }" } | | content_type | application/json | - | wait | 15 | + | wait | 480 | | expected_status_code | 200 | | expected_phrase | "data":{"ProcessInstances | diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 217fdd48396..5f748777815 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3294,7 +3294,7 @@ importers: version: 7.6.13(react@17.0.2) '@storybook/addon-webpack5-compiler-babel': specifier: ^3.0.3 - version: 3.0.3(webpack@5.94.0(webpack-cli@4.10.0)) + version: 3.0.3(webpack@5.94.0(@swc/core@1.3.92)(esbuild@0.18.20)(webpack-cli@4.10.0)) '@storybook/blocks': specifier: ^7.3.2 version: 7.6.13(@types/react-dom@17.0.8)(@types/react@17.0.21)(encoding@0.1.13)(react-dom@17.0.2(react@17.0.2))(react@17.0.2) @@ -3309,7 +3309,7 @@ importers: version: 7.6.13(encoding@0.1.13)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(typescript@5.5.3) '@storybook/react-webpack5': specifier: ^7.3.2 - version: 7.6.13(@babel/core@7.23.0)(@types/webpack@4.41.39)(encoding@0.1.13)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.26.1)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0))(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4) + version: 7.6.13(@babel/core@7.23.0)(@swc/core@1.3.92)(@types/webpack@4.41.39)(encoding@0.1.13)(esbuild@0.18.20)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.26.1)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0))(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4) '@types/d3-drag': specifier: ^3.0.3 version: 3.0.7 @@ -3339,7 +3339,7 @@ importers: version: 8.3.0 copy-webpack-plugin: specifier: ^11.0.0 - version: 11.0.0(webpack@5.94.0(webpack-cli@4.10.0)) + version: 11.0.0(webpack@5.94.0(@swc/core@1.3.92)(esbuild@0.18.20)(webpack-cli@4.10.0)) copyfiles: specifier: ^2.4.1 version: 2.4.1 @@ -3351,16 +3351,16 @@ importers: version: 1.1.9 file-loader: specifier: ^6.2.0 - version: 6.2.0(webpack@5.94.0(webpack-cli@4.10.0)) + version: 6.2.0(webpack@5.94.0(@swc/core@1.3.92)(esbuild@0.18.20)(webpack-cli@4.10.0)) jest: specifier: ^29.7.0 - version: 29.7.0(@types/node@20.14.2)(node-notifier@8.0.2)(ts-node@10.9.2(@types/node@20.14.2)(typescript@5.5.3)) + version: 29.7.0(@types/node@20.14.2)(node-notifier@8.0.2)(ts-node@10.9.2(@swc/core@1.3.92)(@types/node@20.14.2)(typescript@5.5.3)) jest-junit: specifier: ^16.0.0 version: 16.0.0 jest-when: specifier: ^3.6.0 - version: 3.6.0(jest@29.7.0(@types/node@20.14.2)(node-notifier@8.0.2)(ts-node@10.9.2(@types/node@20.14.2)(typescript@5.5.3))) + version: 3.6.0(jest@29.7.0(@types/node@20.14.2)(node-notifier@8.0.2)(ts-node@10.9.2(@swc/core@1.3.92)(@types/node@20.14.2)(typescript@5.5.3))) lodash: specifier: ^4.17.21 version: 4.17.21 @@ -3378,13 +3378,13 @@ importers: version: 7.6.13(encoding@0.1.13) ts-jest: specifier: ^29.1.5 - version: 29.1.5(@babel/core@7.23.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.23.0))(jest@29.7.0(@types/node@20.14.2)(node-notifier@8.0.2)(ts-node@10.9.2(@types/node@20.14.2)(typescript@5.5.3)))(typescript@5.5.3) + version: 29.1.5(@babel/core@7.23.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.23.0))(esbuild@0.18.20)(jest@29.7.0(@types/node@20.14.2)(node-notifier@8.0.2)(ts-node@10.9.2(@swc/core@1.3.92)(@types/node@20.14.2)(typescript@5.5.3)))(typescript@5.5.3) typescript: specifier: ^5.5.3 version: 5.5.3 webpack: specifier: ^5.94.0 - version: 5.94.0(webpack-cli@4.10.0) + version: 5.94.0(@swc/core@1.3.92)(esbuild@0.18.20)(webpack-cli@4.10.0) webpack-cli: specifier: ^4.10.0 version: 4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0) @@ -3550,7 +3550,7 @@ importers: version: 7.6.13(react@17.0.2) '@storybook/addon-webpack5-compiler-babel': specifier: ^3.0.3 - version: 3.0.3(webpack@5.94.0(@swc/core@1.3.92)(esbuild@0.18.20)(webpack-cli@4.10.0)) + version: 3.0.3(webpack@5.94.0(webpack-cli@4.10.0)) '@storybook/blocks': specifier: ^7.3.2 version: 7.6.13(@types/react-dom@17.0.8)(@types/react@17.0.21)(encoding@0.1.13)(react-dom@17.0.2(react@17.0.2))(react@17.0.2) @@ -3565,7 +3565,7 @@ importers: version: 7.6.13(encoding@0.1.13)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(typescript@5.5.3) '@storybook/react-webpack5': specifier: ^7.3.2 - version: 7.6.13(@babel/core@7.23.9)(@swc/core@1.3.92)(@types/webpack@4.41.39)(encoding@0.1.13)(esbuild@0.18.20)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.26.1)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0))(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4) + version: 7.6.13(@babel/core@7.23.9)(@types/webpack@4.41.39)(encoding@0.1.13)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.26.1)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0))(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4) '@types/jest-when': specifier: ^3.5.5 version: 3.5.5 @@ -3598,7 +3598,7 @@ importers: version: 9.5.1 html-webpack-plugin: specifier: ^5.3.2 - version: 5.5.3(webpack@5.94.0(@swc/core@1.3.92)(esbuild@0.18.20)(webpack-cli@4.10.0)) + version: 5.5.3(webpack@5.94.0(webpack-cli@4.10.0)) junit-report-merger: specifier: ^4.0.0 version: 4.0.0 @@ -3619,7 +3619,7 @@ importers: version: 0.11.10 raw-loader: specifier: ^4.0.2 - version: 4.0.2(webpack@5.94.0(@swc/core@1.3.92)(esbuild@0.18.20)(webpack-cli@4.10.0)) + version: 4.0.2(webpack@5.94.0(webpack-cli@4.10.0)) react: specifier: ^17.0.2 version: 17.0.2 @@ -3640,7 +3640,7 @@ importers: version: 5.5.3 webpack: specifier: ^5.94.0 - version: 5.94.0(@swc/core@1.3.92)(esbuild@0.18.20)(webpack-cli@4.10.0) + version: 5.94.0(webpack-cli@4.10.0) webpack-bundle-analyzer: specifier: ^4.10.2 version: 4.10.2 @@ -11218,6 +11218,9 @@ importers: '@kie-tools/root-env': specifier: workspace:* version: link:../root-env + '@kie-tools/sonataflow-dev-app': + specifier: workspace:* + version: link:../sonataflow-dev-app '@kie-tools/sonataflow-image-common': specifier: workspace:* version: link:../sonataflow-image-common @@ -11236,6 +11239,9 @@ importers: run-script-os: specifier: ^1.1.6 version: 1.1.6 + start-server-and-test: + specifier: ^2.0.3 + version: 2.0.3 ts-json-schema-generator: specifier: ^1.1.2 version: 1.1.2 @@ -40199,7 +40205,7 @@ snapshots: - uglify-js - webpack-cli - '@storybook/builder-webpack5@7.6.13(encoding@0.1.13)(esbuild@0.18.20)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0))': + '@storybook/builder-webpack5@7.6.13(encoding@0.1.13)(esbuild@0.18.20)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0))': dependencies: '@babel/core': 7.24.9 '@storybook/channels': 7.6.13 @@ -40249,6 +40255,56 @@ snapshots: - uglify-js - webpack-cli + '@storybook/builder-webpack5@7.6.13(encoding@0.1.13)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0))': + dependencies: + '@babel/core': 7.24.9 + '@storybook/channels': 7.6.13 + '@storybook/client-logger': 7.6.13 + '@storybook/core-common': 7.6.13(encoding@0.1.13) + '@storybook/core-events': 7.6.13 + '@storybook/core-webpack': 7.6.13(encoding@0.1.13) + '@storybook/node-logger': 7.6.13 + '@storybook/preview': 7.6.13 + '@storybook/preview-api': 7.6.13 + '@swc/core': 1.3.92 + '@types/node': 18.17.18 + '@types/semver': 7.5.2 + babel-loader: 9.1.3(@babel/core@7.24.9)(webpack@5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0))) + browser-assert: 1.2.1 + case-sensitive-paths-webpack-plugin: 2.4.0 + cjs-module-lexer: 1.2.3 + constants-browserify: 1.0.0 + css-loader: 6.7.1(webpack@5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0))) + es-module-lexer: 1.4.1 + express: 4.21.1 + fork-ts-checker-webpack-plugin: 8.0.0(typescript@5.5.3)(webpack@5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0))) + fs-extra: 11.1.1 + html-webpack-plugin: 5.5.3(webpack@5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0))) + magic-string: 0.30.7 + path-browserify: 1.0.1 + process: 0.11.10 + semver: 7.5.4 + style-loader: 3.3.3(webpack@5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0))) + swc-loader: 0.2.3(@swc/core@1.3.92)(webpack@5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0))) + terser-webpack-plugin: 5.3.10(@swc/core@1.3.92)(webpack@5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0))) + ts-dedent: 2.2.0 + url: 0.11.3 + util: 0.12.5 + util-deprecate: 1.0.2 + webpack: 5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0)) + webpack-dev-middleware: 6.1.1(webpack@5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0))) + webpack-hot-middleware: 2.25.4 + webpack-virtual-modules: 0.5.0 + optionalDependencies: + typescript: 5.5.3 + transitivePeerDependencies: + - '@swc/helpers' + - encoding + - esbuild + - supports-color + - uglify-js + - webpack-cli + '@storybook/builder-webpack5@7.6.13(encoding@0.1.13)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0))': dependencies: '@babel/core': 7.24.9 @@ -41083,16 +41139,16 @@ snapshots: - webpack-hot-middleware - webpack-plugin-serve - '@storybook/preset-react-webpack@7.6.13(@babel/core@7.23.0)(@types/webpack@4.41.39)(encoding@0.1.13)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.26.1)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0))(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4)': + '@storybook/preset-react-webpack@7.6.13(@babel/core@7.23.0)(@swc/core@1.3.92)(@types/webpack@4.41.39)(encoding@0.1.13)(esbuild@0.18.20)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.26.1)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0))(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4)': dependencies: '@babel/preset-flow': 7.22.15(@babel/core@7.23.0) '@babel/preset-react': 7.22.15(@babel/core@7.23.0) - '@pmmmwh/react-refresh-webpack-plugin': 0.5.11(@types/webpack@4.41.39)(react-refresh@0.14.0)(type-fest@4.26.1)(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4)(webpack@5.94.0(webpack-cli@4.10.0)) + '@pmmmwh/react-refresh-webpack-plugin': 0.5.11(@types/webpack@4.41.39)(react-refresh@0.14.0)(type-fest@4.26.1)(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4)(webpack@5.94.0(@swc/core@1.3.92)(esbuild@0.18.20)(webpack-cli@4.10.0)) '@storybook/core-webpack': 7.6.13(encoding@0.1.13) '@storybook/docs-tools': 7.6.13(encoding@0.1.13) '@storybook/node-logger': 7.6.13 '@storybook/react': 7.6.13(encoding@0.1.13)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(typescript@5.5.3) - '@storybook/react-docgen-typescript-plugin': 1.0.6--canary.9.0c3f3b7.0(typescript@5.5.3)(webpack@5.94.0(webpack-cli@4.10.0)) + '@storybook/react-docgen-typescript-plugin': 1.0.6--canary.9.0c3f3b7.0(typescript@5.5.3)(webpack@5.94.0(@swc/core@1.3.92)(esbuild@0.18.20)(webpack-cli@4.10.0)) '@types/node': 18.17.18 '@types/semver': 7.5.2 babel-plugin-add-react-displayname: 0.0.5 @@ -41103,7 +41159,7 @@ snapshots: react-dom: 17.0.2(react@17.0.2) react-refresh: 0.14.0 semver: 7.5.4 - webpack: 5.94.0(webpack-cli@4.10.0) + webpack: 5.94.0(@swc/core@1.3.92)(esbuild@0.18.20)(webpack-cli@4.10.0) optionalDependencies: '@babel/core': 7.23.0 typescript: 5.5.3 @@ -41121,16 +41177,16 @@ snapshots: - webpack-hot-middleware - webpack-plugin-serve - '@storybook/preset-react-webpack@7.6.13(@babel/core@7.23.9)(@swc/core@1.3.92)(@types/webpack@4.41.39)(encoding@0.1.13)(esbuild@0.18.20)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.26.1)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0))(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4)': + '@storybook/preset-react-webpack@7.6.13(@babel/core@7.23.9)(@types/webpack@4.41.39)(encoding@0.1.13)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.26.1)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0))(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4)': dependencies: '@babel/preset-flow': 7.22.15(@babel/core@7.23.9) '@babel/preset-react': 7.22.15(@babel/core@7.23.9) - '@pmmmwh/react-refresh-webpack-plugin': 0.5.11(@types/webpack@4.41.39)(react-refresh@0.14.0)(type-fest@4.26.1)(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4)(webpack@5.94.0(@swc/core@1.3.92)(esbuild@0.18.20)(webpack-cli@4.10.0)) + '@pmmmwh/react-refresh-webpack-plugin': 0.5.11(@types/webpack@4.41.39)(react-refresh@0.14.0)(type-fest@4.26.1)(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4)(webpack@5.94.0(webpack-cli@4.10.0)) '@storybook/core-webpack': 7.6.13(encoding@0.1.13) '@storybook/docs-tools': 7.6.13(encoding@0.1.13) '@storybook/node-logger': 7.6.13 '@storybook/react': 7.6.13(encoding@0.1.13)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(typescript@5.5.3) - '@storybook/react-docgen-typescript-plugin': 1.0.6--canary.9.0c3f3b7.0(typescript@5.5.3)(webpack@5.94.0(@swc/core@1.3.92)(esbuild@0.18.20)(webpack-cli@4.10.0)) + '@storybook/react-docgen-typescript-plugin': 1.0.6--canary.9.0c3f3b7.0(typescript@5.5.3)(webpack@5.94.0(webpack-cli@4.10.0)) '@types/node': 18.17.18 '@types/semver': 7.5.2 babel-plugin-add-react-displayname: 0.0.5 @@ -41141,7 +41197,7 @@ snapshots: react-dom: 17.0.2(react@17.0.2) react-refresh: 0.14.0 semver: 7.5.4 - webpack: 5.94.0(@swc/core@1.3.92)(esbuild@0.18.20)(webpack-cli@4.10.0) + webpack: 5.94.0(webpack-cli@4.10.0) optionalDependencies: '@babel/core': 7.23.9 typescript: 5.5.3 @@ -41331,10 +41387,10 @@ snapshots: - webpack-hot-middleware - webpack-plugin-serve - '@storybook/react-webpack5@7.6.13(@babel/core@7.23.0)(@types/webpack@4.41.39)(encoding@0.1.13)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.26.1)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0))(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4)': + '@storybook/react-webpack5@7.6.13(@babel/core@7.23.0)(@swc/core@1.3.92)(@types/webpack@4.41.39)(encoding@0.1.13)(esbuild@0.18.20)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.26.1)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0))(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4)': dependencies: - '@storybook/builder-webpack5': 7.6.13(encoding@0.1.13)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0)) - '@storybook/preset-react-webpack': 7.6.13(@babel/core@7.23.0)(@types/webpack@4.41.39)(encoding@0.1.13)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.26.1)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0))(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4) + '@storybook/builder-webpack5': 7.6.13(encoding@0.1.13)(esbuild@0.18.20)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0)) + '@storybook/preset-react-webpack': 7.6.13(@babel/core@7.23.0)(@swc/core@1.3.92)(@types/webpack@4.41.39)(encoding@0.1.13)(esbuild@0.18.20)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.26.1)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0))(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4) '@storybook/react': 7.6.13(encoding@0.1.13)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(typescript@5.5.3) '@types/node': 18.17.18 react: 17.0.2 @@ -41357,10 +41413,10 @@ snapshots: - webpack-hot-middleware - webpack-plugin-serve - '@storybook/react-webpack5@7.6.13(@babel/core@7.23.9)(@swc/core@1.3.92)(@types/webpack@4.41.39)(encoding@0.1.13)(esbuild@0.18.20)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.26.1)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0))(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4)': + '@storybook/react-webpack5@7.6.13(@babel/core@7.23.9)(@types/webpack@4.41.39)(encoding@0.1.13)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.26.1)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0))(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4)': dependencies: - '@storybook/builder-webpack5': 7.6.13(encoding@0.1.13)(esbuild@0.18.20)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0)) - '@storybook/preset-react-webpack': 7.6.13(@babel/core@7.23.9)(@swc/core@1.3.92)(@types/webpack@4.41.39)(encoding@0.1.13)(esbuild@0.18.20)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.26.1)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0))(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4) + '@storybook/builder-webpack5': 7.6.13(encoding@0.1.13)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0)) + '@storybook/preset-react-webpack': 7.6.13(@babel/core@7.23.9)(@types/webpack@4.41.39)(encoding@0.1.13)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(type-fest@4.26.1)(typescript@5.5.3)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0))(webpack-dev-server@4.15.1(webpack-cli@4.10.0)(webpack@5.94.0))(webpack-hot-middleware@2.25.4) '@storybook/react': 7.6.13(encoding@0.1.13)(react-dom@17.0.2(react@17.0.2))(react@17.0.2)(typescript@5.5.3) '@types/node': 18.17.18 react: 17.0.2 @@ -43968,6 +44024,13 @@ snapshots: schema-utils: 4.2.0 webpack: 5.94.0(@swc/core@1.3.92)(esbuild@0.18.20) + babel-loader@9.1.3(@babel/core@7.24.9)(webpack@5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0))): + dependencies: + '@babel/core': 7.24.9 + find-cache-dir: 4.0.0 + schema-utils: 4.2.0 + webpack: 5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0)) + babel-loader@9.1.3(@babel/core@7.24.9)(webpack@5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0))): dependencies: '@babel/core': 7.24.9 @@ -45844,6 +45907,18 @@ snapshots: semver: 7.6.2 webpack: 5.94.0(@swc/core@1.3.92)(esbuild@0.18.20) + css-loader@6.7.1(webpack@5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0))): + dependencies: + icss-utils: 5.1.0(postcss@8.4.38) + postcss: 8.4.38 + postcss-modules-extract-imports: 3.0.0(postcss@8.4.38) + postcss-modules-local-by-default: 4.0.0(postcss@8.4.38) + postcss-modules-scope: 3.0.0(postcss@8.4.38) + postcss-modules-values: 4.0.0(postcss@8.4.38) + postcss-value-parser: 4.2.0 + semver: 7.6.2 + webpack: 5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0)) + css-loader@6.7.1(webpack@5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0))): dependencies: icss-utils: 5.1.0(postcss@8.4.38) @@ -48091,6 +48166,23 @@ snapshots: typescript: 5.5.3 webpack: 5.94.0(@swc/core@1.3.92)(esbuild@0.18.20) + fork-ts-checker-webpack-plugin@8.0.0(typescript@5.5.3)(webpack@5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0))): + dependencies: + '@babel/code-frame': 7.23.5 + chalk: 4.1.2 + chokidar: 3.5.3 + cosmiconfig: 7.0.1 + deepmerge: 4.2.2 + fs-extra: 10.1.0 + memfs: 3.5.1 + minimatch: 3.1.2 + node-abort-controller: 3.1.1 + schema-utils: 3.3.0 + semver: 7.5.4 + tapable: 2.2.1 + typescript: 5.5.3 + webpack: 5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0)) + fork-ts-checker-webpack-plugin@8.0.0(typescript@5.5.3)(webpack@5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0))): dependencies: '@babel/code-frame': 7.23.5 @@ -48773,6 +48865,15 @@ snapshots: tapable: 2.2.1 webpack: 5.94.0(@swc/core@1.3.92)(esbuild@0.18.20) + html-webpack-plugin@5.5.3(webpack@5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0))): + dependencies: + '@types/html-minifier-terser': 6.1.0 + html-minifier-terser: 6.1.0 + lodash: 4.17.21 + pretty-error: 4.0.0 + tapable: 2.2.1 + webpack: 5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0)) + html-webpack-plugin@5.5.3(webpack@5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0))): dependencies: '@types/html-minifier-terser': 6.1.0 @@ -50283,10 +50384,6 @@ snapshots: dependencies: jest: 29.7.0(@types/node@20.14.2)(node-notifier@8.0.2)(ts-node@10.9.2(@swc/core@1.3.92)(@types/node@20.14.2)(typescript@5.5.3)) - jest-when@3.6.0(jest@29.7.0(@types/node@20.14.2)(node-notifier@8.0.2)(ts-node@10.9.2(@types/node@20.14.2)(typescript@5.5.3))): - dependencies: - jest: 29.7.0(@types/node@20.14.2)(node-notifier@8.0.2)(ts-node@10.9.2(@types/node@20.14.2)(typescript@5.5.3)) - jest-when@3.6.0(jest@29.7.0(@types/node@22.5.2)(node-notifier@8.0.2)(ts-node@10.9.2(@swc/core@1.3.92)(@types/node@22.5.2)(typescript@5.5.3))): dependencies: jest: 29.7.0(@types/node@22.5.2)(node-notifier@8.0.2)(ts-node@10.9.2(@swc/core@1.3.92)(@types/node@22.5.2)(typescript@5.5.3)) @@ -53302,12 +53399,6 @@ snapshots: iconv-lite: 0.4.24 unpipe: 1.0.0 - raw-loader@4.0.2(webpack@5.94.0(@swc/core@1.3.92)(esbuild@0.18.20)(webpack-cli@4.10.0)): - dependencies: - loader-utils: 2.0.4 - schema-utils: 3.3.0 - webpack: 5.94.0(@swc/core@1.3.92)(esbuild@0.18.20)(webpack-cli@4.10.0) - raw-loader@4.0.2(webpack@5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0)): dependencies: loader-utils: 2.0.4 @@ -55271,6 +55362,10 @@ snapshots: dependencies: webpack: 5.94.0(@swc/core@1.3.92)(esbuild@0.18.20) + style-loader@3.3.3(webpack@5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0))): + dependencies: + webpack: 5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0)) + style-loader@3.3.3(webpack@5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0))): dependencies: webpack: 5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0)) @@ -55380,6 +55475,11 @@ snapshots: '@swc/core': 1.3.92 webpack: 5.94.0(@swc/core@1.3.92)(esbuild@0.18.20) + swc-loader@0.2.3(@swc/core@1.3.92)(webpack@5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0))): + dependencies: + '@swc/core': 1.3.92 + webpack: 5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0)) + swc-loader@0.2.3(@swc/core@1.3.92)(webpack@5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0))): dependencies: '@swc/core': 1.3.92 @@ -55530,6 +55630,17 @@ snapshots: '@swc/core': 1.3.92 esbuild: 0.18.20 + terser-webpack-plugin@5.3.10(@swc/core@1.3.92)(webpack@5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0))): + dependencies: + '@jridgewell/trace-mapping': 0.3.25 + jest-worker: 27.5.1 + schema-utils: 3.3.0 + serialize-javascript: 6.0.2 + terser: 5.31.6 + webpack: 5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0)) + optionalDependencies: + '@swc/core': 1.3.92 + terser-webpack-plugin@5.3.10(@swc/core@1.3.92)(webpack@5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0))): dependencies: '@jridgewell/trace-mapping': 0.3.25 @@ -55872,11 +55983,11 @@ snapshots: '@jest/types': 29.6.3 babel-jest: 29.7.0(@babel/core@7.18.10) - ts-jest@29.1.5(@babel/core@7.23.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.23.0))(jest@29.7.0(@types/node@20.14.2)(node-notifier@8.0.2)(ts-node@10.9.2(@types/node@20.14.2)(typescript@5.5.3)))(typescript@5.5.3): + ts-jest@29.1.5(@babel/core@7.23.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.23.0))(esbuild@0.18.20)(jest@29.7.0(@types/node@20.14.2)(node-notifier@8.0.2)(ts-node@10.9.2(@swc/core@1.3.92)(@types/node@20.14.2)(typescript@5.5.3)))(typescript@5.5.3): dependencies: bs-logger: 0.2.6 fast-json-stable-stringify: 2.1.0 - jest: 29.7.0(@types/node@20.14.2)(node-notifier@8.0.2)(ts-node@10.9.2(@types/node@20.14.2)(typescript@5.5.3)) + jest: 29.7.0(@types/node@20.14.2)(node-notifier@8.0.2)(ts-node@10.9.2(@swc/core@1.3.92)(@types/node@20.14.2)(typescript@5.5.3)) jest-util: 29.7.0 json5: 2.2.3 lodash.memoize: 4.1.2 @@ -55889,6 +56000,7 @@ snapshots: '@jest/transform': 29.7.0 '@jest/types': 29.6.3 babel-jest: 29.7.0(@babel/core@7.23.0) + esbuild: 0.18.20 ts-jest@29.1.5(@babel/core@7.23.0)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.23.0))(jest@29.7.0(@types/node@22.5.2)(node-notifier@8.0.2)(ts-node@10.9.2(@swc/core@1.3.92)(@types/node@22.5.2)(typescript@5.5.3)))(typescript@5.5.3): dependencies: @@ -57142,6 +57254,16 @@ snapshots: optionalDependencies: webpack: 5.94.0(@swc/core@1.3.92)(esbuild@0.18.20) + webpack-dev-middleware@6.1.1(webpack@5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0))): + dependencies: + colorette: 2.0.20 + memfs: 3.5.1 + mime-types: 2.1.35 + range-parser: 1.2.1 + schema-utils: 4.2.0 + optionalDependencies: + webpack: 5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0)) + webpack-dev-middleware@6.1.1(webpack@5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0))): dependencies: colorette: 2.0.20 @@ -57441,6 +57563,38 @@ snapshots: - esbuild - uglify-js + webpack@5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0)): + dependencies: + '@types/estree': 1.0.5 + '@webassemblyjs/ast': 1.12.1 + '@webassemblyjs/wasm-edit': 1.12.1 + '@webassemblyjs/wasm-parser': 1.12.1 + acorn: 8.12.1 + acorn-import-attributes: 1.9.5(acorn@8.12.1) + browserslist: 4.23.3 + chrome-trace-event: 1.0.4 + enhanced-resolve: 5.17.1 + es-module-lexer: 1.5.4 + eslint-scope: 5.1.1 + events: 3.3.0 + glob-to-regexp: 0.4.1 + graceful-fs: 4.2.11 + json-parse-even-better-errors: 2.3.1 + loader-runner: 4.3.0 + mime-types: 2.1.35 + neo-async: 2.6.2 + schema-utils: 3.3.0 + tapable: 2.2.1 + terser-webpack-plugin: 5.3.10(@swc/core@1.3.92)(webpack@5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0))) + watchpack: 2.4.2 + webpack-sources: 3.2.3 + optionalDependencies: + webpack-cli: 4.10.0(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@4.15.1)(webpack@5.94.0) + transitivePeerDependencies: + - '@swc/core' + - esbuild + - uglify-js + webpack@5.94.0(@swc/core@1.3.92)(webpack-cli@4.10.0(webpack-dev-server@4.15.1)(webpack@5.94.0)): dependencies: '@types/estree': 1.0.5 From d84e4db8b5b30237cfca9783ca79c4d35fe51465 Mon Sep 17 00:00:00 2001 From: fantonangeli Date: Tue, 10 Dec 2024 19:14:51 +0100 Subject: [PATCH 08/10] Excluded feature file --- .rat-excludes | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.rat-excludes b/.rat-excludes index 5e6e5f14ca3..c1f815d54c8 100644 --- a/.rat-excludes +++ b/.rat-excludes @@ -977,6 +977,8 @@ common.py # packages/sonataflow-management-console-webapp/resources/monitoring-webapp/MonitoringReport.dash.yml MonitoringReport.dash.yml # packages/sonataflow-management-console-webapp/resources/monitoring-webapp/WorkflowDetails.dash.yml +sonataflow-management-console.feature +# packages/sonataflow-management-console-image/test-resources/tests/features/sonataflow-management-console.feature WorkflowDetails.dash.yml # packages/sonataflow-operator/PROJECT PROJECT From 98342449845efe1308e205d8e11b863d6ff409f2 Mon Sep 17 00:00:00 2001 From: fantonangeli Date: Mon, 16 Dec 2024 23:14:19 +0100 Subject: [PATCH 09/10] Fix test image tag --- .../incubator-kie-sonataflow-management-console-image.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/sonataflow-management-console-image/resources/incubator-kie-sonataflow-management-console-image.yaml b/packages/sonataflow-management-console-image/resources/incubator-kie-sonataflow-management-console-image.yaml index 78817971c6f..024b1375ab4 100644 --- a/packages/sonataflow-management-console-image/resources/incubator-kie-sonataflow-management-console-image.yaml +++ b/packages/sonataflow-management-console-image/resources/incubator-kie-sonataflow-management-console-image.yaml @@ -18,7 +18,7 @@ # - name: "docker.io/apache/incubator-kie-sonataflow-management-console" from: "registry.access.redhat.com/ubi9/httpd-24:1-336.1725850633" - version: "0.0.0" + version: "main" description: "SonataFlow Management Console Image" labels: From c92514a1ea027a8b66cbe8fbba8ee4b83726952e Mon Sep 17 00:00:00 2001 From: fantonangeli Date: Thu, 19 Dec 2024 11:38:08 +0100 Subject: [PATCH 10/10] Dynamically set DOCKER_HOST with envsubst --- packages/sonataflow-management-console-image/package.json | 2 +- .../modules/sonataflow/management-console/module.yaml | 2 +- .../tests/features/sonataflow-management-console.feature | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/sonataflow-management-console-image/package.json b/packages/sonataflow-management-console-image/package.json index e199ba4c6db..ebf952d2df5 100644 --- a/packages/sonataflow-management-console-image/package.json +++ b/packages/sonataflow-management-console-image/package.json @@ -21,7 +21,7 @@ "copy:image-env-to-json:linux:darwin": "cp ./node_modules/@kie-tools/image-env-to-json/dist/linux/image-env-to-json-standalone ./dist-dev/", "copy:image-env-to-json:win32": "pnpm powershell \"Copy-Item ./node_modules/@kie-tools/image-env-to-json/dist/linux/image-env-to-json-standalone ./dist-dev/\"", "copy:test-assets": "run-script-os", - "copy:test-assets:linux:darwin": "cp -R test-resources/* dist-dev", + "copy:test-assets:linux:darwin": "cp -R test-resources/* dist-dev && DOCKER_HOST=\"$(hostname -I | awk '{print $1}')\" envsubst < test-resources/tests/features/sonataflow-management-console.feature > dist-dev/tests/features/sonataflow-management-console.feature", "copy:webapp-assets": "run-script-os", "copy:webapp-assets:linux:darwin": "cp -R ./node_modules/@kie-tools/sonataflow-management-console-webapp/dist/ ./dist-dev/sonataflow-management-console-webapp", "copy:webapp-assets:win32": "pnpm powershell \"Copy-Item -R ./node_modules/@kie-tools/sonataflow-management-console-webapp/dist/ ./dist-dev/sonataflow-management-console-webapp\"", diff --git a/packages/sonataflow-management-console-image/resources/modules/sonataflow/management-console/module.yaml b/packages/sonataflow-management-console-image/resources/modules/sonataflow/management-console/module.yaml index 34b627dfc6a..ece9991fdd8 100644 --- a/packages/sonataflow-management-console-image/resources/modules/sonataflow/management-console/module.yaml +++ b/packages/sonataflow-management-console-image/resources/modules/sonataflow/management-console/module.yaml @@ -18,7 +18,7 @@ # schema_version: 1 name: org.kie.sonataflow.management.console -version: "0.0.0" +version: "main" description: "SonataFlow Management Console Launch Scripts and Configurations" execute: diff --git a/packages/sonataflow-management-console-image/test-resources/tests/features/sonataflow-management-console.feature b/packages/sonataflow-management-console-image/test-resources/tests/features/sonataflow-management-console.feature index f9fb23a1109..bf01ccbe90b 100644 --- a/packages/sonataflow-management-console-image/test-resources/tests/features/sonataflow-management-console.feature +++ b/packages/sonataflow-management-console-image/test-resources/tests/features/sonataflow-management-console.feature @@ -21,7 +21,7 @@ Feature: Serverless Workflow Management Console images Scenario: verify that the data-index is available from the container When container is started with env | variable | value | - | SONATAFLOW_MANAGEMENT_CONSOLE_DATA_INDEX_ENDPOINT | http://172.18.0.1:4000/graphql | + | SONATAFLOW_MANAGEMENT_CONSOLE_DATA_INDEX_ENDPOINT | http://${DOCKER_HOST}:4000/graphql | Then container log should contain httpd -D FOREGROUND Then check that page is served | property | value | @@ -30,6 +30,6 @@ Feature: Serverless Workflow Management Console images | request_method | POST | | request_body | { "query": "{ProcessInstances{ id } }" } | | content_type | application/json | - | wait | 480 | + | wait | 480 | | expected_status_code | 200 | | expected_phrase | "data":{"ProcessInstances |