Merge requests API: fix cache for "with_labels_details" argument
What does this MR do and why?
Contributes to #386784 (closed)
Problem
Merge requests API endpoint uses cache, but the cache refresh doesn't
trigger when the user provides with_labels_details argument.
Solution
Add with_labels_details argument value into the cache key. It will
create a new version of the cache when the user passes
with_labels_details.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
| Before | After |
|---|---|
![]() |
![]() |
How to set up and validate locally
- Find or create a project with merge requests
- Add labels to a merge request
- Visit
http://gdk.test:3000/api/v4/projects/<project_id>/merge_requests - You should see
labelsfield to contain a list of strings. - Visit
http://gdk.test:3000/api/v4/projects/<project_id>/merge_requests?with_labels_details=true - You should see
labelsfield to contain with a list of hashes.
Edited by Vasilii Iakliushin

