diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index a4af7779530462095d6e3906dea277b24f126010..faa1c2e124d7e550530dc8d285d6a4433f6ad8f5 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -255,7 +255,7 @@ def clone_accessors yaml_variables when environment coverage_regex description tag_list protected needs_attributes job_variables_attributes resource_group scheduling_type - ci_stage partition_id id_tokens interruptible execution_config_id].freeze + inputs ci_stage partition_id id_tokens interruptible execution_config_id].freeze end def supported_keyset_orderings diff --git a/app/models/ci/job_input.rb b/app/models/ci/job_input.rb index 69924f6abadf2c72929766d29297240db9ca9798..fcf6ea59359b8cc8acc80b0a3a5a02443531532a 100644 --- a/app/models/ci/job_input.rb +++ b/app/models/ci/job_input.rb @@ -9,6 +9,8 @@ class JobInput < Ci::ApplicationRecord self.table_name = :p_ci_job_inputs self.primary_key = :id + enum :input_type, { string: 0 } + partitionable scope: :job, partitioned: true belongs_to :job, ->(build_name) { in_partition(build_name) }, diff --git a/app/presenters/ci/build_runner_presenter.rb b/app/presenters/ci/build_runner_presenter.rb index b75f003d2637e6eef4c0faccd40ac5b7d086ae53..5c694cc48a08b039d3710288b665ab097e920cde 100644 --- a/app/presenters/ci/build_runner_presenter.rb +++ b/app/presenters/ci/build_runner_presenter.rb @@ -43,6 +43,19 @@ def repo_object_format project.repository_object_format.to_s end + def runner_inputs + inputs.map do |input| + { + key: input.name, + value: { + content: input.value, + sensitive: input.sensitive, + type: input.input_type + } + } + end + end + def runner_variables variables .sort_and_expand_all(keep_undefined: true, expand_file_refs: false, expand_raw_refs: false) diff --git a/lib/api/entities/ci/job_request/response.rb b/lib/api/entities/ci/job_request/response.rb index 817fb31d475ab60b4b5fed469bca04eba7deff18..8c82ca523dc3d76b7462191acca6ad79e9d244ae 100644 --- a/lib/api/entities/ci/job_request/response.rb +++ b/lib/api/entities/ci/job_request/response.rb @@ -21,6 +21,7 @@ class Response < Grape::Entity model end + expose :runner_inputs, as: :inputs expose :runner_variables, as: :variables expose :steps, using: Entities::Ci::JobRequest::Step, unless: ->(job) do job.execution_config&.run_steps.present?