Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-05-18 00:43:58 +0300
committerStan Hu <stanhu@gmail.com>2019-05-18 00:45:41 +0300
commit6c6e4ca495f56ec9df8e5e6ec744744404414f8c (patch)
tree146ebb6d880b8853d60dedecbe1773b8b16ce173 /app/services/git
parent04794fb476a6071c1e1f782ae1c81801ff2410c3 (diff)
Fix remote mirrors not updating after tag push
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.rb9
-rw-r--r--app/services/git/branch_push_service.rb1
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