Ensure ApplicationSetting#performance_bar_allowed_group_id is properly set when retrieved from cache
What does this MR do?
This removes the custom setters #performance_bar_allowed_group_id=
and #performance_bar_enabled=
from ApplicationSetting
since that was creating issues now that we cache the attributes as JSON in Redis.
I think moving the "casting" from the model to the service layer is the right move, since the model shouldn't care that the UI/API accept a group path instead of a group ID.
I've also taken the opportunity to add comprehensive tests and that allowed me to simplify the logic a lot.
Are there points in the code the reviewer needs to double check?
I don't think so, the controller and the API are using the UpdateService
so we're good.
Why was this MR needed?
Because since we had a custom #performance_bar_allowed_group_id=
setter, we tried to find the allowed group with find_by_full_path
but in that case performance_bar_allowed_group_id
was already a group ID, not a group path!
Screenshots (if relevant)
Does this MR meet the acceptance criteria?
- [-] Changelog entry added, if necessary
-
Documentation created/updated -
API support added -
Tests added for this feature/bug - Conform by the code review guidelines
-
Has been reviewed by a Backend maintainer
-
-
Conform by the merge request performance guides -
Conform by the style guides -
If you have multiple commits, please combine them into a few logically organized commits by squashing them -
Internationalization required/considered -
End-to-end tests pass ( package-and-qa
manual pipeline job)
What are the relevant issue numbers?
Fixes #46758 (closed).