Add metrics tracking for playing jobs with new input values

Summary

Add internal event tracking for when users play a manual job with custom input values, similar to the existing retry_job_with_new_input_values metric for job retries.

Background

In the MR adding job inputs support to play endpoints, we added support for passing job inputs when playing manual jobs via REST API and GraphQL. However, we did not add metrics tracking for this feature.

The Ci::RetryJobService already tracks retry_job_with_new_input_values when jobs are retried with custom inputs (see track_retry_with_new_input_values method). We should add equivalent tracking for play operations.

Proposal

Add a new internal event play_job_with_new_input_values in Ci::PlayBuildService that triggers when:

  • Feature flag ci_job_inputs is enabled
  • User plays a manual job with custom input values
  • Inputs are successfully validated and filtered

Implementation

Similar to Ci::RetryJobService#track_retry_with_new_input_values, add:

def track_play_with_new_input_values(filtered_inputs)
  return unless filtered_inputs.present?

  track_internal_event(
    'play_job_with_new_input_values',
    project: project,
    user: current_user
  )
end

Call this method after successful input processing in PlayBuildService#execute.

Edited by Avielle Wolfe