summaryrefslogtreecommitdiff
path: root/app/serializers
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-17 15:06:17 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-17 15:06:17 +0000
commit238d22c07218adf2b8f3db630ee8b74ca6f29df5 (patch)
tree23fd5f85efef0fb95eb73bf6395d5b7e8c0f1b9f /app/serializers
parent6b75320f525f841454f1ab162d141d3610f2e77b (diff)
downloadgitlab-ce-238d22c07218adf2b8f3db630ee8b74ca6f29df5.tar.gz
Add latest changes from gitlab-org/gitlab@masterlist
Diffstat (limited to 'app/serializers')
-rw-r--r--app/serializers/build_trace_entity.rb17
-rw-r--r--app/serializers/build_trace_serializer.rb5
-rw-r--r--app/serializers/evidences/author_entity.rb9
-rw-r--r--app/serializers/evidences/evidence_entity.rb7
-rw-r--r--app/serializers/evidences/evidence_serializer.rb7
-rw-r--r--app/serializers/evidences/issue_entity.rb1
-rw-r--r--app/serializers/evidences/milestone_entity.rb2
-rw-r--r--app/serializers/evidences/release_entity.rb4
8 files changed, 39 insertions, 13 deletions
diff --git a/app/serializers/build_trace_entity.rb b/app/serializers/build_trace_entity.rb
new file mode 100644
index 00000000000..b5bac8a5d64
--- /dev/null
+++ b/app/serializers/build_trace_entity.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class BuildTraceEntity < Grape::Entity
+ expose :build_id, as: :id
+ expose :build_status, as: :status
+ expose :build_complete?, as: :complete
+
+ expose :state
+ expose :append
+ expose :truncated
+ expose :offset
+ expose :size
+ expose :total
+
+ expose :json_lines, as: :lines, if: ->(*) { object.json? }
+ expose :html_lines, as: :html, if: ->(*) { object.html? }
+end
diff --git a/app/serializers/build_trace_serializer.rb b/app/serializers/build_trace_serializer.rb
new file mode 100644
index 00000000000..c95158f10a4
--- /dev/null
+++ b/app/serializers/build_trace_serializer.rb
@@ -0,0 +1,5 @@
+# frozen_string_literal: true
+
+class BuildTraceSerializer < BaseSerializer
+ entity BuildTraceEntity
+end
diff --git a/app/serializers/evidences/author_entity.rb b/app/serializers/evidences/author_entity.rb
deleted file mode 100644
index 9023c64dad2..00000000000
--- a/app/serializers/evidences/author_entity.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# frozen_string_literal: true
-
-module Evidences
- class AuthorEntity < Grape::Entity
- expose :id
- expose :name
- expose :email
- end
-end
diff --git a/app/serializers/evidences/evidence_entity.rb b/app/serializers/evidences/evidence_entity.rb
new file mode 100644
index 00000000000..9689ae10895
--- /dev/null
+++ b/app/serializers/evidences/evidence_entity.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+module Evidences
+ class EvidenceEntity < Grape::Entity
+ expose :release, using: Evidences::ReleaseEntity
+ end
+end
diff --git a/app/serializers/evidences/evidence_serializer.rb b/app/serializers/evidences/evidence_serializer.rb
new file mode 100644
index 00000000000..d03032bc65c
--- /dev/null
+++ b/app/serializers/evidences/evidence_serializer.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+module Evidences
+ class EvidenceSerializer < BaseSerializer
+ entity EvidenceEntity
+ end
+end
diff --git a/app/serializers/evidences/issue_entity.rb b/app/serializers/evidences/issue_entity.rb
index 883256bf38a..2f1f5dc3d18 100644
--- a/app/serializers/evidences/issue_entity.rb
+++ b/app/serializers/evidences/issue_entity.rb
@@ -5,7 +5,6 @@ module Evidences
expose :id
expose :title
expose :description
- expose :author, using: AuthorEntity
expose :state
expose :iid
expose :confidential
diff --git a/app/serializers/evidences/milestone_entity.rb b/app/serializers/evidences/milestone_entity.rb
index 8118cab4403..eeb3d58d4c7 100644
--- a/app/serializers/evidences/milestone_entity.rb
+++ b/app/serializers/evidences/milestone_entity.rb
@@ -9,6 +9,6 @@ module Evidences
expose :iid
expose :created_at
expose :due_date
- expose :issues, using: IssueEntity
+ expose :issues, using: Evidences::IssueEntity
end
end
diff --git a/app/serializers/evidences/release_entity.rb b/app/serializers/evidences/release_entity.rb
index 8916ce67b4c..59e379a3c08 100644
--- a/app/serializers/evidences/release_entity.rb
+++ b/app/serializers/evidences/release_entity.rb
@@ -7,7 +7,7 @@ module Evidences
expose :name
expose :description
expose :created_at
- expose :project, using: ProjectEntity
- expose :milestones, using: MilestoneEntity
+ expose :project, using: Evidences::ProjectEntity
+ expose :milestones, using: Evidences::MilestoneEntity
end
end