Skip to content

Add missing fields on commit and pipeline #959

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/main/java/org/gitlab4j/api/models/Commit.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class Commit {
private String title;
private String url;
private String webUrl;
private Long projectId;
private Pipeline lastPipeline;

public Author getAuthor() {
Expand Down Expand Up @@ -172,6 +173,14 @@ public void setWebUrl(String webUrl) {
this.webUrl = webUrl;
}

public Long getProjectId() {
return projectId;
}

public void setProjectId(Long projectId) {
this.projectId = projectId;
}

public Pipeline getLastPipeline() {
return lastPipeline;
}
Expand Down
18 changes: 18 additions & 0 deletions src/main/java/org/gitlab4j/api/models/Pipeline.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
public class Pipeline {

private Long id;
private Long iid;
private Long projectId;
private PipelineStatus status;
private String source;
private String ref;
private String sha;
private String beforeSha;
Expand All @@ -35,6 +37,14 @@ public void setId(Long id) {
this.id = id;
}

public Long getIid() {
return iid;
}

public void setIid(Long iid) {
this.iid = iid;
}

public Long getProjectId() {
return projectId;
}
Expand All @@ -51,6 +61,14 @@ public void setStatus(PipelineStatus status) {
this.status = status;
}

public String getSource() {
return source;
}

public void setSource(String source) {
this.source = source;
}

public String getRef() {
return ref;
}
Expand Down
15 changes: 14 additions & 1 deletion src/test/resources/org/gitlab4j/api/commit.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,18 @@
},
"status": "running",
"url": "http://localhost/diaspora/diaspora-project-site/-/commit/9df4dd1f0dfae80c05eac4b2bd461b86db5c8e2d",
"web_url": "http://localhost/diaspora/diaspora-project-site/-/commit/9df4dd1f0dfae80c05eac4b2bd461b86db5c8e2d"
"web_url": "http://localhost/diaspora/diaspora-project-site/-/commit/9df4dd1f0dfae80c05eac4b2bd461b86db5c8e2d",
"project_id": 15,
"last_pipeline": {
"id": 16282,
"iid": 688,
"project_id": 15,
"sha": "6104942438c14ec7bd21c6cd5bd995272b3faff6",
"ref": "patch-1",
"status": "success",
"source": "external",
"created_at": "2023-04-03T21:17:04.026Z",
"updated_at": "2023-04-03T21:17:04.157Z",
"web_url": "http://localhost/diaspora/diaspora-project-site/-/pipelines/16282"
}
}
12 changes: 8 additions & 4 deletions src/test/resources/org/gitlab4j/api/pipeline.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"id": 46,
"iid": 11,
"project_id": 1,
"status": "success",
"web_url": "http://3cb4fb3163d4/gitlab4j/test-project/pipelines/66",
"ref": "master",
"ref": "main",
"sha": "a91957a858320c0e17f3a0eca7cfacbff50ea29a",
"before_sha": "a91957a858320c0e17f3a0eca7cfacbff50ea29a",
"tag": false,
"yaml_errors": "Included file `.gitlab-ci.yml` does not have valid YAML syntax!",
"user": {
"name": "Administrator",
"username": "root",
Expand All @@ -17,7 +19,7 @@
"created_at": "2016-08-11T11:28:34.085Z",
"updated_at": "2016-08-11T11:32:35.169Z",
"finished_at": "2016-08-11T11:32:35.145Z",
"coverage": "30.0",
"duration": 123,
"queued_duration": 0.010,
"detailed_status": {
"icon": "status_pending",
Expand All @@ -28,5 +30,7 @@
"has_details": true,
"details_path": "/gitlab4j/test-project/pipelines/66",
"favicon": "/assets/ci_favicons/favicon_status_pending-5bdf338420e5221ca24353b6bff1c9367189588750632e9a871b7af09ff6a2ae.png"
}
},
"coverage": "30.0",
"web_url": "https://example.com/foo/bar/pipelines/46"
}