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

Non-atomic push fallback condition in version command should be enhanced #2695

Closed
fsmaia opened this issue Aug 19, 2020 · 2 comments
Closed
Labels

Comments

@fsmaia
Copy link

fsmaia commented Aug 19, 2020

PR #2467 introduced a great feature: when --atomic fails due to lack of support, it performs a "non-atomic" push.
However, the fallback condition is not precise and is invoking the fallback even when there is support to atomic.

Expected Behavior

When running lerna publish, if a git merge happens in the meanwhile, it should reject the push command, and invoke the non-atomic mode only if git doesn't support it.

Current Behavior

According to the following logs, the atomic push failed due to being behind upstream, which should stop the execution without invoking the fallback, however it didn't:

lerna info auto-confirmed 
lerna info execute Skipping releases
lerna info git Pushing tags...
lerna WARN gitPush Warning: Permanently added 'bitbucket.org,18.205.93.0' (RSA) to the list of known hosts.
lerna WARN gitPush error: atomic push failed for ref refs/heads/master. status: 5
lerna WARN gitPush 
lerna WARN gitPush fatal: The remote end hung up unexpectedly
lerna WARN gitPush To bitbucket.org:ifood/portal-packages.git
lerna WARN gitPush  ! [rejected]          master -> master (fetch first)
lerna WARN gitPush error: failed to push some refs to 'git@bitbucket.org:ifood/portal-packages.git'
lerna WARN gitPush hint: Updates were rejected because the remote contains work that you do
lerna WARN gitPush hint: not have locally. This is usually caused by another repository pushing
lerna WARN gitPush hint: to the same ref. You may want to first integrate the remote changes
lerna WARN gitPush hint: (e.g., 'git pull ...') before pushing again.
lerna WARN gitPush hint: See the 'Note about fast-forwards' in 'git push --help' for details.
lerna info gitPush --atomic failed, attempting non-atomic push
...

Possible Solution

Instead of looking for atomic in the error log, we could look for: gitPush fatal: the receiving end does not support --atomic push or something like does not support --atomic.

Steps to Reproduce (for bugs)

  1. Start a lerna publish, with git version higher than 2.4.0
  2. Merge a pull-request to the target branch in the meanwhile
  3. isBehingUpstream should be executed in the version command and it is not (could be a separate issue)
  4. The atomic push will fail
  5. [Bug] The non-atomic push will be executed when it shouldn't
@github-actions
Copy link

github-actions bot commented Jun 3, 2022

Hi Folks 👋

You may or may not know that lerna is now under the stewardship of Nrwl (announcement here #3121), a company with a long history of not just producing valuable open-source software (OSS), but also backing others (at the time of writing, Nrwl has donated over $50,000 to OSS it hasn't created, see https://opencollective.com/nx for full details).

Quite simply, Nrwl ❤️ OSS, and is committed to making lerna the best it can be. We use it ourselves.

In order to take this awesome project forward from its current state, it is important that we focus our finite resources on what is most important to lerna users in 2022.

With that in mind, we have identified this issue as being potentially stale due to its age and/or lack of recent activity.


Next steps:

We want to give you some time to read through this comment and take action per one of the steps outlined below, so for the next 14 days we will not make any further updates to this issue.

@fsmaia as the original author of this issue, we are looking to you to update us on the latest state of this as it relates to the latest version of lerna.

Please choose one of the steps below, depending on what type of issue this is:

  • A) If this issue relates to a potential BUG in the latest version of lerna:

  • B) If this issue is a FEATURE request to be added to the latest version of lerna:

    • Simply comment back on this thread so that we know you still want us to consider the request for the latest version of lerna.
  • C) If this issue is a QUESTION which is applicable to latest version of lerna:

  • D) If this issue is no longer applicable to the latest version of lerna:

    • Please close the issue.

If we do not hear from @fsmaia on this thread within the next 14 days, we will automatically close this issue.

If you are another user impacted by this issue but it ends up being closed as part of this process, we still want to hear from you! Please simply head over to our new issue templates and fill out all the requested details on the template which applies to your situation:

https://github.com/lerna/lerna/issues/new/choose

Thank you all for being a part of this awesome community, we could not be more excited to help move things forward from here 🙏 🚀

@github-actions github-actions bot added the stale label Jun 3, 2022
@github-actions
Copy link

Hi Folks 👋

You will have seen in our message above that we at Nrwl are working really hard to bring the lerna repo up to date with what matters most to its community in June 2022.

As previously stated in that message, because we have not heard from the original author of this issue within the last 14 days, we are now automatically closing it.

If any users, including the original author, are still impacted by this issue then we still want to hear from you!

All we ask is that you first update to the latest lerna (5.1.4 at the time of writing) to make sure it is still reproducible, and then fill out one of our new issue templates, providing all the requested details which apply to your situation:

https://github.com/lerna/lerna/issues/new/choose

Many thanks again! 🙏


P.S. Over and above getting to grips with the repo, we have also been hard at work launching a new website, resolving all vulnerabilities, merging exciting new features and reigniting community PR contributions! 🚀

You can read our recent blog post to learn more about what we've been up to:
https://blog.nrwl.io/lerna-5-1-new-website-new-guides-new-lerna-example-repo-distributed-caching-support-and-speed-64d66410bec7

@github-actions github-actions bot locked and limited conversation to collaborators Jun 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant