Skip to content

Draft: Add 'Duration' tab to pipeline page

What does this MR do and why?

This MR adds a Durations tab to the pipeline page, which shows all jobs by their duration, so developers can improve pipeline efficiency by reducing duration.

References

Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Summary Screeshot
Dark mode image
Light mode image
Reference (dark) image
Reference (light) image

How to set up and validate locally

  1. In rails console enable the feature flag
    Feature.enable(:ci_pipeline_durations_tab)
  2. Go to a project
  3. Set up CI with a few example jobs, ideally using needs and sleep (see the example below)
  4. Run a pipeline
  5. Go to the pipeline
  6. Click on the Durations tab
  7. See the durations overview
Click to expand example CI config
workflow:
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
    - if: $CI_COMMIT_TAG
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH

long-job:
  stage: build
  script:
    - for i in $(seq 5000); do echo "This is the very very very very very very very very very very very very very very very very very very very long line"; done
  variables:
    FF_TIMESTAMPS: true

short-job:
  stage: test
  needs: []
  script:
    - sleep 2
  variables:
    FF_TIMESTAMPS: true

slow-job:
  stage: build
  script:
    - sleep 10
  variables:
    FF_TIMESTAMPS: true

woof-job:
  stage: test
  script: ["echo woof :3"]
  variables:
    FF_TIMESTAMPS: true
  
test-job:
  stage: test
  script: [echo TESTING]

rspec unit:
  stage: test
  needs: [test-job]
  parallel: 5
  script: [echo rspec, sleep 5]

rspec system:
  stage: test
  needs: [test-job, slow-job]
  parallel: 3
  script: [echo rspec, sleep 10]

rspec-collector-a:
  needs: [rspec unit, rspec system]
  script: [echo cowwecting covewage vewwy hawd :o]
Edited by Kev Kloss

Merge request reports

Loading