Commit fc6fa9cb authored by Balasankar "Balu" C's avatar Balasankar "Balu" C

Include pipeline source in Pipelines API response

Signed-off-by: default avatarBalasankar "Balu" C <balasankar@gitlab.com>
parent 7907e757
...@@ -4,7 +4,7 @@ module API ...@@ -4,7 +4,7 @@ module API
module Entities module Entities
module Ci module Ci
class PipelineBasic < Grape::Entity class PipelineBasic < Grape::Entity
expose :id, :project_id, :sha, :ref, :status expose :id, :project_id, :sha, :ref, :status, :source
expose :created_at, :updated_at expose :created_at, :updated_at
expose :web_url do |pipeline, _options| expose :web_url do |pipeline, _options|
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
"sha": { "type": "string" }, "sha": { "type": "string" },
"ref": { "type": "string" }, "ref": { "type": "string" },
"status": { "type": "string" }, "status": { "type": "string" },
"source": { "type": "string" },
"web_url": { "type": ["string", "null"] }, "web_url": { "type": ["string", "null"] },
"created_at": { "type": ["string", "null"], "format": "date-time" }, "created_at": { "type": ["string", "null"], "format": "date-time" },
"updated_at": { "type": ["string", "null"], "format": "date-time" } "updated_at": { "type": ["string", "null"], "format": "date-time" }
......
...@@ -34,7 +34,7 @@ RSpec.describe API::Ci::Pipelines do ...@@ -34,7 +34,7 @@ RSpec.describe API::Ci::Pipelines do
expect(json_response.first['sha']).to match(/\A\h{40}\z/) expect(json_response.first['sha']).to match(/\A\h{40}\z/)
expect(json_response.first['id']).to eq pipeline.id expect(json_response.first['id']).to eq pipeline.id
expect(json_response.first['web_url']).to be_present expect(json_response.first['web_url']).to be_present
expect(json_response.first.keys).to contain_exactly(*%w[id project_id sha ref status web_url created_at updated_at]) expect(json_response.first.keys).to contain_exactly(*%w[id project_id sha ref status web_url created_at updated_at source])
end end
context 'when parameter is passed' do context 'when parameter is passed' do
......
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