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

feat(git): safely force push with lease #11754

Merged
merged 1 commit into from Sep 30, 2021

Conversation

herndlm
Copy link
Contributor

@herndlm herndlm commented Sep 15, 2021

Changes:

Switches from --force to --force-with-lease for git push commands to push safer by avoiding to overwrite remote changes.

Context:

Closes #11590

Documentation

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

Details:
I tried to add a new test that would trigger the force-push error and verify the new behaviour but failed. It always force-pushed successfully in the tests, but manually (by switching in to the git repo dirs that were used for testing) it correctly failed, I unfortunately don't know why. But triggering the force-push error will be pretty rare anyways I guess.
Manually verified via

  • Letting renovate rebase PRs in general (e.g. after I merged another PR to develop)
  • Triggering the force-push error manually
    • Create changes on the develop branch
    • Start renovate to let it update the branches
    • Rebase a renovate branch on develop and force-push while renovate is still updating artifacts
    • See the force-push error in the debug logs and renovate skip this branch with a general WARN: Error updating branch and do nothing

@herndlm herndlm force-pushed the feature/force-push-with-lease branch from 9823b0e to 872f792 Compare September 22, 2021 08:05
@herndlm herndlm marked this pull request as ready for review September 22, 2021 08:20
@rarkins rarkins changed the title feat: safely force push with lease feat(git): safely force push with lease Sep 30, 2021
@rarkins rarkins merged commit a630a92 into renovatebot:main Sep 30, 2021
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 27.22.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@herndlm herndlm deleted the feature/force-push-with-lease branch October 13, 2021 12:30
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use --force-with-lease instead of --force on git push
3 participants