Expand the scope between `before_vcs` and `after_vcs`
This makes it include submodule cloning.
This is mainly to include the SSH agent during submodule cloning on the corporate site.
@@ -130,8 +130,6 @@ class SyncRepositoryMixin:
)
# Get the actual code on disk
- try:
- before_vcs.send(sender=self.version)
msg = 'Checking out version {slug}: {identifier}'.format(
slug=self.version.slug,
identifier=self.version.identifier,
@@ -148,8 +146,6 @@ class SyncRepositoryMixin:
version_repo.update()
self.sync_versions(version_repo)
version_repo.checkout(self.version.identifier)
- finally:
- after_vcs.send(sender=self.version)
def sync_versions(self, version_repo):
"""
@@ -238,6 +234,7 @@ class SyncRepositoryTaskStep(SyncRepositoryMixin):
:rtype: bool
"""
try:
+ before_vcs.send(sender=self.version)
self.version = self.get_version(version_pk)
self.project = self.version.project
with self.project.repo_nonblockinglock(version=self.version):
@@ -264,6 +261,9 @@ class SyncRepositoryTaskStep(SyncRepositoryMixin):
},
},
)
+ finally:
+ after_vcs.send(sender=self.version)
+
return False
@@ -440,6 +440,8 @@ class UpdateDocsTaskStep(SyncRepositoryMixin):
# Environment used for code checkout & initial configuration reading
with self.setup_env:
+ try:
+ before_vcs.send(sender=self.version)
if self.project.skip:
raise ProjectBuildsSkippedError
try:
@@ -459,6 +461,8 @@ class UpdateDocsTaskStep(SyncRepositoryMixin):
self.save_build_config()
self.additional_vcs_operations()
+ finally:
+ after_vcs.send(sender=self.version)
if self.setup_env.failure or self.config is None:
msg = 'Failing build because of setup failure: {}'.format(
