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

Race condition on creating a deployment PR #128

Open
apesternikov opened this issue Mar 9, 2023 · 1 comment
Open

Race condition on creating a deployment PR #128

apesternikov opened this issue Mar 9, 2023 · 1 comment

Comments

@apesternikov
Copy link
Collaborator

There was a race condition observed:

precondition: deployment branch deploy/name and PR exists
a new gitops workflow run that include update to the deployment
prer in the run fetches the repo with deploy/* branches and start rendering manifests
original PR 1 merged and branch automatically deleted
prer in the run pushes the updated deployment branch and creates a new PR

As a result, the newly created branch and PR includes exact copy of the commits history from the original branch which causes a merge conflict since changes are already present in the target branch (main)

@apesternikov
Copy link
Collaborator Author

We have discussed this issue offline. Looks like the window when such race condition may occur may be reduced. The race condition occurs only when existing deploy branch is updated and force pushed as a new one. prer should only use git push --force when no previous deployment branch exists and if such push fails the whole prer run should be reexecuted starting from git fetch
This does not solve the problem completely since small time window between pushing the branch and creating a PR still exist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant