Add user feedback to Explain This Vulnerability
What does this MR do and why?
This MR adds the user feedback buttons to the bottom of the drawer for the Explain This Vulnerability feature:
How to set up and validate locally
There is currently a bug that prevents Explain This Vulnerability from working with Vertex AI locally, there will be a SSL error. To work around it, either use OpenAI by disabling the explain_vulnerability_vertex
feature flag, or apply this patch:
Index: ee/lib/gitlab/llm/vertex_ai/client.rb
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/ee/lib/gitlab/llm/vertex_ai/client.rb b/ee/lib/gitlab/llm/vertex_ai/client.rb
--- a/ee/lib/gitlab/llm/vertex_ai/client.rb (revision e133bfa495ee5ada4cfae7240f3d1bb476e81ce5)
+++ b/ee/lib/gitlab/llm/vertex_ai/client.rb (date 1685791078547)
@@ -72,7 +72,7 @@
def request(content:, config:, **options)
logger.debug(message: "Performing request to Vertex", config: config)
- response = Gitlab::HTTP.post(
+ response = HTTParty.post(
config.url,
headers: config.headers,
body: config.payload(content).merge(options).to_json,
- Enable these feature flags:
openai_experimentation
,explain_vulnerability
, andexplain_vulnerability_vertex
. - Use the Explain This Vulnerability feature.
- Wait for the response to load.
- Verify that the user feedback buttons are shown at the bottom of the drawer.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #412753 (closed)
Edited by Daniel Tian