apache / incubator-kie-tools

Tools for KIE
Apache License 2.0
250 stars 185 forks source link

[10.0.x] Verify 10.0.x kn-plugin-workflow #2486

Closed domhanak closed 3 months ago

domhanak commented 3 months ago

Ensure the state on 10.0.x branch is good for the release. Execute tests. Validate the build. Validate related docs.

domhanak commented 3 months ago

KN Workflow Plugin verification for Apache KIE 10.0.x

Environment Fedora 39 Linux amd64 OpenJDK 17 Maven 3.9.3 Podman 4.9.4 Kubernetes in Docker with Knative Serving and Eventing installed running

Summary

Testing done, 10.0.x branch has a good candidate for release, couple of minor issues but nothing of blocking nature. 10.0.x kn-plugin-workflow is verified.

Build

Procedure - Build the binaries from release branch ✅

  1. Checkout https://github.com/apache/incubator-kie-tools/tree/10.0.x
  2. Run pnpm bootstrap -F '@kie-tools/kn-plugin-workflow...' ✅
  3. Run pnpm -r -F @kie-tools/kn-plugin-workflow... build:prod ✅

Automated tests

After you have built the whole stack, execute following commands:

  1. export KIE_TOOLS_BUILD__runEndToEndTests=true
  2. pnpm -r -F @kie-tools/kn-plugin-workflow build:prod

Procedure - Run automated unit test suites ✅

Tests executed with no failures - 18 tests passed.

Procedure - Run automated E2E test suites ✅

Prerequisites

  1. export KIE_TOOLS_BUILD__buildContainerImages=true
  2. pnpm -r -F @kie-tools/sonataflow-devmode-image... build:prod

I used KIND, setup by kn kn quickstart kind --registry --install-eventing --install-serving

Tests executed without issues - 34 tests passed.

Installation

Procedure - Install as a plugin of Knative CLI

Following the guide in sonataflow documentation

  1. Install knative cli using the binary procedure
  2. Use the kn-workflow-linux-amd64 binary that was built from 10.0.x
  3. Rename kn-workflow-linux-amd64 to kn-workflow
  4. mv kn-workflow-linux-amd64 kn-workflow
  5. Run chmod +x kn-workflow to make it executable
  6. Move the binary to /usr/local/bin
  7. mv kn-workflow /usr/local/bin
  8. Validate the installation
  9. Run kn plugin list
  10. Result: see - kn-workflow : /usr/local/bin/kn-workflow in the output ✅
  11. Run kn workflow
  12. Result: see landing text with Manage SonataFlow Projects ✅
  13. Validate the version
  14. Run kn workflow -v
  15. Result - 10.0.999

Functional

Command - help

Missing documentation entry, can be used with any command but that is not clear to the user right away

Procedure - Use the –help flag ✅
  1. Run kn workflow create –help
  2. Resulting output should provide a brief overview about CLI and its command. ✅

Command - create

Documentation

Procedure - Use the –help flag with create command ✅

Not covered by E2E.

  1. Run kn workflow create –help
  2. Resulting output should provide a brief overview about the workflow project creation procedure. ✅

Dominik: “This seems true, the output is reasonable and up to date”.

Procedure - Use the create command to scaffold a project ✅

Covered by E2E test

Procedure - Use the create command –name flag ✅

Covered by E2E test

Procedure - Use the create command with –yaml-workflow flag ✅

Not covered by E2E -> Reported in issue Missing documentation entry - Fixed by PR

  1. Run kn workflow create –yaml-workflow
  2. Resulting project should contain workflow.sw.yaml file

Command - run

Documentation

Procedure - Use the –help flag with run command ✅

Not covered by E2E.

  1. Run kn workflow run –help
  2. Results
  3. Output with title Run a SonataFlow project in development mode. ✅
  4. Output with a link pointing to devmode image with 10.0.x version ✅ ❓
Procedure - Use the run command to run the workflow ✅

