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

Retry work #720

Merged
merged 7 commits into from
May 14, 2021
Merged

Retry work #720

merged 7 commits into from
May 14, 2021

Conversation

maxice8
Copy link
Collaborator

@maxice8 maxice8 commented May 12, 2021

Description

This function uses the retry.Options as documented in the system and fixes a segfault

Related Issue

Resolves #719

How Has This Been Tested?

Merged stuff on gitlab.alpinelinux.org

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)

@maxice8 maxice8 added cmd: mr Issue is related to merge request management Fix This fixes a bug or incorrect documentation labels May 12, 2021
@codecov
Copy link

codecov bot commented May 12, 2021

Codecov Report

Merging #720 (ed404d7) into trunk (ab717b5) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##            trunk     #720   +/-   ##
=======================================
  Coverage   59.46%   59.46%           
=======================================
  Files          90       90           
  Lines        6535     6535           
=======================================
  Hits         3886     3886           
  Misses       2277     2277           
  Partials      372      372           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ab717b5...ed404d7. Read the comment docs.

@maxice8
Copy link
Collaborator Author

maxice8 commented May 12, 2021

we might want to use RetryIf and abort if the error isn't the one we expected, this would make us exit earlier if the error is not the one we are working around

@maxice8
Copy link
Collaborator Author

maxice8 commented May 12, 2021

From https://docs.gitlab.com/ee/api/merge_requests.html#accept-mr

If it has some conflicts and can not be merged - you receive a 406 and the error message ‘Branch cannot be merged’

…geable branch

we do this retry so we can work around a rebase causing the branch to
not be mergeable for a few seconds even though it has no conflicts.

so instead of retrying for every possible error we use `RetryIf` to
check if the error is the one expected and try again, otherwise we just
exit with the error
this is required because we need to verify the status code that is
returned by GitLab
@pull-request-size pull-request-size bot added size/M and removed size/S labels May 12, 2021
@maxice8
Copy link
Collaborator Author

maxice8 commented May 12, 2021

Reworked to have api.MergeMR return the *gitlab.Response, we need to verify the status code we have to be 406

Copy link
Owner

@profclems profclems left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work @maxice8... Thanks a lot

commands/mr/merge/mr_merge.go Outdated Show resolved Hide resolved
@profclems profclems merged commit 3429aef into profclems:trunk May 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cmd: mr Issue is related to merge request management Fix This fixes a bug or incorrect documentation size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

segfault when trying to rebase&&merge
2 participants