From dfe659c16de6f9ad38e429b89131df20276e21d4 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Tue, 14 Apr 2015 13:10:25 +0200 Subject: [PATCH] Remove author link since all code.google.com links will be shut down. --- lib/gitlab/google_code_import/importer.rb | 14 ++++++-------- .../lib/gitlab/google_code_import/importer_spec.rb | 2 -- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/lib/gitlab/google_code_import/importer.rb b/lib/gitlab/google_code_import/importer.rb index 8bdb46237fc..07eccfa4db8 100644 --- a/lib/gitlab/google_code_import/importer.rb +++ b/lib/gitlab/google_code_import/importer.rb @@ -66,12 +66,11 @@ module Gitlab end last_id = raw_issue["id"] - author = mask_email(raw_issue["author"]["name"]) - author_link = raw_issue["author"]["htmlLink"] - date = DateTime.parse(raw_issue["published"]).to_formatted_s(:long) + author = mask_email(raw_issue["author"]["name"]) + date = DateTime.parse(raw_issue["published"]).to_formatted_s(:long) body = [] - body << "*By [#{author}](#{author_link}) on #{date}*" + body << "*By #{author} on #{date}*" body << "---" comments = raw_issue["comments"]["items"] @@ -120,12 +119,11 @@ module Gitlab comments.each_with_index do |raw_comment, i| next if raw_comment.has_key?("deletedBy") - author = mask_email(raw_comment["author"]["name"]) - author_link = raw_comment["author"]["htmlLink"] - date = DateTime.parse(raw_comment["published"]).to_formatted_s(:long) + author = mask_email(raw_comment["author"]["name"]) + date = DateTime.parse(raw_comment["published"]).to_formatted_s(:long) body = [] - body << "*By [#{author}](#{author_link}) on #{date}*" + body << "*By #{author} on #{date}*" body << "---" content = format_content(raw_comment["content"]) diff --git a/spec/lib/gitlab/google_code_import/importer_spec.rb b/spec/lib/gitlab/google_code_import/importer_spec.rb index 408553a98f2..9ff972b2111 100644 --- a/spec/lib/gitlab/google_code_import/importer_spec.rb +++ b/spec/lib/gitlab/google_code_import/importer_spec.rb @@ -43,7 +43,6 @@ describe Gitlab::GoogleCodeImport::Importer do expect(issue.title).to eq("Scrolling through tasks") expect(issue.state).to eq("closed") expect(issue.description).to include("schattenpr...") - expect(issue.description).to include("https://code.google.com/u/106498139506637530000/") expect(issue.description).to include("November 18, 2009 00:20") expect(issue.description).to include('I like to scroll through the tasks with my scrollwheel \(like in fluxbox\).') expect(issue.description).to include('Patch is attached that adds two new mouse\-actions \(next\_taskprev\_task\)') @@ -59,7 +58,6 @@ describe Gitlab::GoogleCodeImport::Importer do note = project.issues.first.notes.first expect(note).to_not be_nil expect(note.note).to include("thilo...") - expect(note.note).to include("https://code.google.com/u/104224918623172014000/") expect(note.note).to include("November 18, 2009 05:14") expect(note.note).to include("applied, thanks.") expect(note.note).to include("Status: Fixed")