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:
authorDouwe Maan <douwe@gitlab.com>2016-02-19 11:00:58 +0300
committerRémy Coutable <remy@rymai.me>2016-02-19 18:29:41 +0300
commitf30004819a7c15ad53a863c9648b7d687c5af405 (patch)
tree67bedae81ab301c077352beceefc9c88a403896b
parent554d9bf606176f7e7515ad8976dff9ef77acd4ca (diff)
Merge branch 'fix/project-forks-page' into 'master'
workaround for forks with an invalid repo Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/13465 The error occurs when a project returns a `nil` commit for a variety of reasons, I assume the repository is corrupt - perhaps as a result of a failed fork. With this MR, we do not show forks with corrupted repos in the list of forks, as this does not seem to work anyway. A better solution is to fix the cause of the issue and/or any data integrity problem... Also fixing Sentry issue: 1180 `undefined method 'already_forked?' for nil:NilClass ` See merge request !2836
-rw-r--r--app/views/shared/projects/_project.html.haml2
-rw-r--r--features/project/fork.feature7
-rw-r--r--features/steps/project/fork.rb6
3 files changed, 14 insertions, 1 deletions
diff --git a/app/views/shared/projects/_project.html.haml b/app/views/shared/projects/_project.html.haml
index 00bf9dcd2d5..97db5b1d41e 100644
--- a/app/views/shared/projects/_project.html.haml
+++ b/app/views/shared/projects/_project.html.haml
@@ -4,7 +4,7 @@
- ci = false unless local_assigns[:ci] == true
- skip_namespace = false unless local_assigns[:skip_namespace] == true
- css_class = '' unless local_assigns[:css_class]
-- show_last_commit_as_description = false unless local_assigns[:show_last_commit_as_description] == true
+- show_last_commit_as_description = false unless local_assigns[:show_last_commit_as_description] == true && project.commit
- css_class += " no-description" if project.description.blank? && !show_last_commit_as_description
- ci_commit = project.ci_commit(project.commit.sha) if ci && !project.empty_repo? && project.commit
- cache_key = [project.namespace, project, controller.controller_name, controller.action_name, current_application_settings, 'v2.2']
diff --git a/features/project/fork.feature b/features/project/fork.feature
index 12695204e47..ca3f2771aa5 100644
--- a/features/project/fork.feature
+++ b/features/project/fork.feature
@@ -32,6 +32,13 @@ Feature: Project Fork
And I visit the forks page of the "Shop" project
Then I should see my fork on the list
+ Scenario: Viewing forks of a Project that has no repo
+ Given I click link "Fork"
+ When I fork to my namespace
+ And I make forked repo invalid
+ And I visit the forks page of the "Shop" project
+ Then I should see my fork on the list
+
Scenario: Viewing private forks of a Project
Given There is an existent fork of the "Shop" project
And I click link "Fork"
diff --git a/features/steps/project/fork.rb b/features/steps/project/fork.rb
index 5810276ced3..527f7853da9 100644
--- a/features/steps/project/fork.rb
+++ b/features/steps/project/fork.rb
@@ -62,6 +62,12 @@ class Spinach::Features::ProjectFork < Spinach::FeatureSteps
end
end
+ step 'I make forked repo invalid' do
+ project = @user.fork_of(@project)
+ project.path = 'test-crappy-path'
+ project.save!
+ end
+
step 'There is an existent fork of the "Shop" project' do
user = create(:user, name: 'Mike')
@forked_project = Projects::ForkService.new(@project, user).execute