From d45112258e066da307975c17c5ca19ea9a17222b Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Thu, 11 Jun 2015 22:39:50 -0700 Subject: Fix post-receive errors on a push when an external issue tracker is configured Closes #1700 Closes #1720 --- CHANGELOG | 1 + app/services/git_push_service.rb | 26 ++++++++++++++++---------- app/services/issues/close_service.rb | 2 +- spec/services/git_push_service_spec.rb | 9 +++++++++ spec/services/issues/close_service_spec.rb | 10 ++++++++++ 5 files changed, 37 insertions(+), 11 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 9d558b15ab9..94e3248c88e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ Please view this file on the master branch, on stable branches it's out of date. 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/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/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 -- cgit v1.2.1 From 0a03b9b717f76e6f54a39aa7f08fc9c91c3000a9 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 12 Jun 2015 18:15:08 +0200 Subject: Remove visibility icon from projects list on dashboard and group page Signed-off-by: Dmitriy Zaporozhets --- CHANGELOG | 3 +++ app/assets/stylesheets/pages/dashboard.scss | 4 ---- app/views/shared/_project.html.haml | 2 -- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 9d558b15ab9..baa2880d369 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,8 @@ 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) - Update oauth button logos for Twitter and Google to recommended assets - Update browser gem to version 0.8.0 for IE11 support (Stan Hu) 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/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 -- cgit v1.2.1 From b377ca083007829134478af4fd91f54acbbcba49 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Sun, 14 Jun 2015 15:51:48 -0700 Subject: Update Irker home page [ci skip] Closes #1713 --- doc/project_services/irker.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.2.1