Covered by E2E test

Procedure - Use the run command with –port flag ✅

Covered by E2E test

Procedure - Use the run command with –open-dev-ui flag ✅

Covered by E2E test

Command - deploy

Documentation Missing namespace note -> Fixed by PR Missing operator installation prerequisite -> Fixed by PR Procedure - Use the –help flag with deploy command ✅ Not covered by E2E.

  1. Run kn workflow deploy –help
  2. Results
  3. Resulting output should provide a brief overview about the workflow project deployment procedure. ✅
Procedure - Use the deploy command to deploy the workflow ✅

Not Covered by E2E test currently disabled and not implemented -> Reported in issue.

  1. Run kn workflow deploy –namespace apache-10
  2. Expect to see 🎉 SonataFlow project successfully deployed. ✅
  3. Examine the namespace in cluster using kubectl
  4. Run kubectl get pods -n apache-10
  5. Result - hello-6c9c9c6dbc-q6n7m 1/1 Running 0 12m
  6. Examine the workflow CR in the cluster using kubectl
  7. Run kubectl get workflow -n apache-10
  8. Result - hello dev 1.0 http://172.24.0.2:31150/hello True
Procedure - Use the deploy with –custom-manifests-dir flag ✅

Not Covered by E2E test currently disabled and not implemented -> Reported in issue.

  1. (Prerequisite) Run kn workflow gen-manifest –namespace apache-10 to generate manifest directory with YAML file
  2. Run kn workflow deploy –namespace apache-10 --custom-manifests-dir ./manifests
  3. Ensure - ✅ Manifest 01-sonataflow_hello.yaml successfully deployed in namespace apache-10 is shown in logs.
  4. Examine the namespace in cluster using kubectl
  5. Run kubectl get pods -n apache-10
  6. Result - hello-6c9c9c6dbc-q6n7m 1/1 Running 0 12m
  7. Examine the workflow CR in the cluster using kubectl
  8. Run kubectl get workflow -n apache-10
  9. Result - hello dev 1.0 http://172.24.0.2:32590/hello True
  10. Run kn workflow deploy –namespace apache-10
  11. Ensure - ✅ Manifest 01-sonataflow_hello.yaml successfully undeployed in namespace apache-10 is shown in logs.
Procedure - Use the deploy with --custom-generated-manifests-dir flag 🚧

Not Covered by E2E test currently disabled and not implemented -> Reported in issue.

Case 01 - Use JSON format workflow
  1. Run
  2. Ensure - ✅ Manifest 01-sonataflow_hello.yaml successfully deployed in namespace apache-10 is shown in logs.
  3. Ensure there is 01-sonataflow_hello.yaml created in ./
  4. Examine the namespace in cluster using kubectl
  5. Run kubectl get pods -n apache-10
  6. Result - hello-6c9c9c6dbc-q6n7m 1/1 Running 0 12m
  7. Examine the workflow CR in the cluster using kubectl
  8. Run kubectl get workflow -n apache-10
  9. Result - hello dev 1.0 http://172.24.0.2:32590/hello True
Case 02 - Use YAML format workflow ✅
  1. Run kn workflow deploy –namespace apache-10 --custom-generated-manifests-dir ./
  2. Result - ERROR -> UX reported issue.
    • ✅ Manifest 01-sonataflow_hello.yaml successfully deployed in namespace apache-10
  3. error: unable to decode "workflow.sw.yaml": Object 'Kind' is missing in '{"description":"Description","id":"hello","name":"Hello World","specVersion":"0.8.0","start":"HelloWorld","states":[{"data":{"message":"Hello World"},"end":true,"name":"HelloWorld","type":"inject"}],"version":"1.0"}' has a errorError: ❌ ERROR: applying deploy: ❌ ERROR: failed to deploy manifest workflow.sw.yaml, ❌ ERROR: failed to execute kubectl apply command for workflow.sw.yaml: exit status 1
  4. Failed because no cluster is running locally
  5. When run with Kind cluster up, it passes without issues ✅
