Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
佳 邓
Gitlab4j Api
Commits
bcc9a162
Unverified
Commit
bcc9a162
authored
Oct 10, 2023
by
luvarqpp
Committed by
GitHub
Oct 10, 2023
Browse files
Add erased_at attribute to Job class (#1040)
This adds possibility to identify erased jobs.
parent
5ac9fc9b
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/models/Job.java
View file @
bcc9a162
...
...
@@ -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
;
...
...
src/test/resources/org/gitlab4j/api/job.json
View file @
bcc9a162
...
...
@@ -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"
:
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment