Skip to content

Commit 384dcfa

Browse files
authored
Add missing fields on commit and pipeline (#959)
1 parent 2f85b81 commit 384dcfa

File tree

4 files changed

+49
-5
lines changed

4 files changed

+49
-5
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public class Commit {
2626
private String title;
2727
private String url;
2828
private String webUrl;
29+
private Long projectId;
2930
private Pipeline lastPipeline;
3031

3132
public Author getAuthor() {
@@ -172,6 +173,14 @@ public void setWebUrl(String webUrl) {
172173
this.webUrl = webUrl;
173174
}
174175

176+
public Long getProjectId() {
177+
return projectId;
178+
}
179+
180+
public void setProjectId(Long projectId) {
181+
this.projectId = projectId;
182+
}
183+
175184
public Pipeline getLastPipeline() {
176185
return lastPipeline;
177186
}

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

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

1010
private Long id;
11+
private Long iid;
1112
private Long projectId;
1213
private PipelineStatus status;
14+
private String source;
1315
private String ref;
1416
private String sha;
1517
private String beforeSha;
@@ -35,6 +37,14 @@ public void setId(Long id) {
3537
this.id = id;
3638
}
3739

40+
public Long getIid() {
41+
return iid;
42+
}
43+
44+
public void setIid(Long iid) {
45+
this.iid = iid;
46+
}
47+
3848
public Long getProjectId() {
3949
return projectId;
4050
}
@@ -51,6 +61,14 @@ public void setStatus(PipelineStatus status) {
5161
this.status = status;
5262
}
5363

64+
public String getSource() {
65+
return source;
66+
}
67+
68+
public void setSource(String source) {
69+
this.source = source;
70+
}
71+
5472
public String getRef() {
5573
return ref;
5674
}

src/test/resources/org/gitlab4j/api/commit.json

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,18 @@
2020
},
2121
"status": "running",
2222
"url": "http://localhost/diaspora/diaspora-project-site/-/commit/9df4dd1f0dfae80c05eac4b2bd461b86db5c8e2d",
23-
"web_url": "http://localhost/diaspora/diaspora-project-site/-/commit/9df4dd1f0dfae80c05eac4b2bd461b86db5c8e2d"
23+
"web_url": "http://localhost/diaspora/diaspora-project-site/-/commit/9df4dd1f0dfae80c05eac4b2bd461b86db5c8e2d",
24+
"project_id": 15,
25+
"last_pipeline": {
26+
"id": 16282,
27+
"iid": 688,
28+
"project_id": 15,
29+
"sha": "6104942438c14ec7bd21c6cd5bd995272b3faff6",
30+
"ref": "patch-1",
31+
"status": "success",
32+
"source": "external",
33+
"created_at": "2023-04-03T21:17:04.026Z",
34+
"updated_at": "2023-04-03T21:17:04.157Z",
35+
"web_url": "http://localhost/diaspora/diaspora-project-site/-/pipelines/16282"
36+
}
2437
}

src/test/resources/org/gitlab4j/api/pipeline.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
{
22
"id": 46,
3+
"iid": 11,
4+
"project_id": 1,
35
"status": "success",
4-
"web_url": "http://3cb4fb3163d4/gitlab4j/test-project/pipelines/66",
5-
"ref": "master",
6+
"ref": "main",
67
"sha": "a91957a858320c0e17f3a0eca7cfacbff50ea29a",
78
"before_sha": "a91957a858320c0e17f3a0eca7cfacbff50ea29a",
89
"tag": false,
10+
"yaml_errors": "Included file `.gitlab-ci.yml` does not have valid YAML syntax!",
911
"user": {
1012
"name": "Administrator",
1113
"username": "root",
@@ -17,7 +19,7 @@
1719
"created_at": "2016-08-11T11:28:34.085Z",
1820
"updated_at": "2016-08-11T11:32:35.169Z",
1921
"finished_at": "2016-08-11T11:32:35.145Z",
20-
"coverage": "30.0",
22+
"duration": 123,
2123
"queued_duration": 0.010,
2224
"detailed_status": {
2325
"icon": "status_pending",
@@ -28,5 +30,7 @@
2830
"has_details": true,
2931
"details_path": "/gitlab4j/test-project/pipelines/66",
3032
"favicon": "/assets/ci_favicons/favicon_status_pending-5bdf338420e5221ca24353b6bff1c9367189588750632e9a871b7af09ff6a2ae.png"
31-
}
33+
},
34+
"coverage": "30.0",
35+
"web_url": "https://example.com/foo/bar/pipelines/46"
3236
}

0 commit comments

Comments
 (0)