summaryrefslogtreecommitdiff
path: root/app/serializers/analytics_build_entity.rb
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2016-11-14 14:53:06 +0100
committerJames Lopez <james@jameslopez.es>2016-11-17 08:22:58 +0100
commit3b179bc37b940521522af6d8bf6762c2a9a0e251 (patch)
treeb77cf724e7325928b73e04f80bde6bfd4dd431b1 /app/serializers/analytics_build_entity.rb
parent81d0146c4cf0d34b1b81da770483ed864482149c (diff)
downloadgitlab-ce-3b179bc37b940521522af6d8bf6762c2a9a0e251.tar.gz
WIP - refactored events to use build serializer, related spec passing
Diffstat (limited to 'app/serializers/analytics_build_entity.rb')
-rw-r--r--app/serializers/analytics_build_entity.rb14
1 files changed, 10 insertions, 4 deletions
diff --git a/app/serializers/analytics_build_entity.rb b/app/serializers/analytics_build_entity.rb
index 7ed89f1f347..a07f0beccd4 100644
--- a/app/serializers/analytics_build_entity.rb
+++ b/app/serializers/analytics_build_entity.rb
@@ -2,17 +2,23 @@ class AnalyticsBuildEntity < Grape::Entity
include RequestAwareEntity
expose :name
+ expose :id
expose :ref, as: :branch
expose :short_sha
expose :started_at, as: :date
expose :duration, as: :total_time
+ expose :author, using: UserEntity
- expose :url do |build|
- url_to(:namespace_project_build, build)
+ expose :branch do
+ expose :ref, as: :name
+
+ expose :url do |build|
+ url_to(:namespace_project_tree, build, build.ref)
+ end
end
- expose :branch_url do |build|
- url_to(:namespace_project_tree, build, build.ref)
+ expose :url do |build|
+ url_to(:namespace_project_build, build)
end
expose :commit_url do |build|