summaryrefslogtreecommitdiff
path: root/lib/api/entities.rb
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2017-08-12 00:17:48 +0100
committerFilipa Lacerda <filipa@gitlab.com>2017-08-12 00:17:48 +0100
commite93214bce63518b31532d9406d00703aa2ef2d26 (patch)
tree2b46a71ad89f3fa9f4996af51d318228a49fee5b /lib/api/entities.rb
parentab88fcf117c4f55071ffaa476b7e72e0c11a967f (diff)
parent1c874f71e31fdf2bbc9120fe2111b2daea320e86 (diff)
downloadgitlab-ce-e93214bce63518b31532d9406d00703aa2ef2d26.tar.gz
Merge branch 'master' into issue-discussions-refactor
* master: (66 commits) fix confidential border issue as well as confidential styles leaking on new MR Migrate force push check to Gitaly Add option to disable project export on instance Better categorize test coverage results Add option to disable project export on instance - db changes Better caching and indexing of broadcast messages Include the `is_admin` field in the `GET /users/:id` API when current user is an admin Document rspec-retry and rspec-flaky Fix cop description Retrieve and sync flaky specs report from and to S3 Use a new RspecFlakyListener to detect flaky specs Fix formatting of patch_versions.md [skip ci] Enable Timecop safe mode Show error message for API 500 error in tests, and Fix merge request diff deserialisation when too_large was absent Delete correct key from `session` after authenticating using U2F Bumps omniauth-ldap gem version to 2.0.4 Pending delete projects no longer return 500 error in Admins projects view Do not run the `ee_compat_check` job for stableish branches Update gitlab.po: Missing 'r' in "Fouché" that comes from "Fourcher" verb. ...
Diffstat (limited to 'lib/api/entities.rb')
-rw-r--r--lib/api/entities.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index 7ee25bf177c..f7e251736ab 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -497,14 +497,24 @@ module API
expose :author, using: Entities::UserBasic
end
+ class PushEventPayload < Grape::Entity
+ expose :commit_count, :action, :ref_type, :commit_from, :commit_to
+ expose :ref, :commit_title
+ end
+
class Event < Grape::Entity
expose :title, :project_id, :action_name
expose :target_id, :target_iid, :target_type, :author_id
- expose :data, :target_title
+ expose :target_title
expose :created_at
expose :note, using: Entities::Note, if: ->(event, options) { event.note? }
expose :author, using: Entities::UserBasic, if: ->(event, options) { event.author }
+ expose :push_event_payload,
+ as: :push_data,
+ using: PushEventPayload,
+ if: -> (event, _) { event.push? }
+
expose :author_username do |event, options|
event.author&.username
end