summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarin Jankovski <maxlazio@gmail.com>2015-06-15 11:34:03 +0200
committerMarin Jankovski <maxlazio@gmail.com>2015-06-15 11:34:03 +0200
commit168d5eabd40f5767d1287fe194e57ed05ef5d990 (patch)
treef4ce39ac4d019a9b355f216b410d8485b310e389
parent6b96eb8e2c1f4693ce7f231c6b8f9869eecef184 (diff)
parent646ce0aab51fa05da32fb1416f5376c115b73a1d (diff)
downloadgitlab-ce-168d5eabd40f5767d1287fe194e57ed05ef5d990.tar.gz
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce
-rw-r--r--CHANGELOG4
-rw-r--r--app/assets/stylesheets/pages/dashboard.scss4
-rw-r--r--app/services/git_push_service.rb26
-rw-r--r--app/services/issues/close_service.rb2
-rw-r--r--app/views/shared/_project.html.haml2
-rw-r--r--doc/project_services/irker.md2
-rw-r--r--spec/services/git_push_service_spec.rb9
-rw-r--r--spec/services/issues/close_service_spec.rb10
8 files changed, 41 insertions, 18 deletions
diff --git a/CHANGELOG b/CHANGELOG
index c5a625ed1df..2d41e455271 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,10 @@
Please view this file on the master branch, on stable branches it's out of date.
+v 7.13.0 (unreleased)
+ - Remove project visibility icons from dashboard projects list
+
v 7.12.0 (unreleased)
+ - Fix post-receive errors on a push when an external issue tracker is configured (Stan Hu)
- Update oauth button logos for Twitter and Google to recommended assets
- Update browser gem to version 0.8.0 for IE11 support (Stan Hu)
- Fix timeout when rendering file with thousands of lines.
diff --git a/app/assets/stylesheets/pages/dashboard.scss b/app/assets/stylesheets/pages/dashboard.scss
index 09e8d57a100..9a3b543ad10 100644
--- a/app/assets/stylesheets/pages/dashboard.scss
+++ b/app/assets/stylesheets/pages/dashboard.scss
@@ -28,10 +28,6 @@
font-size: 14px;
line-height: 24px;
- .str-truncated {
- max-width: 76%;
- }
-
a {
display: block;
padding: 8px 15px;
diff --git a/app/services/git_push_service.rb b/app/services/git_push_service.rb
index cde65349d5c..68d3b915fc9 100644
--- a/app/services/git_push_service.rb
+++ b/app/services/git_push_service.rb
@@ -88,18 +88,24 @@ class GitPushService
end
end
- # Create cross-reference notes for any other references. Omit any issues that were referenced in an
- # issue-closing phrase, or have already been mentioned from this commit (probably from this commit
- # being pushed to a different branch).
- refs = commit.references(project, user) - issues_to_close
- refs.reject! { |r| commit.has_mentioned?(r) }
+ if project.default_issues_tracker?
+ create_cross_reference_notes(commit, issues_to_close)
+ end
+ end
+ end
- if refs.present?
- author ||= commit_user(commit)
+ def create_cross_reference_notes(commit, issues_to_close)
+ # Create cross-reference notes for any other references. Omit any issues that were referenced in an
+ # issue-closing phrase, or have already been mentioned from this commit (probably from this commit
+ # being pushed to a different branch).
+ refs = commit.references(project, user) - issues_to_close
+ refs.reject! { |r| commit.has_mentioned?(r) }
- refs.each do |r|
- Note.create_cross_reference_note(r, commit, author)
- end
+ if refs.present?
+ author ||= commit_user(commit)
+
+ refs.each do |r|
+ Note.create_cross_reference_note(r, commit, author)
end
end
end
diff --git a/app/services/issues/close_service.rb b/app/services/issues/close_service.rb
index 138465859ce..3d85f97b7e5 100644
--- a/app/services/issues/close_service.rb
+++ b/app/services/issues/close_service.rb
@@ -1,7 +1,7 @@
module Issues
class CloseService < Issues::BaseService
def execute(issue, commit = nil)
- if issue.close
+ if project.default_issues_tracker? && issue.close
event_service.close_issue(issue, current_user)
create_note(issue, commit)
notification_service.close_issue(issue, current_user)
diff --git a/app/views/shared/_project.html.haml b/app/views/shared/_project.html.haml
index 4537f8eec86..6bd61455d21 100644
--- a/app/views/shared/_project.html.haml
+++ b/app/views/shared/_project.html.haml
@@ -3,8 +3,6 @@
- if avatar
.dash-project-avatar
= project_icon(project, alt: '', class: 'avatar project-avatar s40')
- .dash-project-access-icon
- = visibility_level_icon(project.visibility_level)
%span.str-truncated
%span.namespace-name
- if project.namespace
diff --git a/doc/project_services/irker.md b/doc/project_services/irker.md
index 780a45bca20..9875bebf66b 100644
--- a/doc/project_services/irker.md
+++ b/doc/project_services/irker.md
@@ -4,7 +4,7 @@ GitLab provides a way to push update messages to an Irker server. When
configured, pushes to a project will trigger the service to send data directly
to the Irker server.
-See the project homepage for further info: http://www.catb.org/esr/irker/
+See the project homepage for further info: https://gitlab.com/esr/irker
## Needed setup
diff --git a/spec/services/git_push_service_spec.rb b/spec/services/git_push_service_spec.rb
index e7558f28768..d0941fa2e07 100644
--- a/spec/services/git_push_service_spec.rb
+++ b/spec/services/git_push_service_spec.rb
@@ -233,6 +233,15 @@ describe GitPushService do
expect(Issue.find(issue.id)).to be_opened
end
+
+ it "doesn't close issues when external issue tracker is in use" do
+ allow(project).to receive(:default_issues_tracker?).and_return(false)
+
+ # The push still shouldn't create cross-reference notes.
+ expect {
+ service.execute(project, user, @oldrev, @newrev, 'refs/heads/hurf')
+ }.not_to change { Note.where(project_id: project.id, system: true).count }
+ end
end
describe "empty project" do
diff --git a/spec/services/issues/close_service_spec.rb b/spec/services/issues/close_service_spec.rb
index 0e5ae724bf7..db547ce0d50 100644
--- a/spec/services/issues/close_service_spec.rb
+++ b/spec/services/issues/close_service_spec.rb
@@ -31,5 +31,15 @@ describe Issues::CloseService do
expect(note.note).to include "Status changed to closed"
end
end
+
+ context "external issue tracker" do
+ before do
+ allow(project).to receive(:default_issues_tracker?).and_return(false)
+ @issue = Issues::CloseService.new(project, user, {}).execute(issue)
+ end
+
+ it { expect(@issue).to be_valid }
+ it { expect(@issue).to be_opened }
+ end
end
end