Skip to content
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.

feat(ci retry): retry multiple jobs or entire pipeline #1011

Open
wants to merge 3 commits into
base: trunk
Choose a base branch
from

Conversation

dncohen
Copy link

@dncohen dncohen commented Jul 29, 2022

Description

Before this PR, glab ci retry <jobid> would retry exactly one job, specified by job id.

With this PR glab ci retry will retry the latest pipeline on the current branch, if it finds jobs have failed.

Also, glab ci retry --follow will continue to monitor pipelines on the current branch. If jobs fail, it will trigger a pipeline retry. It will do this until interrupted.

There are some baked-in values which ideally would be configurable. For example, it retries any one pipeline up to 3 times (then gives up). And, it polls for new pipelines every 30 minutes.

How Has This Been Tested?

My motivation is to provide a "band-aid" for code which has a number of flaky tests. They cause pipelines to fail, but often a retry will work. Because it may take some time to address the underlying flaky tests, this is a workaround that should help more pipelines fail.

So, I've tested this a little bit in the scope of that project.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation
  • Chore (Related to CI or Packaging to platforms)

Expands retry command to retry recent pipelines, if they have failed
jobs. Can monitor for failures and retry repeatedly when new pipelines
appear, until interrupted.
@profclems
Copy link
Owner

Hi @dncohen, thanks a lot for this PR. We announced that this project is officially adopted by GitLab #983 (comment). All new contributions should be mode to the GitLab repo: https://gitlab.com/gitlab-org/cli

@clemsbot
Copy link
Collaborator

clemsbot commented Sep 9, 2022

This PR has been automatically marked as stale because it has not had recent activity. This message is just a reminder for the author, reviewers and assignees.

@clemsbot clemsbot added the stale label Sep 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants