diff options
author | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2018-07-19 14:47:11 +0200 |
---|---|---|
committer | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2018-07-19 14:47:11 +0200 |
commit | 80c61639f3a3da4895ec0a50437497dc97b4eb49 (patch) | |
tree | 47163d5edc7cb500f7a488a3607702af11e6f52d /lib | |
parent | 66f5be832b40355bda2a56af31c112bfddedb7b1 (diff) | |
download | gitlab-ce-80c61639f3a3da4895ec0a50437497dc97b4eb49.tar.gz |
Remove refs cleanup job
Introduced by f20eadcbbeb88e98c2608cbaf23f0d09ca002a98, meant to remove
refs from Git using the wrong name. That never made it to a non-rc
release and can be safely removed now.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/tasks/gitlab/cleanup.rake | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/lib/tasks/gitlab/cleanup.rake b/lib/tasks/gitlab/cleanup.rake index 52ae1330d7f..5e07b12ee1c 100644 --- a/lib/tasks/gitlab/cleanup.rake +++ b/lib/tasks/gitlab/cleanup.rake @@ -104,28 +104,5 @@ namespace :gitlab do puts "To block these users run this command with BLOCK=true".color(:yellow) end end - - # This is a rake task which removes faulty refs. These refs where only - # created in the 8.13.RC cycle, and fixed in the stable builds which were - # released. So likely this should only be run once on gitlab.com - # Faulty refs are moved so they are kept around, else some features break. - desc 'GitLab | Cleanup | Remove faulty deployment refs' - task move_faulty_deployment_refs: :gitlab_environment do - projects = Project.where(id: Deployment.select(:project_id).distinct) - - projects.find_each do |project| - rugged = project.repository.rugged - - max_iid = project.deployments.maximum(:iid) - - rugged.references.each('refs/environments/**/*') do |ref| - id = ref.name.split('/').last.to_i - next unless id > max_iid - - project.deployments.find(id).create_ref - project.repository.delete_refs(ref) - end - end - end end end |