Skip to content

Implement the root cause analysis UI

Andrei Zubov requested to merge azubov-rootcause-ui-implementation into master

What does this MR do and why?

This MR adds a UI for https://gitlab.com/gitlab-org/gitlab/-/issues/411603+ .

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

No root cause data yet After root cause data is generated
Screenshot_2023-06-21_at_12.04.20 Screenshot_2023-06-21_at_12.04.33

How to set up and validate locally

If you want to have an initial setup that allows you to test AI related features locally, you can run this script. In this case you can skip the step 3.

  1. Activate feature toggles:
Feature.enable(:ai_build_failure_cause)
Feature.enable(:ai_experimentation_api)
Feature.enable(:tofa_experimentation_main_flag)
  1. In ee/app/services/llm/analyze_ci_job_failure_service.rb file, override valid? function:
diff --git a/ee/app/services/llm/analyze_ci_job_failure_service.rb b/ee/app/services/llm/analyze_ci_job_failure_service.rb
index e1c6d6c7ebe8..0713d1d33fd9 100644
--- a/ee/app/services/llm/analyze_ci_job_failure_service.rb
+++ b/ee/app/services/llm/analyze_ci_job_failure_service.rb
@@ -8,11 +8,12 @@ class AnalyzeCiJobFailureService < BaseService
 
     override :valid
     def valid?
-      super &&
-        user.can?(:read_build_trace, job) &&
-        Feature.enabled?(:ai_build_failure_cause, job.project) &&
-        job.project.licensed_feature_available?(:ai_analyze_ci_job_failure) &&
-        Gitlab::Llm::StageCheck.available?(job.resource_parent.root_ancestor, :ai_analyze_ci_job_failure)
+      true
+      # super &&
+      #   user.can?(:read_build_trace, job) &&
+      #   Feature.enabled?(:ai_build_failure_cause, job.project) &&
+      #   job.project.licensed_feature_available?(:ai_analyze_ci_job_failure) &&
+      #   Gitlab::Llm::StageCheck.available?(job.resource_parent.root_ancestor, :ai_analyze_ci_job_failure)
     end
 
     private
  1. Get Vertex AI token using google cloud console
  2. Configure Vertex AI as described here https://gitlab.com/gitlab-com/gl-infra/production/-/snippets/2541742#note_1415134998
  3. Create a few failed pipelines in your project (you can clone https://gitlab.com/andrei.zubov/failing-pipeline-test)
  4. Navigate to a failed job page, and press "Root cause analysis" button

Feel free to ping me if you have any questions.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Andrei Zubov

Merge request reports