Fix stale MR discussion cache when author role changes
What does this MR do?
Currently, when MR discussion is cached and the author's role has changed (e.g. Developer to Guest), the role pill and some actions will show as enabled (e.g. being able to resolve a discussion but it'll not actually work).
This fix adds the max access of author to the cache key so when it changes, the cache will be invalidated too.
No changelog entry as this feature is behind a feature flag.
How to setup and validate locally (strongly suggested)
- Enabled the merge_request_discussion_cache feature flag.
- As maintainer A, start a discussion thread on a MR.
- As maintainer B, change the role of the maintainer A to Guest.
- As maintainer A, reload the MR you previously commented on. Should see updated role pill ("Guest" instead of "Maintainer") and shouldn't be able to resolve thread too.
Does this MR meet the acceptance criteria?
Conformity
-
I have self-reviewed this MR per code review guidelines. -
This MR does not harm performance, or I have asked a reviewer to help assess the performance impact. (Merge request performance guidelines) -
I have followed the style guides. -
This change is backwards compatible across updates, or this does not apply.
Availability and Testing
-
I have added/updated tests following the Testing Guide, or it's not needed. (Consider all test levels. See the Test Planning Process.)
Related to #339097 (closed)