Implement the root cause analysis UI
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 |
---|---|
![]() |
![]() |
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.
- Activate feature toggles:
Feature.enable(:ai_build_failure_cause)
Feature.enable(:ai_experimentation_api)
Feature.enable(:tofa_experimentation_main_flag)
- In
ee/app/services/llm/analyze_ci_job_failure_service.rb
file, overridevalid?
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
- Get Vertex AI token using google cloud console
- Configure Vertex AI as described here https://gitlab.com/gitlab-com/gl-infra/production/-/snippets/2541742#note_1415134998
- Create a few failed pipelines in your project (you can clone https://gitlab.com/andrei.zubov/failing-pipeline-test)
- 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.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Andrei Zubov