From 8411d1cffc05171e82d727d883f03e279c8e9e05 Mon Sep 17 00:00:00 2001 From: Mark Chao Date: Mon, 23 Jul 2018 10:42:19 +0800 Subject: Add email_events to replace EMAIL_EVENTS because it needs to be dynamic, allowing override for EE. --- lib/api/entities.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/api/entities.rb') diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 27f28e1df93..453ebb9c669 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -856,7 +856,7 @@ module API class NotificationSetting < Grape::Entity expose :level expose :events, if: ->(notification_setting, _) { notification_setting.custom? } do - ::NotificationSetting::EMAIL_EVENTS.each do |event| + ::NotificationSetting.email_events.each do |event| expose event end end -- cgit v1.2.1 From 3a80f030375835f0cfaf105ae6aba7c103f63de5 Mon Sep 17 00:00:00 2001 From: Peter Marko Date: Wed, 18 Jul 2018 23:46:56 +0200 Subject: Expose all artifacts sizes in jobs api --- lib/api/entities.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/api/entities.rb') diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 27f28e1df93..1648094cfde 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -1080,6 +1080,10 @@ module API expose :filename, :size end + class JobArtifact < Grape::Entity + expose :file_type, :size, :filename, :file_format + end + class JobBasic < Grape::Entity expose :id, :status, :stage, :name, :ref, :tag, :coverage expose :created_at, :started_at, :finished_at @@ -1094,7 +1098,9 @@ module API end class Job < JobBasic + # artifacts_file is included in job_artifacts, but kept for backward compatibility (remove in api/v5) expose :artifacts_file, using: JobArtifactFile, if: -> (job, opts) { job.artifacts? } + expose :job_artifacts, as: :artifacts, using: JobArtifact expose :runner, with: Runner expose :artifacts_expire_at end -- cgit v1.2.1 From f6f6295027a5040f27a8cbb2b979d16b445a284b Mon Sep 17 00:00:00 2001 From: Nick Thomas Date: Tue, 14 Aug 2018 22:31:38 +0100 Subject: Convert the license template API to use the new LicenseTemplateFinder --- lib/api/entities.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/api/entities.rb') diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 458ee320099..b6393fdef19 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -1159,7 +1159,7 @@ module API class License < Grape::Entity expose :key, :name, :nickname - expose :featured, as: :popular + expose :popular?, as: :popular expose :url, as: :html_url expose(:source_url) { |license| license.meta['source'] } expose(:description) { |license| license.meta['description'] } -- cgit v1.2.1