From 3af1f47ad60bf86ac60cea4b6fa5ad44d53ecfd6 Mon Sep 17 00:00:00 2001 From: Avielle Wolfe Date: Thu, 24 Jul 2025 12:47:26 +0200 Subject: [PATCH] WIP --- app/models/ci/build.rb | 2 +- app/models/ci/job_input.rb | 2 ++ app/presenters/ci/build_runner_presenter.rb | 13 +++++++++++++ lib/api/entities/ci/job_request/response.rb | 1 + 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index a4af7779530462..faa1c2e124d7e5 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 69924f6abadf2c..fcf6ea59359b8c 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 b75f003d2637e6..5c694cc48a08b0 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 817fb31d475ab6..8c82ca523dc3d7 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? -- GitLab