gitlab-org--gitlab-foss/lib/atlassian/jira_connect/serializers/pipeline_entity.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

32 lines
667 B
Ruby
Raw Permalink Normal View History

# frozen_string_literal: true
module Atlassian
module JiraConnect
module Serializers
# Both this an BuildEntity represent a Ci::Pipeline
class PipelineEntity < Grape::Entity
include Gitlab::Routing
format_with(:string, &:to_s)
expose :id, format_with: :string
expose :display_name, as: :displayName
expose :url
private
alias_method :pipeline, :object
delegate :project, to: :object
def display_name
"#{project.name} pipeline #{pipeline.iid}"
end
def url
project_pipeline_url(project, pipeline)
end
end
end
end
end