Adjust wiki content for background job
What does this MR do and why?
Problems
When a "project wiki page" is submitted, it might raise an error (redirected to the error page) when Sidekiq job size limits are set. This happens when the payload (logically, it happens on the content
payload) exceeds the configured Sidekiq job size limits.
Solutions
- Trim/remove the huge payload (
content
) completely - "Lazy load" the huge payload (
content
). In short:- Upon submission to the background job (Sidekiq), we exclude the
content
- Then, upon processing the background job, we load the
content
(using an identifier)
- Upon submission to the background job (Sidekiq), we exclude the
This MR chose option number 2 as discussed in this comment
Caveats
-
absolute_image_urls
has not been handled yet. It doesn't work properly anyway. I tested it on my private gitlab.com (I'll submit an issue). See the generated URL when I receive it via webhook:- (generated) https://gitlab.com/uploads/b25a2d32924977205d45754ca6357c9b/Screenshot_2024-03-08_at_08.52.54.png
- (the correct one supposed to be. Notice the missing
/-/wikis
) https://gitlab.com/ivantedja/blessing/-/wikis/uploads/b25a2d32924977205d45754ca6357c9b/Screenshot_2024-03-08_at_08.52.54.png
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
- Adjust Sidekiq job size limits in
http://127.0.0.1:3000/admin/application_settings/preferences
(Admin Area > Settings > Preferences > Sidekiq job size limits > Sidekiq job size limit (bytes)). Set for example100000
- Create a project wiki, for example
http://127.0.0.1:3000/gitlab-org/gitlab-test/-/wikis/home
. Add a huge content. - Click the
Create Page
button. You should not see any error
Related to #367628 (closed)
Edited by Ivan Sebastian