[FF] auto_merge_diagnostic_logging - diagnostic logging for stuck auto-merge MRs

Summary

Roll out the auto_merge_diagnostic_logging ops feature flag (introduced in !240033 (merged)) to investigate intermittently stuck auto-merge merge requests (#596177).

While enabled for a project, two structured log entries are emitted — only for auto-merge MRs, and only when the CI mergeability check is non-success:

  • auto_merge_ci_diagnostic — from MergeRequests::Mergeability::CheckCiStatusService
  • auto_merge_worker_invoked — from AutoMergeProcessWorker

This is a diagnostic flag, not a feature toggle. We enable it for the affected project, capture the logs on the next stuck MR, confirm the root cause, then remove the flag and the logging. It will not be rolled out globally.

Owners

Expectations

What are we expecting to happen?

On the next auto-merge MR that stays stuck after a green pipeline, an auto_merge_ci_diagnostic line shows why the CI check returned checking — distinguishing a stale pipeline_creating? Redis flag from a stale or mismatched head pipeline.

What can go wrong and how would we detect it?

Minimal risk: a small increase in log volume, scoped to the enabled project and to auto-merge MRs only (default off everywhere else). If log volume is a concern, disable the flag.

Rollout steps

Enable for the affected project (production)

  • /chatops run feature set auto_merge_diagnostic_logging true --project=datahow/projects/dhl3/devops/deployment-dhl-multi
  • Confirm auto_merge_ci_diagnostic entries appear for the project in Kibana.
  • Wait for a stuck-MR occurrence and capture the log line(s).

(Optional) enable for additional reporting projects

  • /chatops run feature set auto_merge_diagnostic_logging true --project=<path>

Rollback / disable

  • /chatops run feature set auto_merge_diagnostic_logging false --project=<path>
  • Or delete from all environments: /chatops run feature delete auto_merge_diagnostic_logging

Cleanup (after root cause confirmed)

  • Open an MR removing the auto_merge_diagnostic_logging flag and the diagnostic logging it gates.
  • /chatops run feature delete auto_merge_diagnostic_logging
  • Close this issue.