Add job_telemetry feature negotiation to CI job request

What does this MR do and why?

Adds job_telemetry: true to the features object in the /api/v4/jobs/request response, gated behind the ci_job_telemetry beta feature flag.

This is the Rails-side implementation of feature negotiation for CI job telemetry. When the feature flag is enabled for a project, the runner receives job_telemetry: true in the job payload, signaling it to emit telemetry data.

Implementation details

  • EE override of Ci::Build#features in ee/app/models/ee/ci/build.rb — conditionally adds job_telemetry: true when Feature.enabled?(:ci_job_telemetry, project)
  • Beta feature flag ci_job_telemetry — disabled by default, for gradual rollout
  • No changelog — change is behind a disabled-by-default feature flag

How to set up and validate locally

  1. Enable the feature flag for a project:
    Feature.enable(:ci_job_telemetry, Project.find_by_full_path('your/project'))
  2. Register a runner and request a job via the API or trigger a pipeline
  3. Verify the job payload includes "features": { ..., "job_telemetry": true }
  4. Disable the flag and verify job_telemetry is absent from the response:
    Feature.disable(:ci_job_telemetry)

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.

Merge request reports

Loading