-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
rake release failed to push tag due to local out of date branch #7818
Comments
Hei, thanks for the report. Can you explain, with |
Hi @deivid-rodriguez, I wasn't using Before that, I used the following steps to publish a gem:
In this case, either I saw the note on |
Ok, thanks for letting me know, that makes sense. Just checking how the implementation again, I think we have never supported your current situation, since even when we did That said, I think it'd be reasonable to cover your case by only pushing the current branch if the current commit is not already part of it. Would you consider sending us a patch to implement that? |
@deivid-rodriguez I would be happy to work on a patch for it. I am planning to use If this sounds good to you, I will submit a PR using this approach. |
Happy with any solution you come up with, but will that work? If I understand correctly, this is about detecting if the current HEAD commit is already present in the remote branch, not about detecting the proper remote branch. My understanding is that the proper remote branch to push to is already resolved by git automatically? |
Let me elaborate in more detail. The example of matching the current branch with the remote branch was one of the possible scenarios. I tried a few scenarios on my end with
My assumption for the fix is to support scenarios 3 and 4 only. Regarding scenario 4, we could let the Another question I have in mind is whether a |
Oh, I see! You'll use My current thoughts are:
|
Good point on the To summarize the issue I faced, the current behavior for In the original scenario, all the commits were being pushed to remote. For example, the commit of the gemspec is pushed to remote, which triggers the test suite to run. This is followed by a |
Hi @deivid-rodriguez i just created a PR #7835 for this issue and written down the specific scenario in the test. |
Referring to #7835 (comment), I agreed with @deivid-rodriguez that this probably shouldn't be a concern for the To workaround this behavior in my use case (e.g. the CI environment), i have resorted to create a new |
Describe the problem as clearly as you can
Encountered a git push issue with bundle rake release when it is being called in the CI environment, especially with the GitHub Action provided by RubyGems (https://github.com/rubygems/release-gem).
Due to the fix in #4309, the release task will always push branch to remote when pushing the tag.
However, in the CI environment where a release task is triggered after the test suite has passed, the git push command might be pushing the out of date branch and causing git to raise an error. As a result, the release will fail.
It is also impossible to retry the release task for an older commit in this case, regardless of the CI environment or local machine setup.
Did you try upgrading rubygems & bundler?
Yes
Post steps to reproduce the problem
bundle exec rake release
Which command did you run?
bundle exec rake release
What were you expecting to happen?
bundle exec rake release
push tag to remote successfully as long as current commit exists in remoteWhat actually happened?
bundle exec rake release
is pushing remote tag and branch all the time.If not included with the output of your command, run
bundle env
and paste the output belowEnvironment
Bundler Build Metadata
Bundler settings
The text was updated successfully, but these errors were encountered: