Resolve "Appearance uploader fields and description HTML are missing in cached version"
What does this MR do?
This reverts to caching the AR object in CacheableAttributes
since caching
the attributes as JSON and manually instantiating the record ended-up very
complex since the edge-cases such as upload fields, serialized fields, and
fields with custom accessors had to be handled.
I first tried a few different strategies and even managed to have a green pipeline but I wasn't very:
- happy with the workarounds needed (for example, when using
.new
, we had to manually populate upload attributes: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/19203/diffs?diff_id=15285519) - very confident that I was handling all the edge-cases (the good thing is that I've added tests for them now)
Reverting back to caching the AR object instead put us back in a known state since that's what we were doing before https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/18754.
Are there points in the code the reviewer needs to double check?
To ensure 3 points out of 4 are checked from https://gitlab.com/gitlab-org/gitlab-ce/issues/45175 we now include the Rails version in the cache key.
Why was this MR needed?
Because https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/18754 introduced a few regressions.
Does this MR meet the acceptance criteria?
-
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 -
End-to-end tests pass ( package-and-qa
manual pipeline job)
What are the relevant issue numbers?
Closes #46913 (closed)