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:

Also fixes the affected RSpec tests.

NOTE:

  • The timeout_value method 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:

References

How to validate

This tests that the feature works before and after enabling the feature flags.

  1. 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)
  1. Update the pipeline configuration with the following:
job:
  script: echo

job-with-job-timeout:
  script: echo
  timeout: 1m 25s
  1. Run the pipeline and view each job's details. Observe that they have their timeout and time source correctly populated.

Screenshot_2025-08-29_at_3.17.15_PM

Screenshot_2025-08-29_at_3.17.28_PM

  1. Enable ci_use_new_job_update_timeout_state and repeat steps 2 & 3.

  2. Enable read_from_new_ci_destinations and 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)

Edited by Leaminn Ma

Merge request reports

Loading