From 3802006436d6834ee0a8052b22773cb65c4447b5 Mon Sep 17 00:00:00 2001 From: Toon Claes Date: Sun, 11 Mar 2018 22:38:29 +0100 Subject: Respect the protocol in `expose_url` When https is configured in the URL, also use that, and do not set it to http. Closes gitlab-org/gitlab-ee#5217 --- lib/api/helpers/related_resources_helpers.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/api') diff --git a/lib/api/helpers/related_resources_helpers.rb b/lib/api/helpers/related_resources_helpers.rb index 1f677529b07..7f4d6e58b34 100644 --- a/lib/api/helpers/related_resources_helpers.rb +++ b/lib/api/helpers/related_resources_helpers.rb @@ -15,7 +15,7 @@ module API url_options = Gitlab::Application.routes.default_url_options protocol, host, port = url_options.slice(:protocol, :host, :port).values - URI::HTTP.build(scheme: protocol, host: host, port: port, path: path).to_s + URI::Generic.build(scheme: protocol, host: host, port: port, path: path).to_s end private -- cgit v1.2.1 From 5248e37f27fe7afaec40b61041e9fa9fe70b2952 Mon Sep 17 00:00:00 2001 From: Tiago Botelho Date: Wed, 14 Mar 2018 14:17:35 +0000 Subject: Adds the option to override project description on export via API and fixes the project description not being imported --- lib/api/project_export.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/api') diff --git a/lib/api/project_export.rb b/lib/api/project_export.rb index 6ec2626df1a..b0a7fd6f4ab 100644 --- a/lib/api/project_export.rb +++ b/lib/api/project_export.rb @@ -31,8 +31,13 @@ module API desc 'Start export' do detail 'This feature was introduced in GitLab 10.6.' end + params do + optional :description, type: String, desc: 'Override the project description' + end post ':id/export' do - user_project.add_export_job(current_user: current_user) + project_export_params = declared_params(include_missing: false) + + user_project.add_export_job(current_user: current_user, params: project_export_params) accepted! end -- cgit v1.2.1 From 2370ff85fe6fec3ca94d073c7460edf2c6123b59 Mon Sep 17 00:00:00 2001 From: Jan Provaznik Date: Wed, 14 Mar 2018 16:49:21 +0100 Subject: Optional '/-/' delimiter for search API '/-/' delimiter is used only in UI, in API we don't use it for other endpoints. To align search endpoints with the rest of API endpoints, this patch makes '/-/' optional for existing endpoints (to keep backward compatibility). Documentation is updated to prefer paths without '/-/'. --- lib/api/search.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/api') diff --git a/lib/api/search.rb b/lib/api/search.rb index 3556ad98c52..5d9ec617cb7 100644 --- a/lib/api/search.rb +++ b/lib/api/search.rb @@ -84,7 +84,7 @@ module API values: %w(projects issues merge_requests milestones) use :pagination end - get ':id/-/search' do + get ':id/(-/)search' do present search(group_id: user_group.id), with: entity end end @@ -103,7 +103,7 @@ module API values: %w(issues merge_requests milestones notes wiki_blobs commits blobs) use :pagination end - get ':id/-/search' do + get ':id/(-/)search' do present search(project_id: user_project.id), with: entity end end -- cgit v1.2.1 From 2ee197086a87d22c9203c9a3642f9db6d40f54c4 Mon Sep 17 00:00:00 2001 From: Felipe Artur Date: Fri, 16 Mar 2018 16:09:35 -0300 Subject: Improve JIRA event descriptions --- lib/api/services.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/api') diff --git a/lib/api/services.rb b/lib/api/services.rb index 6c97659166d..794fdab8f2b 100644 --- a/lib/api/services.rb +++ b/lib/api/services.rb @@ -735,7 +735,7 @@ module API required: false, name: event_name.to_sym, type: String, - desc: ServicesHelper.service_event_description(event_name) + desc: service.event_description(event_name) } end end -- cgit v1.2.1 From cf1a1e9ac102bd14e49ca8d54494f52765cbf6a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Rodr=C3=ADguez?= Date: Wed, 21 Mar 2018 10:57:06 -0300 Subject: Send Gitaly payload for git-upload-archive SSH commands --- lib/api/helpers/internal_helpers.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/api') diff --git a/lib/api/helpers/internal_helpers.rb b/lib/api/helpers/internal_helpers.rb index 4b564cfdef2..14648588dfd 100644 --- a/lib/api/helpers/internal_helpers.rb +++ b/lib/api/helpers/internal_helpers.rb @@ -109,7 +109,7 @@ module API # Return the Gitaly Address if it is enabled def gitaly_payload(action) - return unless %w[git-receive-pack git-upload-pack].include?(action) + return unless %w[git-receive-pack git-upload-pack git-upload-archive].include?(action) { repository: repository.gitaly_repository, -- cgit v1.2.1