Fix Explain vulnerabilities with AI loading state
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
How to set up and validate locally
- Setup AI features - https://docs.gitlab.com/ee/development/ai_features/
- Enable the Feature Flag
explain_vulnerability_tool
- Setup some SAST vulnerabilities (or clone the demo project https://gitlab.com/gitlab-org/govern/threat-insights-demos/webgoat.net)
- Setup a working runner with a docker executor
- Run a pipeline
- Go to the vulnerability report
-/security/vulnerability_report
- Click on a specific vulnerability
- Click on
Explain vulnerability in the header
- Notice the loading state and streaming occur
- Click on the text in the issue description
You can also use GitLab Duo chat to explain this vulnerability
- Notice that the loading and streaming work
Edited by Frédéric Caplette