Skip mergeability cache during auto-merge process
Summary
When auto-merge processes an MR to decide whether to trigger the actual merge, bypass the mergeability cache to ensure fresh approval state. This prevents queueing merge attempts based on stale cached data, avoiding unnecessary MergeWorker jobs that would just be rejected by the merge strategy's own fresh check.
What changes
MergeWhenChecksPassService#process— passesuse_cache: falsetomergeable?AddToMergeTrainWhenChecksPassService#process— passesuse_cache: falsetomergeable?- Both gated behind
:automerge_skip_mergeability_cachefeature flag (per-project)
What doesn't change
- The
availability_detailscheck (can automerge be set?) still uses the cache — staleness there has no impact on merge correctness - The merge strategies (
FromSourceBranch,FromTrainRef) already passuse_cache: falseindependently
Related
- Depends on !227379 (short-TTL approval cache)
Feature flag
:automerge_skip_mergeability_cache — default disabled, per-project actor
MR acceptance checklist
- I have evaluated the MR acceptance checklist for this MR.