Commit f7fe44c2 authored by Tetiana Chupryna's avatar Tetiana Chupryna Committed by Peter Leitzen

Resolve "Dependency List is not up-to-date - backend"

parent 704c35aa
......@@ -14,6 +14,10 @@ class DependencyListEntity < Grape::Entity
expose :job_path, if: ->(_, options) { options[:build] && can_read_job_path? } do |_, options|
project_build_path(project, options[:build].id)
end
expose :generated_at, if: ->(_, options) { options[:build] && can_read_job_path? } do |_, options|
options[:build].finished_at
end
end
private
......
---
title: Expose time when the build was generated
merge_request: 17113
author:
type: added
......@@ -13,7 +13,8 @@
},
"report": {
"status": { "type": "string" },
"job_path": { "type": "string" }
"job_path": { "type": "string" },
"generated_at": { "type": "string" }
}
},
"additionalProperties": false
......
......@@ -33,6 +33,7 @@ describe DependencyListEntity do
expect(subject[:dependencies][0][:name]).to eq('nokogiri')
expect(subject[:report][:status]).to eq(:ok)
expect(subject[:report][:job_path]).to eq(job_path)
expect(subject[:report][:generated_at]).to eq(ci_build.finished_at)
end
end
......@@ -69,6 +70,7 @@ describe DependencyListEntity do
it 'has only status failed_job' do
expect(subject[:report][:status]).to eq(:job_failed)
expect(subject[:report]).not_to include(:job_path)
expect(subject[:report]).not_to include(:generated_at)
end
end
end
......@@ -81,6 +83,7 @@ describe DependencyListEntity do
it 'has status job_not_set_up and no job_path' do
expect(subject[:report][:status]).to eq(:job_not_set_up)
expect(subject[:report][:job_path]).not_to be_present
expect(subject[:report][:generated_at]).not_to be_present
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