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

No PR opened, if branch is up to date #32

Closed
radicarl opened this issue Apr 27, 2021 · 5 comments · Fixed by #34
Closed

No PR opened, if branch is up to date #32

radicarl opened this issue Apr 27, 2021 · 5 comments · Fixed by #34
Labels
bug Something isn't working

Comments

@radicarl
Copy link

Hello,

found something which is probably a bug or at least unexpected behavior.

If, for some reason the changes I made with git-xargs exists already in the branch on github, the tool prints the following errors and does not open a PR.

[git-xargs] DEBU[2021-04-27T08:45:41+02:00] Error pushing new branch to remote origin     Error="already up-to-date" Repo=room-management-example
[git-xargs] DEBU[2021-04-27T08:45:41+02:00] Error encountered while processing repo       Error="already up-to-date" Repo name=room-management-example

I run into this error, because I run my git-xargs command two times. The first time I run into an error on opening the PR. After fixing this, I run the command a second time and failed on the update. I had to delete the remote branch first.
I think it the tool should not break on an "already up-to-date" message, because the state of the repository is like it should be, only the way to achived was different.

Think this is an edge case and nothing urgent.

@brikis98 brikis98 added the bug Something isn't working label Apr 27, 2021
@brikis98
Copy link
Member

I just hit the same issue. It actually pushes the code to the existing branch correctly, so the original PR gets updated, but then you get this error about failing to try to open the PR again. I'll take a look.

@radicarl
Copy link
Author

radicarl commented Apr 27, 2021

Hey,

you are fast, too fast :)
The problem I ran into, was that on the first run, no PR was openend (because of the hard coded master-branch, but could also be missing permissions or something else) and on the second run, git-xargs stopped because the push did not changed the remote branch.
Updating the PR won't help in this case, because there is none.

I think you have to change the method pushLocalBranch and filter for the "already up-to-date"-Error

@radicarl
Copy link
Author

Hello,

I tested 0.0.8 and still run in this issue.
This time the tool stopped earlier, because the script does not change the local repository. So there was nothing to commit.

My Expectation is, that the tool opens a PR as long as the given branch differs from the default-branch.

@brikis98
Copy link
Member

I think that's a similar, but separate issue: detecting if (a) there is an existing branch in the remote but (b) no existing PR for that branch. Could you file a separate issue for that?

@radicarl
Copy link
Author

radicarl commented May 7, 2021

done, see #39

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants