2021-09-30 23:02:18 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module API
|
|
|
|
module Entities
|
|
|
|
module Ci
|
|
|
|
module JobRequest
|
|
|
|
class Response < Grape::Entity
|
|
|
|
expose :id
|
|
|
|
expose :token
|
|
|
|
expose :allow_git_fetch
|
|
|
|
|
|
|
|
expose :job_info, using: Entities::Ci::JobRequest::JobInfo do |model|
|
|
|
|
model
|
|
|
|
end
|
|
|
|
|
|
|
|
expose :git_info, using: Entities::Ci::JobRequest::GitInfo do |model|
|
|
|
|
model
|
|
|
|
end
|
|
|
|
|
|
|
|
expose :runner_info, using: Entities::Ci::JobRequest::RunnerInfo do |model|
|
|
|
|
model
|
|
|
|
end
|
|
|
|
|
|
|
|
expose :runner_variables, as: :variables
|
|
|
|
expose :steps, using: Entities::Ci::JobRequest::Step
|
2023-03-04 22:38:38 +05:30
|
|
|
expose :runtime_hooks, as: :hooks,
|
|
|
|
using: Entities::Ci::JobRequest::Hook,
|
|
|
|
if: ->(job) { ::Feature.enabled?(:ci_hooks_pre_get_sources_script, job.project) }
|
2021-09-30 23:02:18 +05:30
|
|
|
expose :image, using: Entities::Ci::JobRequest::Image
|
|
|
|
expose :services, using: Entities::Ci::JobRequest::Service
|
|
|
|
expose :artifacts, using: Entities::Ci::JobRequest::Artifacts
|
|
|
|
expose :cache, using: Entities::Ci::JobRequest::Cache
|
|
|
|
expose :credentials, using: Entities::Ci::JobRequest::Credentials
|
|
|
|
expose :features
|
2022-07-16 23:28:13 +05:30
|
|
|
expose :dependencies do |job, options|
|
|
|
|
Entities::Ci::JobRequest::Dependency.represent(job.all_dependencies, options.merge(running_job: job))
|
|
|
|
end
|
2021-09-30 23:02:18 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
API::Entities::Ci::JobRequest::Response.prepend_mod_with('API::Entities::Ci::JobRequest::Response')
|