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

feat: mr merge options #695

Merged
merged 1 commit into from
Apr 30, 2021
Merged

feat: mr merge options #695

merged 1 commit into from
Apr 30, 2021

Conversation

profclems
Copy link
Owner

@profclems profclems commented Apr 29, 2021

This adds merge options when merging an MR. The user is given three merge options

  • create merge commit
  • squash and merge
  • rebase and merge

NB: This options are only available on TTYs. On non-ttys, the default is to create a merge commit unless the user explicitly specifies the merge method using the available flag options

@codecov
Copy link

codecov bot commented Apr 29, 2021

Codecov Report

Merging #695 (4076dd7) into trunk (c443358) will decrease coverage by 0.24%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##            trunk     #695      +/-   ##
==========================================
- Coverage   60.00%   59.75%   -0.25%     
==========================================
  Files          90       90              
  Lines        6458     6485      +27     
==========================================
  Hits         3875     3875              
- Misses       2218     2245      +27     
  Partials      365      365              
Impacted Files Coverage Δ
commands/cmdutils/cmdutils.go 73.68% <0.00%> (ø)
commands/issue/create/issue_create.go 32.12% <0.00%> (ø)
commands/mr/create/mr_create.go 28.76% <0.00%> (ø)
commands/mr/mrutils/mrutils.go 65.56% <0.00%> (-14.28%) ⬇️
pkg/iostreams/iostreams.go 39.36% <0.00%> (ø)

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 c443358...4076dd7. Read the comment docs.

@profclems profclems changed the title feat mr merge options feat: mr merge options Apr 29, 2021
@profclems profclems force-pushed the feat-mr-merge-options branch 3 times, most recently from b99aa0d to 1ed3605 Compare April 29, 2021 20:07
This adds merge options when merging an MR. The user is given three merge options
- create merge commit
- squash and merge
- rebase and merge

NB: This options are only available on TTYs. On non-ttys, the default is to create a merge commit unless the user explicitly specifies the merge method using the available flag options
@profclems profclems requested a review from zemzale April 29, 2021 20:09
@profclems profclems merged commit 87c2a99 into trunk Apr 30, 2021
@profclems profclems deleted the feat-mr-merge-options branch April 30, 2021 05:31
Copy link
Collaborator

@zemzale zemzale left a comment

Choose a reason for hiding this comment

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

Looks nice!

@maxice8
Copy link
Collaborator

maxice8 commented Apr 30, 2021

Thanks for working on this but it still has the race condition problem:

[container::toolbox] ───── gl mr merge garcon                                                 ~/R/aports (glib-networking)
? Merge when pipeline succeeds? No
? What merge method would you like to use? Rebase and merge
? What's next? Submit
✓ Rebase successful
\ Merging merge request !20994 PUT https://gitlab.alpinelinux.org/api/v4/projects/alpine/aports/merge_requests/20994/merge: 406 {message: Branch cannot be merged}

Trying to merge too quickly after rebasing results in this error, I work around this on my wrapper shellscript to just keep trying 2 or 3 times every 4 seconds

@profclems
Copy link
Owner Author

Thanks @maxice8... I will fix that with a follow-up PR

profclems added a commit that referenced this pull request May 12, 2021
Merge fails when mr is rebasing and it is due to glab being too fast for GitLab. To solve this, we retry the merge api 3 times at a 6s interval each

Ref: #695 (comment)
Resolves #407
profclems added a commit to olearycrew/glab that referenced this pull request Jun 12, 2021
Merge fails when mr is rebasing and it is due to glab being too fast for GitLab. To solve this, we retry the merge api 3 times at a 6s interval each

Ref: profclems#695 (comment)
Resolves profclems#407
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants