You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TL;DR: Please git pull the branch before pushing it, to avoid clashes of parallel usage
Developers of our solution team are big fans of gitopscli and create-preview.
A consequence of that is, that there is a a lot of activity in our config-repo, as each push to a branch creates a preview environment to run tests against it.
Unfortunately parallel preview creation is currently crashing many times.
Because while Job A is cloning the repo (takes 30-40 seconds), Job B may commit its preview configs onto master.
Then when Job A wants to push its changes, a git error appears like this: "Updates were rejected because the remote contains work that you do have locally"
10:43:43 + gitopscli create-preview --git-provider-url https://bitbucket.balgroupit.com/ --git-user customer-contact-devops-user --git-email ****@balgroupit.com --organisation CIP --repository-name mybaloise-api --preview-id 93b81dce3a794ca0d3aca4ae2fb8bb5a24d85c22_CI --git-hash 23140757b95b0f8da8dabbf3c056a1db4efa69e9
10:44:07 INFO clone: Cloning repository: https://bitbucket.balgroupit.com/scm/dplcaast01/customer-contact-non-prod.git
10:44:17 INFO __create_preview_from_template_if_not_existing: Create new folder for preview: mybaloise-api-65c6c2dc-preview
....
10:44:18 INFO push: Pushing branch: master
10:44:18 ERROR main: Error pushing branch 'master' to origin:
10:44:18 stderr: 'To https://bitbucket.balgroupit.com/scm/dplcaast01/customer-contact-non-prod.git
10:44:18 ! [rejected] master -> master (fetch first)
10:44:18 error: failed to push some refs to 'https://bitbucket.balgroupit.com/scm/dplcaast01/customer-contact-non-prod.git'
10:44:18 hint: Updates were rejected because the remote contains work that you do
10:44:18 hint: not have locally. This is usually caused by another repository pushing
10:44:18 hint: to the same ref. You may want to first integrate the remote changes
10:44:18 hint: (e.g., 'git pull ...') before pushing again.
Resolves#229
If another user pushes changes to the remote repo after gitopscli has cloned it,
the subsequent push will fail. Alliviate this problem by pulling and rebasing
local changes on top of any remote changes just before pushing.:
For the case of creating a new branch (for a PR), the pull is skipped because
it would fail due to the missing remote branch.
TL;DR: Please
git pull
the branch before pushing it, to avoid clashes of parallel usageDevelopers of our solution team are big fans of gitopscli and create-preview.
A consequence of that is, that there is a a lot of activity in our config-repo, as each push to a branch creates a preview environment to run tests against it.
Unfortunately parallel preview creation is currently crashing many times.
Because while Job A is cloning the repo (takes 30-40 seconds), Job B may commit its preview configs onto master.
Then when Job A wants to push its changes, a git error appears like this: "Updates were rejected because the remote contains work that you do have locally"
Proposal is to add "git pull --no-rebase" to this line here:
https://github.com/baloise/gitopscli/blame/0e9b8de52d29812990337e3d85d978e899a2706e/gitopscli/commands/create_preview.py#L104
The text was updated successfully, but these errors were encountered: