Skip to content

Add a new ai action for job trace analysis

Allison Browne requested to merge ab-root-cause-part-1 into master

What does this MR do and why?

Introduce a feature flag and new ai action for getting the root cause analysis of the job.

The data key is added to the aiAction result since we plan to return the existing fetched data from the mutation instead of via a subscription. See the more complete draft: !121081 (merged)

This is intended to unblock merging the front end by introducing the api field we will use and the flag.

Screenshots or screen recordings

Screenshot_2023-05-22_at_2.38.40_PM

How to set up and validate locally

  1. Enable Saas
  2. Ensure EE and Ultimate license
  3. Enable the features ai_build_failure_cause and openai_experimentation
  4. Run the mutation:
mutation ajf {
  aiAction(input: {analyzeCiJobFailure: {resourceId: "gid://gitlab/Ci::Build/351"}}) {
    requestId,
    errors
  }
}
query q { project(fullPath: "root/cache-test") {
    job(id: "gid://gitlab/Ci::Build/350") {
    	id,
      aiFailureAnalysis
    }
  }
}

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 Allison Browne

Merge request reports

Loading