gitlab-org--gitlab-foss/app/serializers/pipeline_stage_entity.rb

19 lines
411 B
Ruby
Raw Normal View History

class PipelineStageEntity < Grape::Entity
include RequestAwareEntity
expose :name
expose :status do |stage, options|
StatusEntity.represent(
stage.detailed_status(request.user),
options)
end
expose :path do |stage|
namespace_project_pipeline_path(
stage.pipeline.project.namespace,
stage.pipeline.project,
stage.pipeline.id,
anchor: stage.name)
end
end