Procedure - Use the deploy with –subflows-dir flag

Not Covered by E2E test currently disabled and not implemented -> Reported in issue.

Not tested.

Procedure - Use the deploy with –specs-dir flag

Not Covered by E2E test currently disabled and not implemented -> Reported in issue.

Not tested.

Procedure - Use the deploy with –schemas-dir flag

Not Covered by E2E test currently disabled and not implemented -> Reported in issue.

Not tested

Command - undeploy ✅

Documentation does not exist.

Procedure - Use the –help flag with deploy command ✅

Not covered by E2E.

  1. Run kn workflow undeploy –help
  2. Results
  3. An undeploy help page is shown at beginning, but there is a duplicated output of deploy command help page 🐞 -> Reported in https://github.com/apache/incubator-kie-tools/issues/2521
Procedure - Use the undeploy command to undeploy the workflow ✅

Not Covered by E2E test. Not implemented.

  1. Run kn workflow undeploy –namespace apache-10
  2. Expect to see 🎉 SonataFlow project successfully undeployed. ✅
  3. Examine the namespace in cluster using kubectl
  4. Run kubectl get pods -n apache-10
  5. Result - no pod with workflow ID in the result
  6. Examine the workflow CR in the cluster using kubectl
  7. Run kubectl get workflow -n apache-10
  8. Result - No resources found in apache-10 namespace

Command - gen-manifest ✅

Documentation does not exist. -> Fixed by PR

Procedure - Use the –help flag with gen-manifest command :construction: Not covered by E2E.

  1. Run kn workflow gen-manifest –help
  2. Results
  3. Resulting output should provide a brief overview about the manifest generation procedure. 🚧
  4. Looks like there is a duplication from deploy command 🚧
  5. One line is only about deploy command
  6. kn workflow deploy --namespace
Procedure - Use the gen-manifest command to generate operator manifest for the workflow project ✅

Not covered by E2E -> Reported in issue

  1. Run kn workflow gen-manifest
  2. Results
  3. A directory named /manifest is created in root directory and contains YAML manifest named 01-sonataflow_hello.yaml
  4. Namespace of the YAML file is default
Procedure - Use the gen-manifest with –namespace flag ✅

Not covered by E2E -> Reported in issue

  1. Run kn workflow gen-manifest –namespace apache-10
  2. Results
  3. A directory named /manifest is created in root directory and contains YAML manifest named 01-sonataflow_hello.yaml
  4. Namespace of the YAML file is apache-10

Command - help ✅

Documentation does not directly mention this command as its output matches kn workflow. We can link this section or improve it and add a new section just to tell users to use `help. [1]

Procedure - Use the help command ✅

Not covered by E2E.

  1. Run kn workflow help
  2. Results
  3. Help landing page is shown ✅

Command - quarkus create ✅

Documentation

Procedure - Use the –help flag with quarkus create command 🐞
  1. Run kn workflow quarkus create –help -> Reported in issue.
  2. Results
  3. The title and the follow-up text is OK, however examples show kn workflow create instead of kn workflow quarkus create 🐞
Procedure - Use the quarkus create command to scaffold a project ✅

Covered by E2E test.

Procedure - Use the quarkus create with –name flag ✅

Covered by E2E test.

Procedure - Use the quarkus create with –extension flag ✅

Covered by E2E test.

Procedure - Use the quarkus create with –quarkus-version flag ✅

Covered by E2E test.

Procedure - Use the quarkus create with –quarkus-platform-group-id flag ✅

Covered by E2E test.

Command - quarkus convert ✅

No documentation. -> Report in issue Procedure - Use the –help flag with quarkus create command 🐞

  1. Run kn workflow quarkus convert –help
  2. Results
  3. The title and the follow-up text is OK ✅
Procedure - Use the quarkus convert command to convert SonataFlow project to quarkus base ✅

Covered by E2E test.

Procedure - Use the quarkus convert command with –extension flag ✅

Covered by E2E test.

Procedure - Use the quarkus convert command with –quarkus-platform-group-id flag ✅

Covered by E2E test.

Procedure - Use the quarkus convert command with –quarkus-version flag ✅

Covered by E2E test.

Command - quarkus run ✅

Documentation Procedure - Use the –help flag with quarkus run command :heavy_check_mark:

  1. Run kn workflow quarkus run –help
  2. Results
  3. The title and the follow-up text is OK ✅
Procedure - Use the quarkus run command ✅

Covered by E2E test.

Procedure - Use the quarkus run command with –port flag ✅

Covered by E2E test.

Procedure - Use the quarkus run command with –open-dev-ui flag ✅

Covered by E2E test.

Command - quarkus build ✅

Documentation

Procedure - Use the –help flag with quarkus build command ✅
  1. Run kn workflow quarkus build –help
  2. Results
  3. The title and the follow-up text is OK.
Procedure - Use the quarkus build command ✅

Not supported –image flag has to be set.

Procedure - Use the quarkus build with –image flag ✅

Covered by E2E test.

Procedure - Use the quarkus build with –image-repository flag ✅

Covered by E2E test.

Procedure - Use the quarkus build with –jib flag ✅

Covered by E2E test.

Procedure - Use the quarkus build with –image-tag flag ✅

Covered by E2E test.

Procedure - Use the quarkus build with –push flag ⚠️

Not tested. Not covered by E2E -> Reported in issue.

Procedure - Use the quarkus build with –test flag ⚠️

Not tested. Not covered by E2E -> Reported in issue.

Procedure - Use the quarkus build with –jib-podman flag ⚠️

Not tested. Not covered by E2E -> Reported in issue.

Procedure - Use the quarkus build with –image-registry flag ⚠️

Not tested. Not covered by E2E -> Reported in issue.

Command - quarkus deploy ✅

Documentation is outdated and does not mention this command at all

Procedure - Use the –help flag with quarkus deploy command ✅
  1. Run kn workflow quarkus deploy –help
  2. Results
  3. The title and the follow-up text is OK.
Procedure - Use the quarkus deploy command ✅

Not Covered by E2E test -> Reported in issue.

  1. Run kn workflow depoy
  2. Results
  3. 🎉 Quarkus SonataFlow project successfully deployed
Procedure - Use the quarkus deploy with –path flag ⚠️

Not Covered by E2E test. -> Reported in issue.

Not tested ⚠️

Command - completion ⚠️

Documentation is outdated and does not mention this command at all

Procedure - Use the –help flag with completion command ✅
  1. Run kn workflow completion –help
  2. Results
  3. The title and the follow-up text is OK.
Procedure - Use the bash option with –help flag and try it 🐞
  1. Run kn workflow completion bash –help
  2. Results
  3. The title and the follow-up text is OK.
  4. Procedure seem to have issues
  5. source <(kn workflow completion bash)
  6. Results
  7. Kn workflow command not found
  8. Workaround: change to source <(kn-workflow completion bash)
  9. Result - completion does not seem to work at all.
Procedure - Use the fish option –help flag ✅
  1. Run kn workflow completion fish –help
  2. Results
  3. The title and the follow-up text is OK. Functionality not tested ⚠️
Procedure - Use the powershell option –help flag ✅
  1. Run kn workflow completion powershell –help
  2. Results
  3. The title and the follow-up text is OK.

Functionality not tested ⚠️

Procedure - Use the powershell option –help flag ✅
  1. Run kn workflow completion powershell –help
  2. Results
  3. The title and the follow-up text is OK.

Functionality not tested ⚠️

Procedure - Use the zsh option –help flag ✅
  1. Run kn workflow completion zsh –help
  2. Results
  3. The title and the follow-up text is OK.

Functionality not tested ⚠️