Commit daf2cf62d7f6f718cb723ae61c4ef60e5d6a711f

Authored by Dmitriy Zaporozhets
2 parents e4ba9349 a5e19c4e

Merge pull request #5163 from hiroponz/update-check-script-in-stable-branch

Update check script in stable branch
Showing 1 changed file with 28 additions and 1 deletions   Show diff stats
lib/tasks/gitlab/check.rake
... ... @@ -22,6 +22,7 @@ namespace :gitlab do
22 22 check_tmp_writable
23 23 check_init_script_exists
24 24 check_init_script_up_to_date
  25 + check_projects_have_namespace
25 26 check_satellites_exist
26 27 check_redis_version
27 28 check_git_version
... ... @@ -552,6 +553,32 @@ namespace :gitlab do
552 553 end
553 554 end
554 555  
  556 + def check_projects_have_namespace
  557 + print "projects have namespace: ... "
  558 +
  559 + unless Project.count > 0
  560 + puts "can't check, you have no projects".magenta
  561 + return
  562 + end
  563 + puts ""
  564 +
  565 + Project.find_each(batch_size: 100) do |project|
  566 + print "#{project.name_with_namespace.yellow} ... "
  567 +
  568 + if project.namespace
  569 + puts "yes".green
  570 + else
  571 + puts "no".red
  572 + try_fixing_it(
  573 + "Migrate global projects"
  574 + )
  575 + for_more_information(
  576 + "doc/update/5.4-to-6.0.md in section \"#global-projects\""
  577 + )
  578 + fix_and_rerun
  579 + end
  580 + end
  581 + end
555 582  
556 583 # Helper methods
557 584 ########################
... ... @@ -659,7 +686,7 @@ namespace :gitlab do
659 686 end
660 687  
661 688 def check_gitlab_shell
662   - required_version = Gitlab::VersionInfo.new(1, 7, 0)
  689 + required_version = Gitlab::VersionInfo.new(1, 7, 1)
663 690 current_version = Gitlab::VersionInfo.parse(gitlab_shell_version)
664 691  
665 692 print "GitLab Shell version >= #{required_version} ? ... "
... ...