Skip to content

Add user feedback to Explain This Vulnerability

Daniel Tian requested to merge 412753-add-explain-vuln-feedback-buttons into master

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:

ksnip_20230604-001538

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,
  1. Enable these feature flags: openai_experimentation, explain_vulnerability, and explain_vulnerability_vertex.
  2. Use the Explain This Vulnerability feature.
  3. Wait for the response to load.
  4. 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.

Related to #412753 (closed)

Edited by Daniel Tian

Merge request reports

Loading