Commit 90256134 authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab-ce master

parents 9654f295 327de633
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
module ImportUrlParams module ImportUrlParams
def import_url_params def import_url_params
return {} unless params.dig(:project, :import_url).present?
{ import_url: import_params_to_full_url(params[:project]) } { import_url: import_params_to_full_url(params[:project]) }
end end
......
---
title: Fix project settings not being able to update
merge_request: 29097
author:
type: fixed
...@@ -165,15 +165,15 @@ Parameters: ...@@ -165,15 +165,15 @@ Parameters:
|:--------------|:-------|:---------|:---------------------------------------------------| |:--------------|:-------|:---------|:---------------------------------------------------|
| `title` | string | yes | Title of a snippet. | | `title` | string | yes | Title of a snippet. |
| `file_name` | string | yes | Name of a snippet file. | | `file_name` | string | yes | Name of a snippet file. |
| `content` | string | yes | Content of a snippet. | | `code` | string | yes | Content of a snippet. |
| `description` | string | no | Description of a snippet. | | `description` | string | no | Description of a snippet. |
| `visibility` | string | no | Snippet's [visibility](#snippet-visibility-level). | | `visibility` | string | yes | Snippet's [visibility](#snippet-visibility-level). |
Example request: Example request:
```sh ```sh
curl --request POST \ curl --request POST \
--data '{"title": "This is a snippet", "content": "Hello world", "description": "Hello World snippet", "file_name": "test.txt", "visibility": "internal" }' \ --data '{"title": "This is a snippet", "code": "Hello world", "description": "Hello World snippet", "file_name": "test.txt", "visibility": "internal" }' \
--header 'Content-Type: application/json' \ --header 'Content-Type: application/json' \
--header "PRIVATE-TOKEN: valid_api_token" \ --header "PRIVATE-TOKEN: valid_api_token" \
https://gitlab.example.com/api/v4/snippets https://gitlab.example.com/api/v4/snippets
...@@ -222,14 +222,14 @@ Parameters: ...@@ -222,14 +222,14 @@ Parameters:
| `title` | string | no | Title of a snippet. | | `title` | string | no | Title of a snippet. |
| `file_name` | string | no | Name of a snippet file. | | `file_name` | string | no | Name of a snippet file. |
| `description` | string | no | Description of a snippet. | | `description` | string | no | Description of a snippet. |
| `content` | string | no | Content of a snippet. | | `code` | string | no | Content of a snippet. |
| `visibility` | string | no | Snippet's [visibility](#snippet-visibility-level). | | `visibility` | string | no | Snippet's [visibility](#snippet-visibility-level). |
Example request: Example request:
```sh ```sh
curl --request PUT \ curl --request PUT \
--data '{"title": "foo", "content": "bar"}' \ --data '{"title": "foo", "code": "bar"}' \
--header 'Content-Type: application/json' \ --header 'Content-Type: application/json' \
--header "PRIVATE-TOKEN: valid_api_token" \ --header "PRIVATE-TOKEN: valid_api_token" \
https://gitlab.example.com/api/v4/snippets/1 https://gitlab.example.com/api/v4/snippets/1
......
...@@ -917,9 +917,9 @@ backup beforehand. ...@@ -917,9 +917,9 @@ backup beforehand.
1. Clear all the tokens for projects, groups, and the whole instance: 1. Clear all the tokens for projects, groups, and the whole instance:
CAUTION: **Caution:** CAUTION: **Caution:**
The last UPDATE operation will stop the runners being able to pick up The last UPDATE operation will stop the runners being able to pick up
new jobs. You must register new runners. new jobs. You must register new runners.
```sql ```sql
-- Clear project tokens -- Clear project tokens
......
...@@ -8,6 +8,18 @@ describe ImportUrlParams do ...@@ -8,6 +8,18 @@ describe ImportUrlParams do
controller.import_url_params controller.import_url_params
end end
context 'empty URL' do
let(:params) do
ActionController::Parameters.new(project: {
title: 'Test'
})
end
it 'returns empty hash' do
expect(import_url_params).to eq({})
end
end
context 'url and password separately provided' do context 'url and password separately provided' do
let(:params) do let(:params) do
ActionController::Parameters.new(project: { ActionController::Parameters.new(project: {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment