Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ensure pull request exists during conflict resolution #369

Merged
merged 4 commits into from
Jul 15, 2023

Conversation

raffis
Copy link
Contributor

@raffis raffis commented Jul 13, 2023

What does this change

Currently if run is executed and the conflict strategy skip is set it correctly bypasses the branch push.
However it does not make sure a pull request exists.

What issue does it fix

I frequently run into the issue that I get rate limited by github because I run scripts against 200+ repositories.
And if multi-gitter gets aborted at some point by me or because I shutdown my machine I am left with all branches pushed and not all pull requests opened. (Getting rate limited can lead to a loooong execution time of multi-gitter, not much we can do about it).

What I would need to fix this is to use the conflict strategy replace but I might not want that since I changed manually some branches already. Hence there is currently no option to ensure the pull requests actually exists.
This fix just makes sure that a pull request exists even when running with skip conflict resolution.

Notes for the reviewer

An alternative solution would be to add a new conflict strategy for this but I assume it's not required.

Checklist

  • Made sure the PR follows the CONTRIBUTING.md guidelines
  • Tests if something new is added

Copy link
Owner

@lindell lindell left a comment

Choose a reason for hiding this comment

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

I think it's ok to change the current behavior of skip. And I agree that this change should be made 👍

The main comment on the PR is how the changes are reported back to the user. A created PR should be shown in the final output, but there are some options in how it is actually shown. Please share your thoughts in the comment on the test.

internal/multigitter/run.go Outdated Show resolved Hide resolved
tests/table_test.go Show resolved Hide resolved
Signed-off-by: Raffael Sahli <raffael.sahli@doodle.com>
Copy link
Owner

@lindell lindell left a comment

Choose a reason for hiding this comment

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

Looks good 😄

Just two minor code-style comments.

internal/multigitter/repocounter/counter.go Show resolved Hide resolved
internal/multigitter/repocounter/counter.go Outdated Show resolved Hide resolved
internal/multigitter/run.go Outdated Show resolved Hide resolved
raffis and others added 3 commits July 14, 2023 23:34
Copy link
Owner

@lindell lindell left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Thanks for the contribution!

@lindell lindell merged commit 2b7166a into lindell:master Jul 15, 2023
@github-actions
Copy link
Contributor

Included in release v0.47.1 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants