Commit 8a13ab76 authored by Matija Čupić's avatar Matija Čupić

Expose locked? in BuildDetailsEntity

parent 22262be8
...@@ -46,6 +46,10 @@ class BuildDetailsEntity < JobEntity ...@@ -46,6 +46,10 @@ class BuildDetailsEntity < JobEntity
expose :expired, if: -> (*) { build.artifacts_expire_at.present? } do |build| expose :expired, if: -> (*) { build.artifacts_expire_at.present? } do |build|
build.artifacts_expired? build.artifacts_expired?
end end
expose :locked, if: -> (*) { build.job_artifacts_archive.present? } do |build|
build.job_artifacts_archive.locked?
end
end end
expose :report_artifacts, expose :report_artifacts,
......
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
"browse_path": { "type": "string"}, "browse_path": { "type": "string"},
"keep_path": { "type": "string"}, "keep_path": { "type": "string"},
"expired": { "type": "boolean" }, "expired": { "type": "boolean" },
"expire_at": { "type": "string", "format": "date-time" } "expire_at": { "type": "string", "format": "date-time" },
"locked": { "type": "boolean" }
}, },
"additionalProperties": false "additionalProperties": false
} }
...@@ -190,7 +190,7 @@ describe BuildDetailsEntity do ...@@ -190,7 +190,7 @@ describe BuildDetailsEntity do
let!(:report) { create(:ci_job_artifact, :codequality, job: build) } let!(:report) { create(:ci_job_artifact, :codequality, job: build) }
it 'exposes artifact details' do it 'exposes artifact details' do
expect(subject[:artifact].keys).to include(:download_path, :browse_path, :keep_path, :expire_at, :expired) expect(subject[:artifact].keys).to include(:download_path, :browse_path, :keep_path, :expire_at, :expired, :locked)
end end
end end
end end
......
Markdown is supported
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