diff options
author | Stan Hu <stanhu@gmail.com> | 2019-05-17 14:43:58 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-05-17 14:45:41 -0700 |
commit | 6c6e4ca495f56ec9df8e5e6ec744744404414f8c (patch) | |
tree | 146ebb6d880b8853d60dedecbe1773b8b16ce173 /app/services/git | |
parent | 04794fb476a6071c1e1f782ae1c81801ff2410c3 (diff) | |
download | gitlab-ce-6c6e4ca495f56ec9df8e5e6ec744744404414f8c.tar.gz |
Fix remote mirrors not updating after tag pushsh-fix-tag-push-remote-mirror
Remote mirrors were only being updated after pushes to branches, not
tags. This change consolidates the functionality into
Git::BaseHooksService so that both tags and branches will now update
remote mirrors.
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/51240
Diffstat (limited to 'app/services/git')
-rw-r--r-- | app/services/git/base_hooks_service.rb | 9 | ||||
-rw-r--r-- | app/services/git/branch_push_service.rb | 1 |
2 files changed, 9 insertions, 1 deletions
diff --git a/app/services/git/base_hooks_service.rb b/app/services/git/base_hooks_service.rb index 9d371e234ee..d30df34e54b 100644 --- a/app/services/git/base_hooks_service.rb +++ b/app/services/git/base_hooks_service.rb @@ -17,6 +17,8 @@ module Git # Not a hook, but it needs access to the list of changed commits enqueue_invalidate_cache + update_remote_mirrors + push_data end @@ -92,5 +94,12 @@ module Git def pipeline_options {} end + + def update_remote_mirrors + return unless project.has_remote_mirror? + + project.mark_stuck_remote_mirrors_as_failed! + project.update_remote_mirrors + end end end diff --git a/app/services/git/branch_push_service.rb b/app/services/git/branch_push_service.rb index abf11f253f6..c4910180787 100644 --- a/app/services/git/branch_push_service.rb +++ b/app/services/git/branch_push_service.rb @@ -27,7 +27,6 @@ module Git execute_related_hooks perform_housekeeping - update_remote_mirrors stop_environments true |