Class: Gitlab::BackgroundMigration::MoveCiBuildsMetadata::JobPresenter
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Gitlab::BackgroundMigration::MoveCiBuildsMetadata::JobPresenter
- Defined in:
- lib/gitlab/background_migration/move_ci_builds_metadata.rb
Overview
We’re extending the job object to store the connected data in memory.
Instance Attribute Summary collapse
-
#job_definition ⇒ Object
Returns the value of attribute job_definition.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#run_steps ⇒ Object
readonly
Returns the value of attribute run_steps.
-
#tag_list ⇒ Object
readonly
Returns the value of attribute tag_list.
Instance Method Summary collapse
- #definition_config ⇒ Object
-
#initialize(job, metadata:, tag_list:, run_steps:) ⇒ JobPresenter
constructor
A new instance of JobPresenter.
Constructor Details
#initialize(job, metadata:, tag_list:, run_steps:) ⇒ JobPresenter
Returns a new instance of JobPresenter.
251 252 253 254 255 256 257 258 |
# File 'lib/gitlab/background_migration/move_ci_builds_metadata.rb', line 251 def initialize(job, metadata:, tag_list:, run_steps:) @job = job @metadata = @tag_list = tag_list @run_steps = run_steps super(job) end |
Instance Attribute Details
#job_definition ⇒ Object
Returns the value of attribute job_definition.
249 250 251 |
# File 'lib/gitlab/background_migration/move_ci_builds_metadata.rb', line 249 def job_definition @job_definition end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
248 249 250 |
# File 'lib/gitlab/background_migration/move_ci_builds_metadata.rb', line 248 def @metadata end |
#run_steps ⇒ Object (readonly)
Returns the value of attribute run_steps.
248 249 250 |
# File 'lib/gitlab/background_migration/move_ci_builds_metadata.rb', line 248 def run_steps @run_steps end |
#tag_list ⇒ Object (readonly)
Returns the value of attribute tag_list.
248 249 250 |
# File 'lib/gitlab/background_migration/move_ci_builds_metadata.rb', line 248 def tag_list @tag_list end |
Instance Method Details
#definition_config ⇒ Object
260 261 262 263 264 265 266 267 268 269 270 271 272 |
# File 'lib/gitlab/background_migration/move_ci_builds_metadata.rb', line 260 def definition_config config = {} # We also handle really old jobs here that were created before we added the metadata table/ config[:options] = &. || config[:yaml_variables] = &.config_variables.presence || parsed_variables config.merge!() if config[:tag_list] = tag_list if tag_list.present? config[:run_steps] = run_steps if run_steps.present? config end |