Commit 7d19df2d authored by GitLab Bot's avatar GitLab Bot

Add latest changes from gitlab-org/gitlab@master

parent cebee31a
......@@ -38,7 +38,7 @@
- "doc/README.md" # Some RSpec test rely on this file
# Make sure to update all the similar patterns in other CI config files if you modify these patterns
.code-backstage-patterns-qa: &code-backstage-patterns-qa
.code-backstage-qa-patterns: &code-backstage-qa-patterns
- ".gitlab/ci/**/*"
- ".{eslintignore,gitattributes,nvmrc,prettierrc,stylelintrc,yamllint}"
- ".{codeclimate,eslintrc,gitlab-ci,haml-lint,haml-lint_todo,rubocop,rubocop_todo,scss-lint}.yml"
......@@ -118,7 +118,7 @@ gitlab:assets:compile pull-push-cache:
- <<: *if-not-canonical-namespace
when: never
- <<: *if-master-refs
changes: *code-backstage-patterns-qa
changes: *code-backstage-qa-patterns
when: on_success
cache:
policy: pull-push
......@@ -129,7 +129,7 @@ gitlab:assets:compile pull-cache:
- <<: *if-not-canonical-namespace
when: never
- <<: *if-default-refs
changes: *code-backstage-patterns-qa
changes: *code-backstage-qa-patterns
when: on_success
cache:
policy: pull
......@@ -163,7 +163,7 @@ compile-assets pull-push-cache:
extends: .compile-assets-metadata
rules:
- <<: *if-master-refs
changes: *code-backstage-patterns-qa
changes: *code-backstage-qa-patterns
when: on_success
cache:
policy: pull-push
......@@ -176,7 +176,7 @@ compile-assets pull-push-cache foss:
- <<: *if-not-ee
when: never
- <<: *if-master-refs
changes: *code-backstage-patterns-qa
changes: *code-backstage-qa-patterns
when: on_success
cache:
policy: pull-push
......@@ -186,7 +186,7 @@ compile-assets pull-cache:
extends: .compile-assets-metadata
rules:
- <<: *if-default-refs
changes: *code-backstage-patterns-qa
changes: *code-backstage-qa-patterns
when: on_success
cache:
policy: pull
......@@ -199,26 +199,24 @@ compile-assets pull-cache foss:
- <<: *if-not-ee
when: never
- <<: *if-default-refs
changes: *code-backstage-patterns-qa
changes: *code-backstage-qa-patterns
when: on_success
cache:
policy: pull
key: "assets-compile:v8:foss"
.only-code-frontend-job-base:
.frontend-job-base:
extends:
- .default-tags
- .default-retry
- .default-cache
- .default-only
- .default-before_script
- .only:changes-code-backstage
- .use-pg9
stage: test
needs: ["setup-test-env", "compile-assets pull-cache"]
.karma-base:
extends: .only-code-frontend-job-base
extends: .frontend-job-base
variables:
# we override the max_old_space_size to prevent OOM errors
NODE_OPTIONS: --max_old_space_size=3584
......@@ -231,6 +229,10 @@ compile-assets pull-cache foss:
karma:
extends: .karma-base
rules:
- <<: *if-default-refs
changes: *code-backstage-patterns
when: on_success
coverage: '/^Statements *: (\d+\.\d+%)/'
artifacts:
name: coverage-javascript
......@@ -246,10 +248,16 @@ karma:
karma-foss:
extends:
- .karma-base
- .only-ee-as-if-foss
- .as-if-foss
rules:
- <<: *if-not-ee
when: never
- <<: *if-default-refs
changes: *code-backstage-patterns
when: on_success
.jest-base:
extends: .only-code-frontend-job-base
extends: .frontend-job-base
script:
- scripts/gitaly-test-spawn
- date
......@@ -264,6 +272,10 @@ karma-foss:
jest:
extends: .jest-base
rules:
- <<: *if-default-refs
changes: *code-backstage-patterns
when: on_success
artifacts:
name: coverage-frontend
expire_in: 31d
......@@ -278,7 +290,13 @@ jest:
jest-foss:
extends:
- .jest-base
- .only-ee-as-if-foss
- .as-if-foss
rules:
- <<: *if-not-ee
when: never
- <<: *if-default-refs
changes: *code-backstage-patterns
when: on_success
cache:
policy: pull
......
---
title: Limit productivity analytics graph y-axis scale to whole numbers
merge_request: 23140
author:
type: fixed
---
title: Query projects of subgroups in productivity analytics
merge_request: 24335
author:
type: fixed
---
title: Add API to "Play" a scheduled pipeline immediately
merge_request: 23718
author:
type: added
......@@ -279,6 +279,36 @@ curl --request DELETE --header "PRIVATE-TOKEN: k5ESFgWY2Qf5xEvDcFxZ" "https://gi
}
```
## Run a scheduled pipeline immediately
> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/201786) in GitLab 12.8.
Trigger a new scheduled pipeline, which runs immediately. The next scheduled run
of this pipeline is not affected.
```text
POST /projects/:id/pipeline_schedules/:pipeline_schedule_id/play
```
| Attribute | Type | required | Description |
| ---------------- | --------- | ---------- | -------------------------- |
| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user |
| `pipeline_schedule_id` | integer | yes | The pipeline schedule id |
Example request:
```sh
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" 'https://gitlab.example.com/api/v4/projects/42/pipeline_schedules/1/play
```
Example response:
```json
{
"message": "201 Created"
}
```
## Pipeline schedule variables
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/issues/34518) in GitLab 10.0.
......
......@@ -111,6 +111,25 @@ module API
destroy_conditionally!(pipeline_schedule)
end
desc 'Play a scheduled pipeline immediately' do
detail 'This feature was added in GitLab 12.8'
end
params do
requires :pipeline_schedule_id, type: Integer, desc: 'The pipeline schedule id'
end
post ':id/pipeline_schedules/:pipeline_schedule_id/play' do
authorize! :play_pipeline_schedule, pipeline_schedule
job_id = RunPipelineScheduleWorker
.perform_async(pipeline_schedule.id, current_user.id)
if job_id
created!
else
render_api_error!('Unable to schedule pipeline run immediately', 500)
end
end
desc 'Create a new pipeline schedule variable' do
success Entities::Variable
end
......
export const initialRequest = {
title: '<p>this is a title</p>',
title_text: 'this is a title',
description: '<p>this is a description!</p>',
description_text: 'this is a description',
task_status: '2 of 4 completed',
updated_at: '2015-05-15T12:31:04.428Z',
updated_by_name: 'Some User',
updated_by_path: '/some_user',
lock_version: 1,
};
export const secondRequest = {
title: '<p>2</p>',
title_text: '2',
description: '<p>42</p>',
description_text: '42',
task_status: '0 of 0 completed',
updated_at: '2016-05-15T12:31:04.428Z',
updated_by_name: 'Other User',
updated_by_path: '/other_user',
lock_version: 2,
};
......@@ -7,13 +7,13 @@ import axios from '~/lib/utils/axios_utils';
import '~/behaviors/markdown/render_gfm';
import issuableApp from '~/issue_show/components/app.vue';
import eventHub from '~/issue_show/event_hub';
import issueShowData from '../mock_data';
import { initialRequest, secondRequest } from '../mock_data';
function formatText(text) {
return text.trim().replace(/\s\s+/g, ' ');
}
const REALTIME_REQUEST_STACK = [issueShowData.initialRequest, issueShowData.secondRequest];
const REALTIME_REQUEST_STACK = [initialRequest, secondRequest];
describe('Issuable output', () => {
let mock;
......
export default {
initialRequest: {
title: '<p>this is a title</p>',
title_text: 'this is a title',
description: '<p>this is a description!</p>',
description_text: 'this is a description',
task_status: '2 of 4 completed',
updated_at: '2015-05-15T12:31:04.428Z',
updated_by_name: 'Some User',
updated_by_path: '/some_user',
lock_version: 1,
},
secondRequest: {
title: '<p>2</p>',
title_text: '2',
description: '<p>42</p>',
description_text: '42',
task_status: '0 of 0 completed',
updated_at: '2016-05-15T12:31:04.428Z',
updated_by_name: 'Other User',
updated_by_path: '/other_user',
lock_version: 2,
},
};
export * from '../../frontend/issue_show/mock_data';
......@@ -322,6 +322,56 @@ describe API::PipelineSchedules do
end
end
describe 'POST /projects/:id/pipeline_schedules/:pipeline_schedule_id/play' do
let_it_be(:pipeline_schedule) { create(:ci_pipeline_schedule, project: project) }
let(:route) { ->(id) { "/projects/#{project.id}/pipeline_schedules/#{id}/play" } }
context 'authenticated user with `:play_pipeline_schedule` permission' do
it 'schedules a pipeline worker' do
project.add_developer(developer)
expect(RunPipelineScheduleWorker)
.to receive(:perform_async)
.with(pipeline_schedule.id, developer.id)
.and_call_original
post api(route[pipeline_schedule.id], developer)
expect(response).to have_gitlab_http_status(:created)
end
it 'renders an error if scheduling failed' do
project.add_developer(developer)
expect(RunPipelineScheduleWorker)
.to receive(:perform_async)
.with(pipeline_schedule.id, developer.id)
.and_return(nil)
post api(route[pipeline_schedule.id], developer)
expect(response).to have_gitlab_http_status(:internal_server_error)
end
end
context 'authenticated user with insufficient access' do
it 'responds with not found' do
project.add_guest(user)
post api(route[pipeline_schedule.id], user)
expect(response).to have_gitlab_http_status(:not_found)
end
end
context 'unauthenticated user' do
it 'responds with unauthorized' do
post api(route[pipeline_schedule.id])
expect(response).to have_gitlab_http_status(:unauthorized)
end
end
end
describe 'POST /projects/:id/pipeline_schedules/:pipeline_schedule_id/variables' do
let(:params) { attributes_for(:ci_pipeline_schedule_variable) }
......
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