-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Build: use same hack for VCS and build environments #9055
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
Conversation
`sync_versions` method executes some commands (e.g. `hg tags`) inside the Docker container used for all the VCS commands. As it was being executed _outside_ the `with` statement the container was being killed after executing `__exit__`. This commit uses the same technique we used as a workaround for build environment as well. However, this is not the most elegant solution and we should find a way to make it better. So far, it works and we can use it as a quick hotfix to make builds continue working.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable for a hotfix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not caught up on the refactor we just did to this code, so I'm not confident my review here.
This seems safe enough, I understand the underlying issue and mostly understand this logic change I think, and I don't believe my note on the two conditionals is important.
So, take this as a +0.5, but only because this is code I'm not familiar with yet.
@@ -65,7 +65,30 @@ def setup_vcs(self): | |||
), | |||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two conditionals will have moved to executing in the context manager. It doesn't seem important that either are executed outside the environment in the first place. But in case anyone has any more information about why this is, these seem to be the only logic order changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code was being already executed inside the context manager. The difference now is that instead of the context manager being executed inside the BuildDirector
is executed in the Celery task, so we can call an extra method there (sync_versions
), which needs to be executed inside the context manager (Docker environment)
Another cleaner approach here would be to avoid using context manager ( This will give us a better understanding of the flow without the complexity/magic/hiddenness that the context managers are currently providing. |
I'm merging this PR since it's already hotfixed and it's working. We can open an issue to track the refactor, tho. |
sync_versions
method executes some commands (e.g.hg tags
) inside the Dockercontainer used for all the VCS commands. As it was being executed outside the
with
statement the container was being killed after executing__exit__
.This commit uses the same technique we used as a workaround for build
environment as well (see #9018). However, this is not the most elegant solution and we
should find a way to make it better.
So far, it works and we can use it as a quick hotfix to make builds continue
working.
Closes #8995