Skip to content

Commit 2d2fe24

Browse files
vimsucksjmini
andauthored
Add headPipeline to MergeRequest (gitlab4j#890)
Co-authored-by: Jérémie Bresson <dev@jmini.fr>
1 parent c292923 commit 2d2fe24

File tree

3 files changed

+48
-1
lines changed

3 files changed

+48
-1
lines changed

src/main/java/org/gitlab4j/api/models/MergeRequest.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ public class MergeRequest {
5454
private String mergeError;
5555
private Milestone milestone;
5656
private Pipeline pipeline;
57+
private Pipeline headPipeline;
5758
private Long projectId;
5859
private String sha;
5960
private Boolean shouldRemoveSourceBranch;
@@ -374,6 +375,14 @@ public void setPipeline(Pipeline pipeline) {
374375
this.pipeline = pipeline;
375376
}
376377

378+
public Pipeline getHeadPipeline() {
379+
return headPipeline;
380+
}
381+
382+
public void setHeadPipeline(Pipeline headPipeline) {
383+
this.headPipeline = headPipeline;
384+
}
385+
377386
public Long getProjectId() {
378387
return projectId;
379388
}

src/main/java/org/gitlab4j/api/models/Pipeline.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
public class Pipeline {
99

1010
private Long id;
11+
private Long projectId;
1112
private PipelineStatus status;
1213
private String ref;
1314
private String sha;
@@ -34,6 +35,14 @@ public void setId(Long id) {
3435
this.id = id;
3536
}
3637

38+
public Long getProjectId() {
39+
return projectId;
40+
}
41+
42+
public void setProjectId(Long projectId) {
43+
this.projectId = projectId;
44+
}
45+
3746
public PipelineStatus getStatus() {
3847
return status;
3948
}

src/test/resources/org/gitlab4j/api/merge-request.json

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,34 @@
7474
"blocking_discussions_resolved": true,
7575
"diverged_commits_count": 2,
7676
"latest_build_started_at": "2018-09-07T07:27:38.472Z",
77-
"latest_build_finished_at": "2018-09-07T08:07:06.012Z"
77+
"latest_build_finished_at": "2018-09-07T08:07:06.012Z",
78+
"head_pipeline": {
79+
"id": 1,
80+
"project_id": 3,
81+
"sha": "2be7ddb704c7b6b83732fdd5b9f09d5a397b5f8f",
82+
"ref": "test1",
83+
"status": "pending",
84+
"created_at": "2018-09-07T07:27:38.472Z",
85+
"updated_at": "2018-09-07T07:27:38.472Z",
86+
"web_url": "https://www.google.com/",
87+
"before_sha": "0000000000000000000000000000000000000000",
88+
"tag": false,
89+
"user": {
90+
"id":1,
91+
"username": "admin",
92+
"state": "active",
93+
"email":"admin@local.host",
94+
"name":"Administrator"
95+
},
96+
"detailed_status": {
97+
"icon": "status_pending",
98+
"text": "pending",
99+
"label": "pending",
100+
"group": "pending",
101+
"tooltip": "pending",
102+
"has_details": true,
103+
"details_path": "/my-group/my-project/-/pipelines/1",
104+
"favicon": "https://www.google.com/"
105+
}
106+
}
78107
}

0 commit comments

Comments
 (0)