Skip to content

Add failed jobs widget to MR pipelines tab

Frédéric Caplette requested to merge ops-hackathon-pipeline-failures into master

What does this MR do and why?

Add failed jobs tract to MR pipelines tab

Behind a FF we add the ability to see failed jobs trace directly inside the pipelines tab of a MR. Failed jobs are only fetched when clicking on the button to expand the table. Then each failed jobs is fetched and can be clicked on to expand the job log and see why the job failed.

this is behind a disabled feature flag: ci_job_failures_in_mr.

Screenshots or screen recordings

Before After
Screenshot_2023-06-05_at_2.35.59_PM Screenshot_2023-06-05_at_2.44.04_PM

Screen_Recording_2023-06-05_at_3.18.34_PM

How to set up and validate locally

  1. Enable feature flag in rails console `Feature.enable(:ci_job_failures_in_mr)
  2. Make sure to have a functioning runner
  3. We need a MR with jobs failures. An easy to do so is to make a merge request on the ci config file and add explicit failures
  4. Navigate to Build -> Pipeline Editor
  5. Change your config to include jobs failures like so:
my_failed_job:
  script: exit 1
  1. Create a merge request with that change
  2. Navigate to the Merge request page
  3. Go to the pipelines page
  4. Notice the new link "Show failed jobs"
  5. Click on said link
  6. Notice you see all failed jobs
  7. Click on the row of the failed job
  8. Notice that the job log is shown

MR acceptance checklist

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

Poc:
Edited by Frédéric Caplette

Merge request reports

Loading