Skip to content

Fix pipeline minutes calculation for non-started builds

Max Fan requested to merge 404550-fix-pipeline-undefined-error into master

What does this MR do and why?

Addresses sentry errors: https://new-sentry.gitlab.net/organizations/gitlab/issues/72454/?project=3&referrer=gitlab_integration

When a build is completed but has no duration, the minutes calculation will error out.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

How to set up and validate locally

  1. Ensure there's only 1 runner picking up jobs
  2. gitlab-ci.yml should be something like
build osx:
  stage: build
  script:
    - echo "a"
  artifacts:
    paths:
      - binaries/

test osx:
  stage: test
  script:
    - echo "b"
  dependencies:
    - build osx
  when: manual
  1. When build osx finishes. Remove the job via the UI's delete button on the job
  2. Run the manual job test osx - this should fail as it depends on previous job
  3. Navigating to pipeline will error out (this MR fixes that)

MR acceptance checklist

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

Related to #404550 (closed)

Edited by Max Fan

Merge request reports

Loading