Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-02-20 16:49:51 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-02-20 16:49:51 +0300
commit71786ddc8e28fbd3cb3fcc4b3ff15e5962a1c82e (patch)
tree6a2d93ef3fb2d353bb7739e4b57e6541f51cdd71 /app/serializers
parenta7253423e3403b8c08f8a161e5937e1488f5f407 (diff)
Add latest changes from gitlab-org/gitlab@15-9-stable-eev15.9.0-rc42
Diffstat (limited to 'app/serializers')
-rw-r--r--app/serializers/analytics/cycle_analytics/stage_entity.rb4
-rw-r--r--app/serializers/build_details_entity.rb2
-rw-r--r--app/serializers/ci/pipeline_entity.rb1
-rw-r--r--app/serializers/codequality_degradation_entity.rb2
-rw-r--r--app/serializers/import/github_realtime_repo_entity.rb18
-rw-r--r--app/serializers/import/github_realtime_repo_serializer.rb7
-rw-r--r--app/serializers/issue_entity.rb11
-rw-r--r--app/serializers/merge_requests/pipeline_entity.rb4
-rw-r--r--app/serializers/note_entity.rb4
-rw-r--r--app/serializers/project_import_entity.rb4
-rw-r--r--app/serializers/triggered_pipeline_entity.rb3
11 files changed, 45 insertions, 15 deletions
diff --git a/app/serializers/analytics/cycle_analytics/stage_entity.rb b/app/serializers/analytics/cycle_analytics/stage_entity.rb
index c1d415dfb40..06b39fedec9 100644
--- a/app/serializers/analytics/cycle_analytics/stage_entity.rb
+++ b/app/serializers/analytics/cycle_analytics/stage_entity.rb
@@ -48,8 +48,8 @@ module Analytics
end
# Avoid including ActionView::Helpers::UrlHelper
- def link_to(*args)
- ActionController::Base.helpers.link_to(*args)
+ def link_to(...)
+ ActionController::Base.helpers.link_to(...)
end
private
diff --git a/app/serializers/build_details_entity.rb b/app/serializers/build_details_entity.rb
index 1caa9720c08..9b21fc57b9e 100644
--- a/app/serializers/build_details_entity.rb
+++ b/app/serializers/build_details_entity.rb
@@ -4,7 +4,7 @@ class BuildDetailsEntity < Ci::JobEntity
expose :coverage, :erased_at, :finished_at, :duration
expose :tag_list, as: :tags
expose :has_trace?, as: :has_trace
- expose :stage
+ expose :stage_name, as: :stage
expose :stuck?, as: :stuck
expose :user, using: UserEntity
expose :runner, using: RunnerEntity
diff --git a/app/serializers/ci/pipeline_entity.rb b/app/serializers/ci/pipeline_entity.rb
index 5e6ae0986df..28baa64bc7c 100644
--- a/app/serializers/ci/pipeline_entity.rb
+++ b/app/serializers/ci/pipeline_entity.rb
@@ -42,7 +42,6 @@ class Ci::PipelineEntity < Grape::Entity
expose :duration
expose :finished_at
expose :event_type_name
- expose :event_type_name, as: :name # To be removed in 15.7
end
expose :merge_request, if: -> (*) { has_presentable_merge_request? }, with: MergeRequestForPipelineEntity do |pipeline|
diff --git a/app/serializers/codequality_degradation_entity.rb b/app/serializers/codequality_degradation_entity.rb
index 52945a753dc..15a26739c51 100644
--- a/app/serializers/codequality_degradation_entity.rb
+++ b/app/serializers/codequality_degradation_entity.rb
@@ -15,4 +15,6 @@ class CodequalityDegradationEntity < Grape::Entity
end
expose :web_url
+
+ expose :engine_name
end
diff --git a/app/serializers/import/github_realtime_repo_entity.rb b/app/serializers/import/github_realtime_repo_entity.rb
new file mode 100644
index 00000000000..c26ae5f668d
--- /dev/null
+++ b/app/serializers/import/github_realtime_repo_entity.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+module Import
+ class GithubRealtimeRepoEntity < Grape::Entity
+ expose :id, documentation: { type: 'integer', example: 1 }
+ expose :import_status, documentation: { type: 'string', example: 'importing' }
+ expose :stats,
+ documentation: {
+ type: 'object', example: '{"fetched":{"label":10},"imported":{"label":10}}'
+ } do |project|
+ ::Gitlab::GithubImport::ObjectCounter.summary(project)
+ end
+
+ expose :import_error, if: ->(project) { project.import_state&.failed? } do |project|
+ project.import_failures.last&.exception_message
+ end
+ end
+end
diff --git a/app/serializers/import/github_realtime_repo_serializer.rb b/app/serializers/import/github_realtime_repo_serializer.rb
new file mode 100644
index 00000000000..8d03f5ce002
--- /dev/null
+++ b/app/serializers/import/github_realtime_repo_serializer.rb
@@ -0,0 +1,7 @@
+# frozen_string_literal: true
+
+module Import
+ class GithubRealtimeRepoSerializer < BaseSerializer
+ entity ::Import::GithubRealtimeRepoEntity
+ end
+end
diff --git a/app/serializers/issue_entity.rb b/app/serializers/issue_entity.rb
index a38f345f617..340fd8803af 100644
--- a/app/serializers/issue_entity.rb
+++ b/app/serializers/issue_entity.rb
@@ -89,12 +89,13 @@ class IssueEntity < IssuableEntity
end
expose :issue_email_participants do |issue|
- # TODO - This is a Temporary solution to avoid leaking participants' emails
- # on public/internal projects when issue is not confidential.
- # Should be removed when https://gitlab.com/gitlab-org/gitlab/-/issues/383448 is implemented.
- next [] unless issue.confidential?
+ presented_issue = issue.present(current_user: request.current_user)
- issue.issue_email_participants.map { |x| { email: x.email } }
+ presented_issue.issue_email_participants.map do |participant|
+ {
+ email: participant.email
+ }
+ end
end
expose :issue_type,
diff --git a/app/serializers/merge_requests/pipeline_entity.rb b/app/serializers/merge_requests/pipeline_entity.rb
index cf050b32d21..500dc435526 100644
--- a/app/serializers/merge_requests/pipeline_entity.rb
+++ b/app/serializers/merge_requests/pipeline_entity.rb
@@ -22,10 +22,6 @@ class MergeRequests::PipelineEntity < Grape::Entity
pipeline.present.event_type_name
end
- expose :name do |pipeline| # To be removed in 15.7
- pipeline.present.event_type_name
- end
-
expose :artifacts do |pipeline, options|
rel = pipeline.downloadable_artifacts
diff --git a/app/serializers/note_entity.rb b/app/serializers/note_entity.rb
index 58ad5812801..679f829e852 100644
--- a/app/serializers/note_entity.rb
+++ b/app/serializers/note_entity.rb
@@ -66,8 +66,8 @@ class NoteEntity < API::Entities::Note
expose :emoji_awardable?, as: :emoji_awardable
expose :award_emoji, if: -> (note, _) { note.emoji_awardable? }, using: AwardEmojiEntity
- expose :report_abuse_path, if: -> (note, _) { note.author_id } do |note|
- new_abuse_report_path(user_id: note.author_id, ref_url: Gitlab::UrlBuilder.build(note))
+ expose :report_abuse_path do |note| # @deprecated To be removed in API version 5
+ add_category_abuse_reports_path
end
expose :noteable_note_url do |note|
diff --git a/app/serializers/project_import_entity.rb b/app/serializers/project_import_entity.rb
index a3dbff3dc0b..58360321f7c 100644
--- a/app/serializers/project_import_entity.rb
+++ b/app/serializers/project_import_entity.rb
@@ -12,4 +12,8 @@ class ProjectImportEntity < ProjectEntity
expose :provider_link, documentation: { type: 'string', example: '/source/source-repo' } do |project, options|
provider_project_link_url(options[:provider_url], project[:import_source])
end
+
+ expose :import_error, if: ->(project) { project.import_state&.failed? } do |project|
+ project.import_failures.last&.exception_message
+ end
end
diff --git a/app/serializers/triggered_pipeline_entity.rb b/app/serializers/triggered_pipeline_entity.rb
index 9fdadb322bf..d8d0e576565 100644
--- a/app/serializers/triggered_pipeline_entity.rb
+++ b/app/serializers/triggered_pipeline_entity.rb
@@ -15,6 +15,9 @@ class TriggeredPipelineEntity < Grape::Entity
expose :name do |pipeline|
pipeline.source_job&.name
end
+ expose :retried do |pipeline|
+ pipeline.source_job&.retried
+ end
end
expose :path do |pipeline|