Commit b66f4898ea14bdfe271465fbcc9b133ae0bee4f1
1 parent
65cba5c6
Exists in
master
and in
4 other branches
Better message for migrating global projects
Showing
1 changed file
with
9 additions
and
2 deletions
Show diff stats
lib/tasks/migrate/migrate_global_projects.rake
| 1 | 1 | desc "GITLAB | Migrate Global Projects to Namespaces" |
| 2 | 2 | task migrate_global_projects: :environment do |
| 3 | - puts "This will move all projects without namespace to owner namespace" | |
| 4 | - ask_to_continue | |
| 3 | + found = Project.where(namespace_id: nil).count | |
| 4 | + if found > 0 | |
| 5 | + puts "Global namespace is deprecated. We found #{found} projects stored in global namespace".yellow | |
| 6 | + puts "You may abort this task and move them to group/user namespaces manually." | |
| 7 | + puts "If you want us to move this projects under owner namespaces then continue" | |
| 8 | + ask_to_continue | |
| 9 | + else | |
| 10 | + puts "No global projects found. Proceed with update.".green | |
| 11 | + end | |
| 5 | 12 | |
| 6 | 13 | Project.where(namespace_id: nil).find_each(batch_size: 20) do |project| |
| 7 | 14 | begin | ... | ... |