Commit 6ec7689c authored by Jose Vargas's avatar Jose Vargas

Expose iid in the pipelines entity

Changelog: changed
parent de0c2a54
...@@ -7,6 +7,7 @@ class Ci::PipelineEntity < Grape::Entity ...@@ -7,6 +7,7 @@ class Ci::PipelineEntity < Grape::Entity
delegate :name, :failure_reason, to: :presented_pipeline delegate :name, :failure_reason, to: :presented_pipeline
expose :id expose :id
expose :iid
expose :user, using: UserEntity expose :user, using: UserEntity
expose :active?, as: :active expose :active?, as: :active
......
...@@ -52,6 +52,7 @@ Example of response ...@@ -52,6 +52,7 @@ Example of response
[ [
{ {
"id": 47, "id": 47,
"iid": 12,
"project_id": 1, "project_id": 1,
"status": "pending", "status": "pending",
"ref": "new-pipeline", "ref": "new-pipeline",
...@@ -62,6 +63,7 @@ Example of response ...@@ -62,6 +63,7 @@ Example of response
}, },
{ {
"id": 48, "id": 48,
"iid": 13,
"project_id": 1, "project_id": 1,
"status": "pending", "status": "pending",
"ref": "new-pipeline", "ref": "new-pipeline",
...@@ -93,6 +95,7 @@ Example of response ...@@ -93,6 +95,7 @@ Example of response
```json ```json
{ {
"id": 46, "id": 46,
"iid": 11,
"project_id": 1, "project_id": 1,
"status": "success", "status": "success",
"ref": "main", "ref": "main",
...@@ -281,6 +284,7 @@ Example of response ...@@ -281,6 +284,7 @@ Example of response
```json ```json
{ {
"id": 61, "id": 61,
"iid": 21,
"project_id": 1, "project_id": 1,
"sha": "384c444e840a515b23f21915ee5766b87068a70d", "sha": "384c444e840a515b23f21915ee5766b87068a70d",
"ref": "main", "ref": "main",
...@@ -328,6 +332,7 @@ Response: ...@@ -328,6 +332,7 @@ Response:
```json ```json
{ {
"id": 46, "id": 46,
"iid": 11,
"project_id": 1, "project_id": 1,
"status": "pending", "status": "pending",
"ref": "main", "ref": "main",
...@@ -375,6 +380,7 @@ Response: ...@@ -375,6 +380,7 @@ Response:
```json ```json
{ {
"id": 46, "id": 46,
"iid": 11,
"project_id": 1, "project_id": 1,
"status": "canceled", "status": "canceled",
"ref": "main", "ref": "main",
......
...@@ -18,7 +18,7 @@ RSpec.describe Ci::PipelineEntity do ...@@ -18,7 +18,7 @@ RSpec.describe Ci::PipelineEntity do
let(:pipeline) { create(:ci_empty_pipeline) } let(:pipeline) { create(:ci_empty_pipeline) }
it 'contains required fields' do it 'contains required fields' do
expect(subject).to include :id, :user, :path, :coverage, :source expect(subject).to include :id, :iid, :user, :path, :coverage, :source
expect(subject).to include :ref, :commit expect(subject).to include :ref, :commit
expect(subject).to include :updated_at, :created_at expect(subject).to include :updated_at, :created_at
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