Commit b943c07d authored by Sean McGivern's avatar Sean McGivern

Merge branch 'gsemet-master-patch-37783' into 'master'

Add allow failure in pipeline event

Closes #37783

See merge request gitlab-org/gitlab!20978
parents 70a21479 1fdafbb2
---
title: |
Add allow failure in pipeline webhook event
merge_request: 20978
author: Gaetan Semet
type: added
...@@ -1076,6 +1076,7 @@ X-Gitlab-Event: Pipeline Hook ...@@ -1076,6 +1076,7 @@ X-Gitlab-Event: Pipeline Hook
"finished_at": null, "finished_at": null,
"when": "manual", "when": "manual",
"manual": true, "manual": true,
"allow_failure": false,
"user":{ "user":{
"name": "Administrator", "name": "Administrator",
"username": "root", "username": "root",
...@@ -1097,6 +1098,7 @@ X-Gitlab-Event: Pipeline Hook ...@@ -1097,6 +1098,7 @@ X-Gitlab-Event: Pipeline Hook
"finished_at": null, "finished_at": null,
"when": "on_success", "when": "on_success",
"manual": false, "manual": false,
"allow_failure": false,
"user":{ "user":{
"name": "Administrator", "name": "Administrator",
"username": "root", "username": "root",
...@@ -1123,6 +1125,7 @@ X-Gitlab-Event: Pipeline Hook ...@@ -1123,6 +1125,7 @@ X-Gitlab-Event: Pipeline Hook
"finished_at": "2016-08-12 15:26:29 UTC", "finished_at": "2016-08-12 15:26:29 UTC",
"when": "on_success", "when": "on_success",
"manual": false, "manual": false,
"allow_failure": false,
"user":{ "user":{
"name": "Administrator", "name": "Administrator",
"username": "root", "username": "root",
...@@ -1149,6 +1152,7 @@ X-Gitlab-Event: Pipeline Hook ...@@ -1149,6 +1152,7 @@ X-Gitlab-Event: Pipeline Hook
"finished_at": "2016-08-12 15:25:26 UTC", "finished_at": "2016-08-12 15:25:26 UTC",
"when": "on_success", "when": "on_success",
"manual": false, "manual": false,
"allow_failure": false,
"user":{ "user":{
"name": "Administrator", "name": "Administrator",
"username": "root", "username": "root",
...@@ -1175,6 +1179,7 @@ X-Gitlab-Event: Pipeline Hook ...@@ -1175,6 +1179,7 @@ X-Gitlab-Event: Pipeline Hook
"finished_at": null, "finished_at": null,
"when": "on_success", "when": "on_success",
"manual": false, "manual": false,
"allow_failure": false,
"user":{ "user":{
"name": "Administrator", "name": "Administrator",
"username": "root", "username": "root",
......
...@@ -61,6 +61,7 @@ module Gitlab ...@@ -61,6 +61,7 @@ module Gitlab
finished_at: build.finished_at, finished_at: build.finished_at,
when: build.when, when: build.when,
manual: build.action?, manual: build.action?,
allow_failure: build.allow_failure,
user: build.user.try(:hook_attrs), user: build.user.try(:hook_attrs),
runner: build.runner && runner_hook_attrs(build.runner), runner: build.runner && runner_hook_attrs(build.runner),
artifacts_file: { artifacts_file: {
......
...@@ -34,6 +34,7 @@ describe Gitlab::DataBuilder::Pipeline do ...@@ -34,6 +34,7 @@ describe Gitlab::DataBuilder::Pipeline do
expect(build_data).to be_a(Hash) expect(build_data).to be_a(Hash)
expect(build_data[:id]).to eq(build.id) expect(build_data[:id]).to eq(build.id)
expect(build_data[:status]).to eq(build.status) expect(build_data[:status]).to eq(build.status)
expect(build_data[:allow_failure]).to eq(build.allow_failure)
expect(project_data).to eq(project.hook_attrs(backward: false)) expect(project_data).to eq(project.hook_attrs(backward: false))
expect(data[:merge_request]).to be_nil expect(data[:merge_request]).to be_nil
end end
......
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