Unverified Commit bcc9a162 authored by luvarqpp's avatar luvarqpp Committed by GitHub
Browse files

Add erased_at attribute to Job class (#1040)

This adds possibility to identify erased jobs.
parent 5ac9fc9b
......@@ -12,6 +12,7 @@ public class Job {
private String coverage;
private Date createdAt;
private Date finishedAt;
private Date erasedAt;
private Date artifactsExpireAt;
private String name;
private Pipeline pipeline;
......@@ -64,6 +65,23 @@ public class Job {
this.finishedAt = finishedAt;
}
/**
* When someone deletes job using
* <a href="https://docs.gitlab.com/ee/api/jobs.html#erase-a-job">job erase api</a>, you can
* detect it using this field. Normally erasing job does mean only that job artifacts and
* a job logs gets removed. Job metadata (started_at, duration, ....) stays in place.
*
* You can use this attribute to filter out such jobs, that have erased at non-null if you need
* to.
*/
public Date getErasedAt() {
return erasedAt;
}
public void setErasedAt(Date erasedAt) {
this.erasedAt = erasedAt;
}
public Date getArtifactsExpireAt() {
return artifactsExpireAt;
}
......@@ -248,6 +266,11 @@ public class Job {
return this;
}
public Job withErasedAt(Date erasedAt) {
this.erasedAt = erasedAt;
return this;
}
public Job withName(String name) {
this.name = name;
return this;
......
......@@ -37,6 +37,7 @@
"tag": false,
"web_url": "https://example.com/foo/bar/-/jobs/7",
"allow_failure": false,
"erased_at": "2016-01-11T11:30:19.914Z",
"duration": 0.465,
"queued_duration": 0.010,
"user": {
......
Supports Markdown
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