summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2018-07-23 10:19:16 +0000
committerRémy Coutable <remy@rymai.me>2018-07-23 10:19:16 +0000
commit1917aa984dfa7e5a8073697c3250d313047526d4 (patch)
tree48981e45a81eb690a77fa37ee9915fa8518d8417
parentcc540bb2a2177825ed52adbaff468566826279ad (diff)
parentd32802c76b37df936af5086e37bd93761c29799b (diff)
downloadgitlab-ce-1917aa984dfa7e5a8073697c3250d313047526d4.tar.gz
Merge branch '49272-sanitize-git-url-in-import-errors' into 'master'
Resolve "Credentails used for repository import are visible inside the Sidekiq logs (Background Jobs)" See merge request gitlab-org/gitlab-ce!20641
-rw-r--r--app/services/projects/import_service.rb2
-rw-r--r--changelogs/unreleased/49272-sanitize-git-url-in-import-errors.yml5
-rw-r--r--spec/services/projects/import_service_spec.rb4
3 files changed, 8 insertions, 3 deletions
diff --git a/app/services/projects/import_service.rb b/app/services/projects/import_service.rb
index e560d40371e..0c426faa22d 100644
--- a/app/services/projects/import_service.rb
+++ b/app/services/projects/import_service.rb
@@ -25,7 +25,7 @@ module Projects
success
rescue => e
- error("Error importing repository #{project.import_url} into #{project.full_path} - #{e.message}")
+ error("Error importing repository #{project.safe_import_url} into #{project.full_path} - #{e.message}")
end
private
diff --git a/changelogs/unreleased/49272-sanitize-git-url-in-import-errors.yml b/changelogs/unreleased/49272-sanitize-git-url-in-import-errors.yml
new file mode 100644
index 00000000000..c757e55f1cd
--- /dev/null
+++ b/changelogs/unreleased/49272-sanitize-git-url-in-import-errors.yml
@@ -0,0 +1,5 @@
+---
+title: Sanitize git URL in import errors
+merge_request:
+author: Jamie Schembri
+type: fixed
diff --git a/spec/services/projects/import_service_spec.rb b/spec/services/projects/import_service_spec.rb
index b3815045792..e2a600d12d1 100644
--- a/spec/services/projects/import_service_spec.rb
+++ b/spec/services/projects/import_service_spec.rb
@@ -69,7 +69,7 @@ describe Projects::ImportService do
result = subject.execute
expect(result[:status]).to eq :error
- expect(result[:message]).to eq "Error importing repository #{project.import_url} into #{project.full_path} - The repository could not be created."
+ expect(result[:message]).to eq "Error importing repository #{project.safe_import_url} into #{project.full_path} - The repository could not be created."
end
context 'when repository creation succeeds' do
@@ -141,7 +141,7 @@ describe Projects::ImportService do
result = subject.execute
expect(result[:status]).to eq :error
- expect(result[:message]).to eq "Error importing repository #{project.import_url} into #{project.full_path} - Failed to import the repository"
+ expect(result[:message]).to eq "Error importing repository #{project.safe_import_url} into #{project.full_path} - Failed to import the repository"
end
context 'when repository import scheduled' do