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

Expose locked? in BuildDetailsEntity

parent 22262be8
......@@ -46,6 +46,10 @@ class BuildDetailsEntity < JobEntity
expose :expired, if: -> (*) { build.artifacts_expire_at.present? } do |build|
build.artifacts_expired?
end
expose :locked, if: -> (*) { build.job_artifacts_archive.present? } do |build|
build.job_artifacts_archive.locked?
end
end
expose :report_artifacts,
......
......@@ -5,7 +5,8 @@
"browse_path": { "type": "string"},
"keep_path": { "type": "string"},
"expired": { "type": "boolean" },
"expire_at": { "type": "string", "format": "date-time" }
"expire_at": { "type": "string", "format": "date-time" },
"locked": { "type": "boolean" }
},
"additionalProperties": false
}
......@@ -190,7 +190,7 @@ describe BuildDetailsEntity do
let!(:report) { create(:ci_job_artifact, :codequality, job: build) }
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
......
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