Skip to content

Fix Explain vulnerabilities with AI loading state

Frédéric Caplette requested to merge fix-ai-streaming into master

What does this MR do and why?

When using the explain vulnerability quick action with DuoChat, it would not trigger the loading. To fix this issue, we use the new utility sendDuoChatCommand which opens DuoChat and trigger loading and streaming properly. Documentation: https://docs.gitlab.com/ee/development/ai_features/duo_chat.html#programmatically-open-gitlab-duo-chat

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

2024-07-23_16.11.29

How to set up and validate locally

  1. Setup AI features - https://docs.gitlab.com/ee/development/ai_features/
  2. Enable the Feature Flag explain_vulnerability_tool
  3. Setup some SAST vulnerabilities (or clone the demo project https://gitlab.com/gitlab-org/govern/threat-insights-demos/webgoat.net)
  4. Setup a working runner with a docker executor
  5. Run a pipeline
  6. Go to the vulnerability report -/security/vulnerability_report
  7. Click on a specific vulnerability
  8. Click on Explain vulnerability in the header
  9. Notice the loading state and streaming occur
  10. Click on the text in the issue description You can also use GitLab Duo chat to explain this vulnerability
  11. Notice that the loading and streaming work
Edited by Frédéric Caplette

Merge request reports

Loading