Commit eb86e3ed authored by Marin Jankovski's avatar Marin Jankovski

Merge branch 'fix-rake-import-check' into 'master'

Check that project was actually created rather than just validated in import:repos task

Add gitlab-shell to error message to give user a clue that something may be wrong there.

Ran into this in #2082. User was told that repositories were created when they were
not due to `hooks` symlink being wrong.

See merge request !1039
parents 6b5551d9 3e9b6123
...@@ -4,6 +4,7 @@ v 7.14.0 (unreleased) ...@@ -4,6 +4,7 @@ v 7.14.0 (unreleased)
- Upgrade gitlab_git to version 7.2.6 to fix Error 500 when creating network graphs (Stan Hu) - Upgrade gitlab_git to version 7.2.6 to fix Error 500 when creating network graphs (Stan Hu)
- Fix URL used for refreshing notes if relative_url is present (Bartłomiej Święcki) - Fix URL used for refreshing notes if relative_url is present (Bartłomiej Święcki)
- Fix commit data retrieval when branch name has single quotes (Stan Hu) - Fix commit data retrieval when branch name has single quotes (Stan Hu)
- Check that project was actually created rather than just validated in import:repos task (Stan Hu)
- Fix full screen mode for snippet comments (Daniel Gerhardt) - Fix full screen mode for snippet comments (Daniel Gerhardt)
- Fix 404 error in files view after deleting the last file in a repository (Stan Hu) - Fix 404 error in files view after deleting the last file in a repository (Stan Hu)
- Fix the "Reload with full diff" URL button (Stan Hu) - Fix the "Reload with full diff" URL button (Stan Hu)
......
...@@ -705,14 +705,14 @@ class Project < ActiveRecord::Base ...@@ -705,14 +705,14 @@ class Project < ActiveRecord::Base
ensure_satellite_exists ensure_satellite_exists
true true
else else
errors.add(:base, 'Failed to fork repository') errors.add(:base, 'Failed to fork repository via gitlab-shell')
false false
end end
else else
if gitlab_shell.add_repository(path_with_namespace) if gitlab_shell.add_repository(path_with_namespace)
true true
else else
errors.add(:base, 'Failed to create repository') errors.add(:base, 'Failed to create repository via gitlab-shell')
false false
end end
end end
......
...@@ -62,11 +62,11 @@ namespace :gitlab do ...@@ -62,11 +62,11 @@ namespace :gitlab do
project = Projects::CreateService.new(user, project_params).execute project = Projects::CreateService.new(user, project_params).execute
if project.valid? if project.persisted?
puts " * Created #{project.name} (#{repo_path})".green puts " * Created #{project.name} (#{repo_path})".green
else else
puts " * Failed trying to create #{project.name} (#{repo_path})".red puts " * Failed trying to create #{project.name} (#{repo_path})".red
puts " Validation Errors: #{project.errors.messages}".red puts " Errors: #{project.errors.messages}".red
end end
end end
end end
......
...@@ -29,7 +29,7 @@ describe Projects::ForkService do ...@@ -29,7 +29,7 @@ describe Projects::ForkService do
it "fails due to transaction failure" do it "fails due to transaction failure" do
@to_project = fork_project(@from_project, @to_user, false) @to_project = fork_project(@from_project, @to_user, false)
expect(@to_project.errors).not_to be_empty expect(@to_project.errors).not_to be_empty
expect(@to_project.errors[:base]).to include("Failed to fork repository") expect(@to_project.errors[:base]).to include("Failed to fork repository via gitlab-shell")
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment