Skip to content

feat: add fix pipeline flow

What does this merge request do and why?

Initial version of "fix pipeline" flow. This flow will eventually be able to receive a failing pipeline URL, or a failing job URL. This MR only adds the functionality to pass in a failing job URL.

How to set up and validate locally

  1. Setup your remote execution environment in GDK by following instructions here
  2. Find a failing job, and copy the job url.
  3. Use below curl to start the workflow
curl --location 'http://gdk.test:3000/api/v4/ai/duo_workflows/workflows' \
    --header 'Content-Type: application/json' \
    --header "PRIVATE-TOKEN: $PAT" \
    --data '{
        "project_id": "1000000",
        "goal": "FAILING_JOB_URL_HERE",
        "workflow_definition": "fix_pipeline",
        "agent_privileges": [1,2,3,5],
        "pre_approved_agent_privileges": [1,2,3,5],
        "start_workflow": true,
        "use_service_account": true,
        "allow_agent_to_request_user": false
}'
  1. Go to pipelines (Build > Pipelines) and see the running flow.
  2. When the workflow job is completed, you should see a new Merge Request with the changes attempting to fix the failing job.

Here is an example job that can be fixed by this flow:

image: python:3.12.11

stages:
  - test

prod:
  stage: test
  script:
    - echo "Release description is $CI_RELEASE_DESCRIPTION"
    - echo "Release name is $CI_RELEASE_NAME"
    - echo "Saving the current date to file"
    - datte > current_date.txt

Test Cases:

  1. Run the above curl command with a failing job on a tag on main (i.e. no MR).
  2. Run the above curl command with a failing job on an MR. (This will require an extra param in the curl command above: "source_branch": "BRANCH-NAME-FOR-MR")

Merge request checklist

  • Tests added for new functionality. If not, please raise an issue to follow up.
  • Documentation added/updated, if needed.

Issue: gitlab-org/gitlab#554901 (closed) Related to: !3074 (merged)

Edited by Sebastian Rehm

Merge request reports

Loading