From acdf77bf0736c21d3435c0404db7a45638817933 Mon Sep 17 00:00:00 2001 From: sanketpathak Date: Wed, 8 Apr 2026 11:48:41 +0530 Subject: [PATCH] add two new workflows named test-object-uiprops and sample-retry-test --- .github/workflows/sample-retry-test.yaml | 18 +++++ .../workflows/test-object-type-uiprops.yaml | 18 +++++ Makefile | 2 + README.md | 2 + deploy/charts/sample-retry-test/.helmignore | 23 ++++++ deploy/charts/sample-retry-test/Chart.yaml | 17 ++++ deploy/charts/sample-retry-test/README.md | 31 ++++++++ .../01-configmap_sample-retry-test-props.yaml | 22 ++++++ ...1-sample-retry-test-resources-schemas.yaml | 62 +++++++++++++++ .../03-sonataflow_sample-retry-test.yaml | 56 ++++++++++++++ .../sample-retry-test/values.schema.json | 10 +++ .../test-object-type-uiprops/.helmignore | 23 ++++++ .../test-object-type-uiprops/Chart.yaml | 17 ++++ .../charts/test-object-type-uiprops/README.md | 34 ++++++++ ...figmap_test-object-type-uiprops-props.yaml | 22 ++++++ ...object-type-uiprops-resources-schemas.yaml | 65 ++++++++++++++++ ...3-sonataflow_test-object-type-uiprops.yaml | 77 +++++++++++++++++++ .../values.schema.json | 10 +++ .../sample-retry-test/application.properties | 8 ++ workflows/sample-retry-test/argfile.conf | 3 + .../01-configmap_sample-retry-test-props.yaml | 22 ++++++ ...1-sample-retry-test-resources-schemas.yaml | 62 +++++++++++++++ .../03-sonataflow_sample-retry-test.yaml | 56 ++++++++++++++ .../sample-retry-test.sw.yaml | 18 +++++ .../sample-retry-test.input-schema.json | 42 ++++++++++ .../schemas/workflow-output-schema.json | 12 +++ .../application.properties | 8 ++ .../test-object-type-uiprops/argfile.conf | 3 + ...figmap_test-object-type-uiprops-props.yaml | 22 ++++++ ...object-type-uiprops-resources-schemas.yaml | 65 ++++++++++++++++ ...3-sonataflow_test-object-type-uiprops.yaml | 77 +++++++++++++++++++ ...test-object-type-uiprops__main-schema.json | 45 +++++++++++ .../schemas/workflow-output-schema.json | 12 +++ .../test-object-type-uiprops.sw.yaml | 32 ++++++++ 34 files changed, 996 insertions(+) create mode 100644 .github/workflows/sample-retry-test.yaml create mode 100644 .github/workflows/test-object-type-uiprops.yaml create mode 100644 deploy/charts/sample-retry-test/.helmignore create mode 100644 deploy/charts/sample-retry-test/Chart.yaml create mode 100644 deploy/charts/sample-retry-test/README.md create mode 100644 deploy/charts/sample-retry-test/templates/01-configmap_sample-retry-test-props.yaml create mode 100644 deploy/charts/sample-retry-test/templates/02-configmap_01-sample-retry-test-resources-schemas.yaml create mode 100644 deploy/charts/sample-retry-test/templates/03-sonataflow_sample-retry-test.yaml create mode 100644 deploy/charts/sample-retry-test/values.schema.json create mode 100644 deploy/charts/test-object-type-uiprops/.helmignore create mode 100644 deploy/charts/test-object-type-uiprops/Chart.yaml create mode 100644 deploy/charts/test-object-type-uiprops/README.md create mode 100644 deploy/charts/test-object-type-uiprops/templates/01-configmap_test-object-type-uiprops-props.yaml create mode 100644 deploy/charts/test-object-type-uiprops/templates/02-configmap_01-test-object-type-uiprops-resources-schemas.yaml create mode 100644 deploy/charts/test-object-type-uiprops/templates/03-sonataflow_test-object-type-uiprops.yaml create mode 100644 deploy/charts/test-object-type-uiprops/values.schema.json create mode 100644 workflows/sample-retry-test/application.properties create mode 100644 workflows/sample-retry-test/argfile.conf create mode 100644 workflows/sample-retry-test/manifests/01-configmap_sample-retry-test-props.yaml create mode 100644 workflows/sample-retry-test/manifests/02-configmap_01-sample-retry-test-resources-schemas.yaml create mode 100644 workflows/sample-retry-test/manifests/03-sonataflow_sample-retry-test.yaml create mode 100644 workflows/sample-retry-test/sample-retry-test.sw.yaml create mode 100644 workflows/sample-retry-test/schemas/sample-retry-test.input-schema.json create mode 100644 workflows/sample-retry-test/schemas/workflow-output-schema.json create mode 100644 workflows/test-object-type-uiprops/application.properties create mode 100644 workflows/test-object-type-uiprops/argfile.conf create mode 100644 workflows/test-object-type-uiprops/manifests/01-configmap_test-object-type-uiprops-props.yaml create mode 100644 workflows/test-object-type-uiprops/manifests/02-configmap_01-test-object-type-uiprops-resources-schemas.yaml create mode 100644 workflows/test-object-type-uiprops/manifests/03-sonataflow_test-object-type-uiprops.yaml create mode 100644 workflows/test-object-type-uiprops/schemas/test-object-type-uiprops__main-schema.json create mode 100644 workflows/test-object-type-uiprops/schemas/workflow-output-schema.json create mode 100644 workflows/test-object-type-uiprops/test-object-type-uiprops.sw.yaml diff --git a/.github/workflows/sample-retry-test.yaml b/.github/workflows/sample-retry-test.yaml new file mode 100644 index 00000000..86d1a397 --- /dev/null +++ b/.github/workflows/sample-retry-test.yaml @@ -0,0 +1,18 @@ +name: Sample retry test workflow container image and manifest push + +on: + workflow_dispatch: + push: + branches: [ "main" ] + paths: + - 'workflows/sample-retry-test/**' + - 'pipeline/**' + - .github/workflows/sample-retry-test.yaml + - .github/workflows/main.yml + +jobs: + call-main-workflow: + uses: ./.github/workflows/main.yml + with: + workflow_id: sample-retry-test + secrets: inherit diff --git a/.github/workflows/test-object-type-uiprops.yaml b/.github/workflows/test-object-type-uiprops.yaml new file mode 100644 index 00000000..10d5e062 --- /dev/null +++ b/.github/workflows/test-object-type-uiprops.yaml @@ -0,0 +1,18 @@ +name: Test object type ui:props workflow container image and manifest push + +on: + workflow_dispatch: + push: + branches: [ "main" ] + paths: + - 'workflows/test-object-type-uiprops/**' + - 'pipeline/**' + - .github/workflows/test-object-type-uiprops.yaml + - .github/workflows/main.yml + +jobs: + call-main-workflow: + uses: ./.github/workflows/main.yml + with: + workflow_id: test-object-type-uiprops + secrets: inherit diff --git a/Makefile b/Makefile index 04a2d9bc..2532b941 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,8 @@ WORKFLOWS = \ mtv-migration \ modify-vm-resources \ rpj \ + test-object-type-uiprops \ + sample-retry-test \ $(NULL) # Dynamic rule patten that uses one of the workflows and sets the workflow id diff --git a/README.md b/README.md index cab63255..64d647dd 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,8 @@ This repository contains multiple workflows. Each workflow is represented by a d | `mta-v7.x` | Migration toolkit for applications, version 7.x. | | `mtv-migration` | Migration tasks using Migration Toolkit for Virtualization (MTV). | | `request-vm-cnv` | Requests and provisions VMs using Container Native Virtualization (CNV). | +| `test-object-type-uiprops` | E2E-style schema for object-type `ui:props` | +| `sample-retry-test` | Sample form with ActiveTextInput fetch retry `ui:props` for CI testing. | Each workflow is organized in its own directory, containing the following components: * `application.properties` — Contains configuration properties specific to the workflow application. diff --git a/deploy/charts/sample-retry-test/.helmignore b/deploy/charts/sample-retry-test/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/deploy/charts/sample-retry-test/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/deploy/charts/sample-retry-test/Chart.yaml b/deploy/charts/sample-retry-test/Chart.yaml new file mode 100644 index 00000000..ee4955ec --- /dev/null +++ b/deploy/charts/sample-retry-test/Chart.yaml @@ -0,0 +1,17 @@ +apiVersion: v2 +name: sample-retry-test +description: A Helm chart for the sample-retry-test serverless workflow +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 1.7.0-rc3 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "1.16.0" + +icon: https://raw.githubusercontent.com/rhdhorchestrator/rhdhorchestrator.github.io/main/assets/images/WO_black.svg diff --git a/deploy/charts/sample-retry-test/README.md b/deploy/charts/sample-retry-test/README.md new file mode 100644 index 00000000..6af8050f --- /dev/null +++ b/deploy/charts/sample-retry-test/README.md @@ -0,0 +1,31 @@ +# Sample Retry Test workflow + +The sample-retry-test workflow is a minimal Serverless Workflow used for local and UI testing. It injects a fixed message and completes immediately. The input schema drives a **Backstage / RHDH** form with **ActiveTextInput** fields whose `ui:props` exercise **fetch retry** behavior (max attempts, delay, backoff, and HTTP status codes). Your Backstage backend must expose the URLs referenced in the schema (for example `/api/retry-test/all-props`) so the form can load values. + +## Input + +- **`retryAllProps`** [optional] — ActiveTextInput with full retry settings (`fetch:retry:maxAttempts`, `delay`, `backoff`, `statusCodes` including 404). +- **`retryStatusCodesNoMatch`** [optional] — ActiveTextInput with retry props but a status-code list that omits 404 (used to validate retry behavior when the failing status is not listed). +- **`retryNoProps`** [optional] — ActiveTextInput with fetch URL and response mapping only (no explicit retry properties). + +## Workflow diagram + +No SVG diagram is checked in for this workflow; the definition is a single inject state in `workflows/sample-retry-test/sample-retry-test.sw.yaml`. + +## Installation + +See the [greeting installation guide](https://github.com/rhdhorchestrator/serverless-workflows/blob/main/deploy/docs/main/greeting/README.md) for persistence prerequisites and cluster expectations. Use this chart name and SonataFlow resource name instead of `greeting`: + +```console +TARGET_NS=sonataflow-infra +helm repo add orchestrator-workflows https://rhdhorchestrator.io/serverless-workflows +helm install sample-retry-test orchestrator-workflows/sample-retry-test -n ${TARGET_NS} +``` + +Verify the workflow is ready: + +```console +oc wait sonataflow sample-retry-test -n ${TARGET_NS} --for=condition=Running=True --timeout=5m +``` + +After the chart is published to the Helm repo, adjust the `helm install` line if your repository uses a different chart name or version (`--devel` for pre-releases). diff --git a/deploy/charts/sample-retry-test/templates/01-configmap_sample-retry-test-props.yaml b/deploy/charts/sample-retry-test/templates/01-configmap_sample-retry-test-props.yaml new file mode 100644 index 00000000..b5d926c9 --- /dev/null +++ b/deploy/charts/sample-retry-test/templates/01-configmap_sample-retry-test-props.yaml @@ -0,0 +1,22 @@ +apiVersion: v1 +data: + application.properties: | + # This property is used to select the log level, which controls the amount + # of information logged on HTTP requests based on the severity of the events. + # Possible values: OFF, FATAL, ERROR, WARN, INFO, DEBUG, ALL. + # and see https://quarkus.io/guides/logging for documentation + quarkus.log.category."org.apache.http".level=INFO + quarkus.log.level=INFO + + kie.flyway.enabled=true +kind: ConfigMap +metadata: + creationTimestamp: null + labels: + app: sample-retry-test + app.kubernetes.io/component: serverless-workflow + app.kubernetes.io/managed-by: sonataflow-operator + app.kubernetes.io/name: sample-retry-test + sonataflow.org/workflow-app: sample-retry-test + sonataflow.org/workflow-namespace: "" + name: sample-retry-test-props diff --git a/deploy/charts/sample-retry-test/templates/02-configmap_01-sample-retry-test-resources-schemas.yaml b/deploy/charts/sample-retry-test/templates/02-configmap_01-sample-retry-test-resources-schemas.yaml new file mode 100644 index 00000000..8e528176 --- /dev/null +++ b/deploy/charts/sample-retry-test/templates/02-configmap_01-sample-retry-test-resources-schemas.yaml @@ -0,0 +1,62 @@ +apiVersion: v1 +data: + sample-retry-test.input-schema.json: | + { + "$id": "classpath:/schemas/sample-retry-test.input-schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "retryAllProps": { + "type": "string", + "title": "Retry Test (all props)", + "ui:widget": "ActiveTextInput", + "ui:props": { + "fetch:url": "$${{backend.baseUrl}}/api/retry-test/all-props", + "fetch:response:value": "value", + "fetch:retry:maxAttempts": 3, + "fetch:retry:delay": 1500, + "fetch:retry:backoff": 2, + "fetch:retry:statusCodes": [404, 408, 429, 500, 502, 503, 504] + } + }, + "retryStatusCodesNoMatch": { + "type": "string", + "title": "Retry Test (status codes missing 404)", + "ui:widget": "ActiveTextInput", + "ui:props": { + "fetch:url": "$${{backend.baseUrl}}/api/retry-test/status-codes-no-404", + "fetch:response:value": "value", + "fetch:retry:maxAttempts": 2, + "fetch:retry:delay": 500, + "fetch:retry:backoff": 2, + "fetch:retry:statusCodes": [408, 429, 500, 502, 503, 504] + } + }, + "retryNoProps": { + "type": "string", + "title": "Retry Test (no retry props)", + "ui:widget": "ActiveTextInput", + "ui:props": { + "fetch:url": "$${{backend.baseUrl}}/api/retry-test/no-retry-props", + "fetch:response:value": "value" + } + } + } + } + workflow-output-schema.json: |- + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "WorkflowResult", + "description": "Schema of workflow output", + "type": "object", + "properties": { + "result": { + "$ref": "../shared/schemas/workflow-result-schema.json", + "type": "object" + } + } + } +kind: ConfigMap +metadata: + creationTimestamp: null + name: 01-sample-retry-test-resources-schemas diff --git a/deploy/charts/sample-retry-test/templates/03-sonataflow_sample-retry-test.yaml b/deploy/charts/sample-retry-test/templates/03-sonataflow_sample-retry-test.yaml new file mode 100644 index 00000000..41c453fd --- /dev/null +++ b/deploy/charts/sample-retry-test/templates/03-sonataflow_sample-retry-test.yaml @@ -0,0 +1,56 @@ +apiVersion: sonataflow.org/v1alpha08 +kind: SonataFlow +metadata: + annotations: + sonataflow.org/description: Simple workflow for local testing + sonataflow.org/expressionLang: jq + sonataflow.org/profile: gitops + sonataflow.org/version: "1.0" + creationTimestamp: null + labels: + app: sample-retry-test + app.kubernetes.io/component: serverless-workflow + app.kubernetes.io/managed-by: sonataflow-operator + app.kubernetes.io/name: sample-retry-test + sonataflow.org/workflow-app: sample-retry-test + sonataflow.org/workflow-namespace: "" + name: sample-retry-test +spec: + flow: + annotations: + - workflow-type/infrastructure + dataInputSchema: + failOnValidationErrors: true + schema: schemas/sample-retry-test.input-schema.json + start: + stateName: InjectState + states: + - data: + message: Hello from sample-retry-test + end: + terminate: true + name: InjectState + type: inject + podTemplate: + container: + image: quay.io/orchestrator/serverless-workflow-sample-retry-test:osl_1_37 + resources: {} + resources: + configMaps: + - configMap: + name: 01-sample-retry-test-resources-schemas + workflowPath: schemas + persistence: + postgresql: + secretRef: + name: sonataflow-psql-postgresql + userKey: postgres-username + passwordKey: postgres-password + serviceRef: + name: sonataflow-psql-postgresql + port: 5432 + databaseName: sonataflow + databaseSchema: sample-retry-test +status: + address: {} + lastTimeRecoverAttempt: null diff --git a/deploy/charts/sample-retry-test/values.schema.json b/deploy/charts/sample-retry-test/values.schema.json new file mode 100644 index 00000000..70021b56 --- /dev/null +++ b/deploy/charts/sample-retry-test/values.schema.json @@ -0,0 +1,10 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "http://example.com/example.json", + "type": "object", + "default": {}, + "title": "Root Schema", + "required": [], + "properties": {}, + "examples": [{}] +} diff --git a/deploy/charts/test-object-type-uiprops/.helmignore b/deploy/charts/test-object-type-uiprops/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/deploy/charts/test-object-type-uiprops/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/deploy/charts/test-object-type-uiprops/Chart.yaml b/deploy/charts/test-object-type-uiprops/Chart.yaml new file mode 100644 index 00000000..65d5037e --- /dev/null +++ b/deploy/charts/test-object-type-uiprops/Chart.yaml @@ -0,0 +1,17 @@ +apiVersion: v2 +name: test-object-type-uiprops +description: A Helm chart for the test-object-type-uiprops serverless workflow +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 1.7.0-rc3 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "1.16.0" + +icon: https://raw.githubusercontent.com/rhdhorchestrator/rhdhorchestrator.github.io/main/assets/images/WO_black.svg diff --git a/deploy/charts/test-object-type-uiprops/README.md b/deploy/charts/test-object-type-uiprops/README.md new file mode 100644 index 00000000..171c146b --- /dev/null +++ b/deploy/charts/test-object-type-uiprops/README.md @@ -0,0 +1,34 @@ +# Test Object Type Support in ui:props workflow + +The test-object-type-uiprops workflow is used for **Backstage / RHDH** and orchestrator UI testing around **RHIDP-11054**: the input schema includes nested objects and fields that document **object-type (JsonValue) support** in `ui:props`—for example `fetch:response:*` values that are not plain strings. At runtime the workflow logs the full input, then completes with a structured result that surfaces **name** and **email** from `basicInfo` when present. + +## Input + +- **`basicInfo`** — Object group **Basic Information**. + - **`name`** [required] — User name. + - **`email`** [optional] — Email address (`format: email`). +- **`demonstrationFields`** [optional] — Object group **Object Type in ui:props Demonstration** (nested fields for UI behavior demos). + - **`simpleText`** [optional] — Plain string field (classic `ui:props` usage). + - **`objectExample`** [optional] — Field whose description/`ui:help` illustrates non-string JsonValue handling for `fetch:response:*` in `ui:props`. + +## Workflow diagram + +No SVG diagram is checked in for this workflow; the definition is an operation state (sysout plus result expression) in `workflows/test-object-type-uiprops/test-object-type-uiprops.sw.yaml`. + +## Installation + +See the [greeting installation guide](https://github.com/rhdhorchestrator/serverless-workflows/blob/main/deploy/docs/main/greeting/README.md) for persistence prerequisites and cluster expectations. Use this chart name and SonataFlow resource name instead of `greeting`: + +```console +TARGET_NS=sonataflow-infra +helm repo add orchestrator-workflows https://rhdhorchestrator.io/serverless-workflows +helm install test-object-type-uiprops orchestrator-workflows/test-object-type-uiprops -n ${TARGET_NS} +``` + +Verify the workflow is ready: + +```console +oc wait sonataflow test-object-type-uiprops -n ${TARGET_NS} --for=condition=Running=True --timeout=5m +``` + +After the chart is published to the Helm repo, adjust the `helm install` line if your repository uses a different chart name or version (`--devel` for pre-releases). diff --git a/deploy/charts/test-object-type-uiprops/templates/01-configmap_test-object-type-uiprops-props.yaml b/deploy/charts/test-object-type-uiprops/templates/01-configmap_test-object-type-uiprops-props.yaml new file mode 100644 index 00000000..c538ed25 --- /dev/null +++ b/deploy/charts/test-object-type-uiprops/templates/01-configmap_test-object-type-uiprops-props.yaml @@ -0,0 +1,22 @@ +apiVersion: v1 +data: + application.properties: | + # This property is used to select the log level, which controls the amount + # of information logged on HTTP requests based on the severity of the events. + # Possible values: OFF, FATAL, ERROR, WARN, INFO, DEBUG, ALL. + # and see https://quarkus.io/guides/logging for documentation + quarkus.log.category."org.apache.http".level=INFO + quarkus.log.level=INFO + + kie.flyway.enabled=true +kind: ConfigMap +metadata: + creationTimestamp: null + labels: + app: test-object-type-uiprops + app.kubernetes.io/component: serverless-workflow + app.kubernetes.io/managed-by: sonataflow-operator + app.kubernetes.io/name: test-object-type-uiprops + sonataflow.org/workflow-app: test-object-type-uiprops + sonataflow.org/workflow-namespace: "" + name: test-object-type-uiprops-props diff --git a/deploy/charts/test-object-type-uiprops/templates/02-configmap_01-test-object-type-uiprops-resources-schemas.yaml b/deploy/charts/test-object-type-uiprops/templates/02-configmap_01-test-object-type-uiprops-resources-schemas.yaml new file mode 100644 index 00000000..95e662db --- /dev/null +++ b/deploy/charts/test-object-type-uiprops/templates/02-configmap_01-test-object-type-uiprops-resources-schemas.yaml @@ -0,0 +1,65 @@ +apiVersion: v1 +data: + test-object-type-uiprops__main-schema.json: | + { + "$id": "classpath:/schemas/test-object-type-uiprops__main-schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Test Object Type Support in ui:props", + "type": "object", + "description": "Testing object type support for fetch:response:* properties in ui:props - RHIDP-11054", + "properties": { + "basicInfo": { + "type": "object", + "title": "Basic Information", + "properties": { + "name": { + "title": "Name", + "description": "Enter your name", + "type": "string" + }, + "email": { + "title": "Email", + "description": "Enter your email", + "type": "string", + "format": "email" + } + }, + "required": ["name"] + }, + "demonstrationFields": { + "type": "object", + "title": "Object Type in ui:props Demonstration", + "description": "These fields demonstrate that ui:props now supports JsonValue (objects, arrays, etc.) not just strings", + "properties": { + "simpleText": { + "title": "Simple Text Field", + "description": "Traditional string-based ui:props still work", + "type": "string" + }, + "objectExample": { + "title": "Object Type Example", + "description": "This field demonstrates object type support in ui:props fetch:response:* properties", + "type": "string", + "ui:help": "The fetch:response:* properties in ui:props can now be objects or other JsonValue types, not just strings" + } + } + } + } + } + workflow-output-schema.json: |- + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "WorkflowResult", + "description": "Schema of workflow output", + "type": "object", + "properties": { + "result": { + "$ref": "../shared/schemas/workflow-result-schema.json", + "type": "object" + } + } + } +kind: ConfigMap +metadata: + creationTimestamp: null + name: 01-test-object-type-uiprops-resources-schemas diff --git a/deploy/charts/test-object-type-uiprops/templates/03-sonataflow_test-object-type-uiprops.yaml b/deploy/charts/test-object-type-uiprops/templates/03-sonataflow_test-object-type-uiprops.yaml new file mode 100644 index 00000000..379c615f --- /dev/null +++ b/deploy/charts/test-object-type-uiprops/templates/03-sonataflow_test-object-type-uiprops.yaml @@ -0,0 +1,77 @@ +apiVersion: sonataflow.org/v1alpha08 +kind: SonataFlow +metadata: + annotations: + sonataflow.org/description: "Testing object type support for fetch:response:* properties in ui:props - RHIDP-11054" + sonataflow.org/expressionLang: jq + sonataflow.org/profile: gitops + sonataflow.org/version: "1.0" + creationTimestamp: null + labels: + app: test-object-type-uiprops + app.kubernetes.io/component: serverless-workflow + app.kubernetes.io/managed-by: sonataflow-operator + app.kubernetes.io/name: test-object-type-uiprops + sonataflow.org/workflow-app: test-object-type-uiprops + sonataflow.org/workflow-namespace: "" + name: test-object-type-uiprops +spec: + flow: + annotations: + - workflow-type/infrastructure + dataInputSchema: + failOnValidationErrors: true + schema: schemas/test-object-type-uiprops__main-schema.json + functions: + - name: runActionFunction + operation: sysout + type: custom + - name: successResult + operation: '{ "result": { "message": "Workflow completed successfully", "outputs":[ { "key":"Name", "value": (.basicInfo.name // "") }, { "key":"Email", "value": (.basicInfo.email // "") } ] } }' + type: expression + start: + stateName: StartState + states: + - actionMode: sequential + actions: + - actionDataFilter: + useResults: true + functionRef: + arguments: + message: '"Workflow completed with input: " + (. | tostring)' + invoke: sync + refName: runActionFunction + name: runAction + - actionDataFilter: + useResults: true + functionRef: + invoke: sync + refName: successResult + name: setOutput + end: + terminate: true + name: StartState + type: operation + podTemplate: + container: + image: quay.io/orchestrator/serverless-workflow-test-object-type-uiprops:osl_1_37 + resources: {} + resources: + configMaps: + - configMap: + name: 01-test-object-type-uiprops-resources-schemas + workflowPath: schemas + persistence: + postgresql: + secretRef: + name: sonataflow-psql-postgresql + userKey: postgres-username + passwordKey: postgres-password + serviceRef: + name: sonataflow-psql-postgresql + port: 5432 + databaseName: sonataflow + databaseSchema: test-object-type-uiprops +status: + address: {} + lastTimeRecoverAttempt: null diff --git a/deploy/charts/test-object-type-uiprops/values.schema.json b/deploy/charts/test-object-type-uiprops/values.schema.json new file mode 100644 index 00000000..70021b56 --- /dev/null +++ b/deploy/charts/test-object-type-uiprops/values.schema.json @@ -0,0 +1,10 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$id": "http://example.com/example.json", + "type": "object", + "default": {}, + "title": "Root Schema", + "required": [], + "properties": {}, + "examples": [{}] +} diff --git a/workflows/sample-retry-test/application.properties b/workflows/sample-retry-test/application.properties new file mode 100644 index 00000000..244c1fb7 --- /dev/null +++ b/workflows/sample-retry-test/application.properties @@ -0,0 +1,8 @@ +# This property is used to select the log level, which controls the amount +# of information logged on HTTP requests based on the severity of the events. +# Possible values: OFF, FATAL, ERROR, WARN, INFO, DEBUG, ALL. +# and see https://quarkus.io/guides/logging for documentation +quarkus.log.category."org.apache.http".level=INFO +quarkus.log.level=INFO + +kie.flyway.enabled=true diff --git a/workflows/sample-retry-test/argfile.conf b/workflows/sample-retry-test/argfile.conf new file mode 100644 index 00000000..0d8f3d94 --- /dev/null +++ b/workflows/sample-retry-test/argfile.conf @@ -0,0 +1,3 @@ +FLOW_NAME=Sample Retry Test +FLOW_SUMMARY=Sample Retry Test +FLOW_DESCRIPTION=Simple workflow for local testing (ActiveTextInput fetch retry ui:props) diff --git a/workflows/sample-retry-test/manifests/01-configmap_sample-retry-test-props.yaml b/workflows/sample-retry-test/manifests/01-configmap_sample-retry-test-props.yaml new file mode 100644 index 00000000..b5d926c9 --- /dev/null +++ b/workflows/sample-retry-test/manifests/01-configmap_sample-retry-test-props.yaml @@ -0,0 +1,22 @@ +apiVersion: v1 +data: + application.properties: | + # This property is used to select the log level, which controls the amount + # of information logged on HTTP requests based on the severity of the events. + # Possible values: OFF, FATAL, ERROR, WARN, INFO, DEBUG, ALL. + # and see https://quarkus.io/guides/logging for documentation + quarkus.log.category."org.apache.http".level=INFO + quarkus.log.level=INFO + + kie.flyway.enabled=true +kind: ConfigMap +metadata: + creationTimestamp: null + labels: + app: sample-retry-test + app.kubernetes.io/component: serverless-workflow + app.kubernetes.io/managed-by: sonataflow-operator + app.kubernetes.io/name: sample-retry-test + sonataflow.org/workflow-app: sample-retry-test + sonataflow.org/workflow-namespace: "" + name: sample-retry-test-props diff --git a/workflows/sample-retry-test/manifests/02-configmap_01-sample-retry-test-resources-schemas.yaml b/workflows/sample-retry-test/manifests/02-configmap_01-sample-retry-test-resources-schemas.yaml new file mode 100644 index 00000000..8e528176 --- /dev/null +++ b/workflows/sample-retry-test/manifests/02-configmap_01-sample-retry-test-resources-schemas.yaml @@ -0,0 +1,62 @@ +apiVersion: v1 +data: + sample-retry-test.input-schema.json: | + { + "$id": "classpath:/schemas/sample-retry-test.input-schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "retryAllProps": { + "type": "string", + "title": "Retry Test (all props)", + "ui:widget": "ActiveTextInput", + "ui:props": { + "fetch:url": "$${{backend.baseUrl}}/api/retry-test/all-props", + "fetch:response:value": "value", + "fetch:retry:maxAttempts": 3, + "fetch:retry:delay": 1500, + "fetch:retry:backoff": 2, + "fetch:retry:statusCodes": [404, 408, 429, 500, 502, 503, 504] + } + }, + "retryStatusCodesNoMatch": { + "type": "string", + "title": "Retry Test (status codes missing 404)", + "ui:widget": "ActiveTextInput", + "ui:props": { + "fetch:url": "$${{backend.baseUrl}}/api/retry-test/status-codes-no-404", + "fetch:response:value": "value", + "fetch:retry:maxAttempts": 2, + "fetch:retry:delay": 500, + "fetch:retry:backoff": 2, + "fetch:retry:statusCodes": [408, 429, 500, 502, 503, 504] + } + }, + "retryNoProps": { + "type": "string", + "title": "Retry Test (no retry props)", + "ui:widget": "ActiveTextInput", + "ui:props": { + "fetch:url": "$${{backend.baseUrl}}/api/retry-test/no-retry-props", + "fetch:response:value": "value" + } + } + } + } + workflow-output-schema.json: |- + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "WorkflowResult", + "description": "Schema of workflow output", + "type": "object", + "properties": { + "result": { + "$ref": "../shared/schemas/workflow-result-schema.json", + "type": "object" + } + } + } +kind: ConfigMap +metadata: + creationTimestamp: null + name: 01-sample-retry-test-resources-schemas diff --git a/workflows/sample-retry-test/manifests/03-sonataflow_sample-retry-test.yaml b/workflows/sample-retry-test/manifests/03-sonataflow_sample-retry-test.yaml new file mode 100644 index 00000000..41c453fd --- /dev/null +++ b/workflows/sample-retry-test/manifests/03-sonataflow_sample-retry-test.yaml @@ -0,0 +1,56 @@ +apiVersion: sonataflow.org/v1alpha08 +kind: SonataFlow +metadata: + annotations: + sonataflow.org/description: Simple workflow for local testing + sonataflow.org/expressionLang: jq + sonataflow.org/profile: gitops + sonataflow.org/version: "1.0" + creationTimestamp: null + labels: + app: sample-retry-test + app.kubernetes.io/component: serverless-workflow + app.kubernetes.io/managed-by: sonataflow-operator + app.kubernetes.io/name: sample-retry-test + sonataflow.org/workflow-app: sample-retry-test + sonataflow.org/workflow-namespace: "" + name: sample-retry-test +spec: + flow: + annotations: + - workflow-type/infrastructure + dataInputSchema: + failOnValidationErrors: true + schema: schemas/sample-retry-test.input-schema.json + start: + stateName: InjectState + states: + - data: + message: Hello from sample-retry-test + end: + terminate: true + name: InjectState + type: inject + podTemplate: + container: + image: quay.io/orchestrator/serverless-workflow-sample-retry-test:osl_1_37 + resources: {} + resources: + configMaps: + - configMap: + name: 01-sample-retry-test-resources-schemas + workflowPath: schemas + persistence: + postgresql: + secretRef: + name: sonataflow-psql-postgresql + userKey: postgres-username + passwordKey: postgres-password + serviceRef: + name: sonataflow-psql-postgresql + port: 5432 + databaseName: sonataflow + databaseSchema: sample-retry-test +status: + address: {} + lastTimeRecoverAttempt: null diff --git a/workflows/sample-retry-test/sample-retry-test.sw.yaml b/workflows/sample-retry-test/sample-retry-test.sw.yaml new file mode 100644 index 00000000..3337a2a8 --- /dev/null +++ b/workflows/sample-retry-test/sample-retry-test.sw.yaml @@ -0,0 +1,18 @@ +id: sample-retry-test +version: '1.0' +specVersion: '0.8' +name: Sample Retry Test +description: Simple workflow for local testing +annotations: + - "workflow-type/infrastructure" +dataInputSchema: schemas/sample-retry-test.input-schema.json +extensions: + - extensionid: workflow-output-schema + outputSchema: schemas/workflow-output-schema.json +start: InjectState +states: + - name: InjectState + type: inject + data: + message: Hello from sample-retry-test + end: true diff --git a/workflows/sample-retry-test/schemas/sample-retry-test.input-schema.json b/workflows/sample-retry-test/schemas/sample-retry-test.input-schema.json new file mode 100644 index 00000000..110398a6 --- /dev/null +++ b/workflows/sample-retry-test/schemas/sample-retry-test.input-schema.json @@ -0,0 +1,42 @@ +{ + "$id": "classpath:/schemas/sample-retry-test.input-schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "retryAllProps": { + "type": "string", + "title": "Retry Test (all props)", + "ui:widget": "ActiveTextInput", + "ui:props": { + "fetch:url": "$${{backend.baseUrl}}/api/retry-test/all-props", + "fetch:response:value": "value", + "fetch:retry:maxAttempts": 3, + "fetch:retry:delay": 1500, + "fetch:retry:backoff": 2, + "fetch:retry:statusCodes": [404, 408, 429, 500, 502, 503, 504] + } + }, + "retryStatusCodesNoMatch": { + "type": "string", + "title": "Retry Test (status codes missing 404)", + "ui:widget": "ActiveTextInput", + "ui:props": { + "fetch:url": "$${{backend.baseUrl}}/api/retry-test/status-codes-no-404", + "fetch:response:value": "value", + "fetch:retry:maxAttempts": 2, + "fetch:retry:delay": 500, + "fetch:retry:backoff": 2, + "fetch:retry:statusCodes": [408, 429, 500, 502, 503, 504] + } + }, + "retryNoProps": { + "type": "string", + "title": "Retry Test (no retry props)", + "ui:widget": "ActiveTextInput", + "ui:props": { + "fetch:url": "$${{backend.baseUrl}}/api/retry-test/no-retry-props", + "fetch:response:value": "value" + } + } + } +} diff --git a/workflows/sample-retry-test/schemas/workflow-output-schema.json b/workflows/sample-retry-test/schemas/workflow-output-schema.json new file mode 100644 index 00000000..48870eb5 --- /dev/null +++ b/workflows/sample-retry-test/schemas/workflow-output-schema.json @@ -0,0 +1,12 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "WorkflowResult", + "description": "Schema of workflow output", + "type": "object", + "properties": { + "result": { + "$ref": "../shared/schemas/workflow-result-schema.json", + "type": "object" + } + } +} diff --git a/workflows/test-object-type-uiprops/application.properties b/workflows/test-object-type-uiprops/application.properties new file mode 100644 index 00000000..244c1fb7 --- /dev/null +++ b/workflows/test-object-type-uiprops/application.properties @@ -0,0 +1,8 @@ +# This property is used to select the log level, which controls the amount +# of information logged on HTTP requests based on the severity of the events. +# Possible values: OFF, FATAL, ERROR, WARN, INFO, DEBUG, ALL. +# and see https://quarkus.io/guides/logging for documentation +quarkus.log.category."org.apache.http".level=INFO +quarkus.log.level=INFO + +kie.flyway.enabled=true diff --git a/workflows/test-object-type-uiprops/argfile.conf b/workflows/test-object-type-uiprops/argfile.conf new file mode 100644 index 00000000..216b405f --- /dev/null +++ b/workflows/test-object-type-uiprops/argfile.conf @@ -0,0 +1,3 @@ +FLOW_NAME=Test Object Type Support in ui:props +FLOW_SUMMARY=Test Object Type Support in ui:props +FLOW_DESCRIPTION=Testing object type support for fetch:response:* properties in ui:props - RHIDP-11054 diff --git a/workflows/test-object-type-uiprops/manifests/01-configmap_test-object-type-uiprops-props.yaml b/workflows/test-object-type-uiprops/manifests/01-configmap_test-object-type-uiprops-props.yaml new file mode 100644 index 00000000..c538ed25 --- /dev/null +++ b/workflows/test-object-type-uiprops/manifests/01-configmap_test-object-type-uiprops-props.yaml @@ -0,0 +1,22 @@ +apiVersion: v1 +data: + application.properties: | + # This property is used to select the log level, which controls the amount + # of information logged on HTTP requests based on the severity of the events. + # Possible values: OFF, FATAL, ERROR, WARN, INFO, DEBUG, ALL. + # and see https://quarkus.io/guides/logging for documentation + quarkus.log.category."org.apache.http".level=INFO + quarkus.log.level=INFO + + kie.flyway.enabled=true +kind: ConfigMap +metadata: + creationTimestamp: null + labels: + app: test-object-type-uiprops + app.kubernetes.io/component: serverless-workflow + app.kubernetes.io/managed-by: sonataflow-operator + app.kubernetes.io/name: test-object-type-uiprops + sonataflow.org/workflow-app: test-object-type-uiprops + sonataflow.org/workflow-namespace: "" + name: test-object-type-uiprops-props diff --git a/workflows/test-object-type-uiprops/manifests/02-configmap_01-test-object-type-uiprops-resources-schemas.yaml b/workflows/test-object-type-uiprops/manifests/02-configmap_01-test-object-type-uiprops-resources-schemas.yaml new file mode 100644 index 00000000..95e662db --- /dev/null +++ b/workflows/test-object-type-uiprops/manifests/02-configmap_01-test-object-type-uiprops-resources-schemas.yaml @@ -0,0 +1,65 @@ +apiVersion: v1 +data: + test-object-type-uiprops__main-schema.json: | + { + "$id": "classpath:/schemas/test-object-type-uiprops__main-schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Test Object Type Support in ui:props", + "type": "object", + "description": "Testing object type support for fetch:response:* properties in ui:props - RHIDP-11054", + "properties": { + "basicInfo": { + "type": "object", + "title": "Basic Information", + "properties": { + "name": { + "title": "Name", + "description": "Enter your name", + "type": "string" + }, + "email": { + "title": "Email", + "description": "Enter your email", + "type": "string", + "format": "email" + } + }, + "required": ["name"] + }, + "demonstrationFields": { + "type": "object", + "title": "Object Type in ui:props Demonstration", + "description": "These fields demonstrate that ui:props now supports JsonValue (objects, arrays, etc.) not just strings", + "properties": { + "simpleText": { + "title": "Simple Text Field", + "description": "Traditional string-based ui:props still work", + "type": "string" + }, + "objectExample": { + "title": "Object Type Example", + "description": "This field demonstrates object type support in ui:props fetch:response:* properties", + "type": "string", + "ui:help": "The fetch:response:* properties in ui:props can now be objects or other JsonValue types, not just strings" + } + } + } + } + } + workflow-output-schema.json: |- + { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "WorkflowResult", + "description": "Schema of workflow output", + "type": "object", + "properties": { + "result": { + "$ref": "../shared/schemas/workflow-result-schema.json", + "type": "object" + } + } + } +kind: ConfigMap +metadata: + creationTimestamp: null + name: 01-test-object-type-uiprops-resources-schemas diff --git a/workflows/test-object-type-uiprops/manifests/03-sonataflow_test-object-type-uiprops.yaml b/workflows/test-object-type-uiprops/manifests/03-sonataflow_test-object-type-uiprops.yaml new file mode 100644 index 00000000..379c615f --- /dev/null +++ b/workflows/test-object-type-uiprops/manifests/03-sonataflow_test-object-type-uiprops.yaml @@ -0,0 +1,77 @@ +apiVersion: sonataflow.org/v1alpha08 +kind: SonataFlow +metadata: + annotations: + sonataflow.org/description: "Testing object type support for fetch:response:* properties in ui:props - RHIDP-11054" + sonataflow.org/expressionLang: jq + sonataflow.org/profile: gitops + sonataflow.org/version: "1.0" + creationTimestamp: null + labels: + app: test-object-type-uiprops + app.kubernetes.io/component: serverless-workflow + app.kubernetes.io/managed-by: sonataflow-operator + app.kubernetes.io/name: test-object-type-uiprops + sonataflow.org/workflow-app: test-object-type-uiprops + sonataflow.org/workflow-namespace: "" + name: test-object-type-uiprops +spec: + flow: + annotations: + - workflow-type/infrastructure + dataInputSchema: + failOnValidationErrors: true + schema: schemas/test-object-type-uiprops__main-schema.json + functions: + - name: runActionFunction + operation: sysout + type: custom + - name: successResult + operation: '{ "result": { "message": "Workflow completed successfully", "outputs":[ { "key":"Name", "value": (.basicInfo.name // "") }, { "key":"Email", "value": (.basicInfo.email // "") } ] } }' + type: expression + start: + stateName: StartState + states: + - actionMode: sequential + actions: + - actionDataFilter: + useResults: true + functionRef: + arguments: + message: '"Workflow completed with input: " + (. | tostring)' + invoke: sync + refName: runActionFunction + name: runAction + - actionDataFilter: + useResults: true + functionRef: + invoke: sync + refName: successResult + name: setOutput + end: + terminate: true + name: StartState + type: operation + podTemplate: + container: + image: quay.io/orchestrator/serverless-workflow-test-object-type-uiprops:osl_1_37 + resources: {} + resources: + configMaps: + - configMap: + name: 01-test-object-type-uiprops-resources-schemas + workflowPath: schemas + persistence: + postgresql: + secretRef: + name: sonataflow-psql-postgresql + userKey: postgres-username + passwordKey: postgres-password + serviceRef: + name: sonataflow-psql-postgresql + port: 5432 + databaseName: sonataflow + databaseSchema: test-object-type-uiprops +status: + address: {} + lastTimeRecoverAttempt: null diff --git a/workflows/test-object-type-uiprops/schemas/test-object-type-uiprops__main-schema.json b/workflows/test-object-type-uiprops/schemas/test-object-type-uiprops__main-schema.json new file mode 100644 index 00000000..952e4043 --- /dev/null +++ b/workflows/test-object-type-uiprops/schemas/test-object-type-uiprops__main-schema.json @@ -0,0 +1,45 @@ +{ + "$id": "classpath:/schemas/test-object-type-uiprops__main-schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Test Object Type Support in ui:props", + "type": "object", + "description": "Testing object type support for fetch:response:* properties in ui:props - RHIDP-11054", + "properties": { + "basicInfo": { + "type": "object", + "title": "Basic Information", + "properties": { + "name": { + "title": "Name", + "description": "Enter your name", + "type": "string" + }, + "email": { + "title": "Email", + "description": "Enter your email", + "type": "string", + "format": "email" + } + }, + "required": ["name"] + }, + "demonstrationFields": { + "type": "object", + "title": "Object Type in ui:props Demonstration", + "description": "These fields demonstrate that ui:props now supports JsonValue (objects, arrays, etc.) not just strings", + "properties": { + "simpleText": { + "title": "Simple Text Field", + "description": "Traditional string-based ui:props still work", + "type": "string" + }, + "objectExample": { + "title": "Object Type Example", + "description": "This field demonstrates object type support in ui:props fetch:response:* properties", + "type": "string", + "ui:help": "The fetch:response:* properties in ui:props can now be objects or other JsonValue types, not just strings" + } + } + } + } +} diff --git a/workflows/test-object-type-uiprops/schemas/workflow-output-schema.json b/workflows/test-object-type-uiprops/schemas/workflow-output-schema.json new file mode 100644 index 00000000..48870eb5 --- /dev/null +++ b/workflows/test-object-type-uiprops/schemas/workflow-output-schema.json @@ -0,0 +1,12 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "WorkflowResult", + "description": "Schema of workflow output", + "type": "object", + "properties": { + "result": { + "$ref": "../shared/schemas/workflow-result-schema.json", + "type": "object" + } + } +} diff --git a/workflows/test-object-type-uiprops/test-object-type-uiprops.sw.yaml b/workflows/test-object-type-uiprops/test-object-type-uiprops.sw.yaml new file mode 100644 index 00000000..82c50d62 --- /dev/null +++ b/workflows/test-object-type-uiprops/test-object-type-uiprops.sw.yaml @@ -0,0 +1,32 @@ +id: test-object-type-uiprops +version: "1.0" +specVersion: "0.8" +name: Test Object Type Support in ui:props +description: "Testing object type support for fetch:response:* properties in ui:props - RHIDP-11054" +annotations: + - "workflow-type/infrastructure" +dataInputSchema: schemas/test-object-type-uiprops__main-schema.json +extensions: + - extensionid: workflow-output-schema + outputSchema: schemas/workflow-output-schema.json +start: StartState +functions: + - name: runActionFunction + type: custom + operation: sysout + - name: successResult + type: expression + operation: '{ "result": { "message": "Workflow completed successfully", "outputs":[ { "key":"Name", "value": (.basicInfo.name // "") }, { "key":"Email", "value": (.basicInfo.email // "") } ] } }' +states: + - name: StartState + type: operation + actions: + - name: runAction + functionRef: + refName: runActionFunction + arguments: + message: '"Workflow completed with input: " + (. | tostring)' + - name: setOutput + functionRef: + refName: successResult + end: true