Commit eb181321 authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab-ce master

parents 7e457341 de385eee
...@@ -81,6 +81,27 @@ Parameters: ...@@ -81,6 +81,27 @@ Parameters:
- `code` (required) - The content of a snippet - `code` (required) - The content of a snippet
- `visibility` (required) - The snippet's visibility - `visibility` (required) - The snippet's visibility
Example request:
```bash
curl --request POST https://gitlab.com/api/v4/projects/:id/snippets \
--header "PRIVATE-TOKEN: <your access token>" \
--header "Content-Type: application/json" \
-d @snippet.json
```
`snippet.json` used in the above example request:
```json
{
"title" : "Example Snippet Title",
"description" : "More verbose snippet description",
"file_name" : "example.txt",
"code" : "source code \n with multiple lines\n",
"visibility" : "private"
}
```
## Update snippet ## Update snippet
Updates an existing project snippet. The user must have permission to change an existing snippet. Updates an existing project snippet. The user must have permission to change an existing snippet.
...@@ -99,6 +120,27 @@ Parameters: ...@@ -99,6 +120,27 @@ Parameters:
- `code` (optional) - The content of a snippet - `code` (optional) - The content of a snippet
- `visibility` (optional) - The snippet's visibility - `visibility` (optional) - The snippet's visibility
Example request:
```bash
curl --request PUT https://gitlab.com/api/v4/projects/:id/snippets \
--header "PRIVATE-TOKEN: <your_access_token>" \
--header "Content-Type: application/json" \
-d @snippet.json
```
`snippet.json` used in the above example request:
```json
{
"title" : "Updated Snippet Title",
"description" : "More verbose snippet description",
"file_name" : "new_filename.txt",
"code" : "updated source code \n with multiple lines\n",
"visibility" : "private"
}
```
## Delete snippet ## Delete snippet
Deletes an existing project snippet. This returns a `204 No Content` status code if the operation was successfully or `404` if the resource was not found. Deletes an existing project snippet. This returns a `204 No Content` status code if the operation was successfully or `404` if the resource was not found.
...@@ -112,6 +154,13 @@ Parameters: ...@@ -112,6 +154,13 @@ Parameters:
- `id` (required) - The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user - `id` (required) - The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user
- `snippet_id` (required) - The ID of a project's snippet - `snippet_id` (required) - The ID of a project's snippet
Example request:
```bash
curl --request DELETE https://gitlab.com/api/v4/projects/:id/snippets \
--header "PRIVATE-TOKEN: <your_access_token>"
```
## Snippet content ## Snippet content
Returns the raw project snippet as plain text. Returns the raw project snippet as plain text.
...@@ -125,6 +174,13 @@ Parameters: ...@@ -125,6 +174,13 @@ Parameters:
- `id` (required) - The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user - `id` (required) - The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user
- `snippet_id` (required) - The ID of a project's snippet - `snippet_id` (required) - The ID of a project's snippet
Example request:
```bash
curl --request GET https://gitlab.com/api/v4/projects/:id/snippets/:snippet_id/raw \
--header "PRIVATE-TOKEN: <your_access_token>"
```
## Get user agent details ## Get user agent details
> [Introduced][ce-29508] in GitLab 9.4. > [Introduced][ce-29508] in GitLab 9.4.
...@@ -140,6 +196,8 @@ GET /projects/:id/snippets/:snippet_id/user_agent_detail ...@@ -140,6 +196,8 @@ GET /projects/:id/snippets/:snippet_id/user_agent_detail
| `id` | Integer | yes | The ID of a project | | `id` | Integer | yes | The ID of a project |
| `snippet_id` | Integer | yes | The ID of a snippet | | `snippet_id` | Integer | yes | The ID of a snippet |
Example request:
```bash ```bash
curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/snippets/2/user_agent_detail curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/snippets/2/user_agent_detail
``` ```
......
...@@ -207,6 +207,7 @@ module QA ...@@ -207,6 +207,7 @@ module QA
autoload :Main, 'qa/page/project/settings/main' autoload :Main, 'qa/page/project/settings/main'
autoload :Repository, 'qa/page/project/settings/repository' autoload :Repository, 'qa/page/project/settings/repository'
autoload :CICD, 'qa/page/project/settings/ci_cd' autoload :CICD, 'qa/page/project/settings/ci_cd'
autoload :AutoDevops, 'qa/page/project/settings/auto_devops'
autoload :DeployKeys, 'qa/page/project/settings/deploy_keys' autoload :DeployKeys, 'qa/page/project/settings/deploy_keys'
autoload :DeployTokens, 'qa/page/project/settings/deploy_tokens' autoload :DeployTokens, 'qa/page/project/settings/deploy_tokens'
autoload :ProtectedBranches, 'qa/page/project/settings/protected_branches' autoload :ProtectedBranches, 'qa/page/project/settings/protected_branches'
......
# frozen_string_literal: true
module QA
module Page
module Project
module Settings
class AutoDevops < Page::Base
view 'app/views/projects/settings/ci_cd/_autodevops_form.html.haml' do
element :enable_autodevops_checkbox
element :save_changes_button
end
def enable_autodevops
check_element :enable_autodevops_checkbox
click_element :save_changes_button
end
end
end
end
end
end
...@@ -13,11 +13,6 @@ module QA ...@@ -13,11 +13,6 @@ module QA
element :variables_settings_content element :variables_settings_content
end end
view 'app/views/projects/settings/ci_cd/_autodevops_form.html.haml' do
element :enable_autodevops_checkbox
element :save_changes_button
end
def expand_runners_settings(&block) def expand_runners_settings(&block)
expand_section(:runners_settings_content) do expand_section(:runners_settings_content) do
Settings::Runners.perform(&block) Settings::Runners.perform(&block)
...@@ -30,10 +25,9 @@ module QA ...@@ -30,10 +25,9 @@ module QA
end end
end end
def enable_auto_devops def expand_auto_devops(&block)
expand_section(:autodevops_settings_content) do expand_section(:autodevops_settings_content) do
check_element :enable_autodevops_checkbox Settings::AutoDevops.perform(&block)
click_element :save_changes_button
end end
end end
end end
......
...@@ -147,23 +147,31 @@ module QA ...@@ -147,23 +147,31 @@ module QA
end end
describe 'Auto DevOps', :smoke do describe 'Auto DevOps', :smoke do
it 'enables AutoDevOps by default' do before do
login login
project = Resource::Project.fabricate! do |p| @project = Resource::Project.fabricate_via_browser_ui! do |p|
p.name = Runtime::Env.auto_devops_project_name || 'project-with-autodevops' p.name = "project-with-autodevops-#{SecureRandom.hex(8)}"
p.description = 'Project with AutoDevOps' p.description = 'Project with AutoDevOps'
end end
Page::Project::Menu.perform(&:go_to_ci_cd_settings)
Page::Project::Settings::CICD.perform(&:expand_auto_devops)
Page::Project::Settings::AutoDevops.perform(&:enable_autodevops)
@project.visit!
# Create AutoDevOps repo # Create AutoDevOps repo
Resource::Repository::ProjectPush.fabricate! do |push| Resource::Repository::ProjectPush.fabricate! do |push|
push.project = project push.project = @project
push.directory = Pathname push.directory = Pathname
.new(__dir__) .new(__dir__)
.join('../../../../../fixtures/auto_devops_rack') .join('../../../../../fixtures/auto_devops_rack')
push.commit_message = 'Create AutoDevOps compatible Project' push.commit_message = 'Create AutoDevOps compatible Project'
end end
end
it 'runs an AutoDevOps pipeline' do
Page::Project::Menu.perform(&:click_ci_cd_pipelines) Page::Project::Menu.perform(&:click_ci_cd_pipelines)
Page::Project::Pipeline::Index.perform(&:click_on_latest_pipeline) Page::Project::Pipeline::Index.perform(&:click_on_latest_pipeline)
......
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