IBM / gen-ai-rag-watsonx-sample-application

Sample application that uses generative AI RAG pattern. Deployment target on IBM Cloud and uses IBM watsonx.ai, watsonx Assistant and Watson Discovery services
Apache License 2.0
6 stars 6 forks source link

CC pipeline property app-name is not set #26

Open in-1911 opened 3 weeks ago

in-1911 commented 3 weeks ago

CC pipeline expects app-name property to be set when a dynamic scan step is executed, however that property is not set in any of the pipeline or trigger settings. As a result, the cc-dynamic-scan step fails with an error below. CI pipeline sets it dynamically during the deploy step.

Using PIPELINE_WORKSPACE as /workspace/app
590 | ERROR | 2024-10-03T19:48:24.837Z | index.ts:37:12 | An unhandled exception occured while processing the command
590 | ERROR | 2024-10-03T19:48:24.866Z | index.ts:38:12 | CLI version: 1.111.1
590 | ERROR | 2024-10-03T19:48:24.878Z | index.ts:39:12 | CLI argv: ["/opt/cocoa/bin/cocoa.linux","/snapshot/cli/build/index.js","inventory","get","--entry=","--org=rag-da-lab","--repo=rag-lab-00-inventory-repo","--environment=prod","--git-provider=gitlab","--git-token-path=./inventory-token","--git-api-url=https://us-south.git.cloud.ibm.com/api/v4","--property=app_artifacts"]
590 | ERROR | 2024-10-03T19:48:24.880Z | index.ts:81:12 | Full stack trace is shown below:
590 | ERROR | 2024-10-03T19:48:24.896Z | index.ts:82:12 | SyntaxError: Unexpected token e in JSON at position 2
590 | ERROR | 2024-10-03T19:48:24.896Z | index.ts:82:12 |     at JSON.parse (<anonymous>)
590 | ERROR | 2024-10-03T19:48:24.897Z | index.ts:82:12 |     at Inventory.getEntry (/snapshot/cli/src/inventory.ts:122:19)
590 | ERROR | 2024-10-03T19:48:24.897Z | index.ts:82:12 |     at Object.handler (/snapshot/cli/src/commands/inventory/get.command.ts:135:24)
brendankellyibm commented 3 weeks ago

@in-1911 it's currently set to pull the prod_app_url from inventory once CD pipeline is run. I'll make the script more robust to handle this case (CD not run yet, presumably) and also allow the dynamic scan to run against the dev_app_url if desired.

in-1911 commented 3 weeks ago

@brendankellyibm - the problem is with app-name, not app-url. The CD has been completed by the time I started the CC run.