Update timeout/timeout_source getter/setter methods and apply feature flags
What does this MR do and why?
Context
Since some job metadata will be moved to new destinations (e.g. intrinsic data moved to ci_builds and immutable processing data to ci_job_definitions) we need to be able to use feature flags to read/write data to specific destinations.
timeout and timeout_source are intrinsic data that will be persisted in p_ci_builds.
This MR
Updates the timeout/timeout_source getter/setter, moves them to Ci::Metadatable and applies the following feature flags:
-
read_from_new_ci_destinations(Roll out: #552063 (closed)) -
stop_writing_builds_metadata(Roll out: #552065 (closed))
Also fixes the affected RSpec tests.
NOTE:
- The
timeout_valuemethod was introduced in !196948 (merged). This MR applies the other timeout-related changes based on the POC !193948 (diffs). - The BuildMetadata API entity and presenter will be updated as part of #552059 (closed), which will use the new methods introduced in this MR.
UPDATE: The new job update_timeout_state is gated behind a feature flag:
- FF:
ci_use_new_job_update_timeout_state - Roll-out issue: #566611 (closed)
References
- Resolves part of #552057 (closed)
- Related to Fix presenters and API entities exposing CI bui... (#552059 - closed)
- Roll out issue for new feature flag: [FF] `ci_use_new_job_update_timeout_state` -- W... (#566611 - closed)
How to validate
This tests that the feature works before and after enabling the feature flags.
- First with all feature flags disabled:
Feature.disable(:read_from_new_ci_destinations)
Feature.disable(:stop_writing_builds_metadata)
Feature.disable(:ci_use_new_job_update_timeout_state)
- Update the pipeline configuration with the following:
job:
script: echo
job-with-job-timeout:
script: echo
timeout: 1m 25s
- Run the pipeline and view each job's details. Observe that they have their timeout and time source correctly populated.
-
Enable
ci_use_new_job_update_timeout_stateand repeat steps 2 & 3. -
Enable
read_from_new_ci_destinationsand repeat steps 2 & 3.
6. Enable stop_writing_builds_metadata and repeat steps 2 & 3.
- This won't work yet because we need to update the build metadata entity/presenter in #552059 (closed).
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #552057 (closed)

