Skip to content

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

  1. Trim/remove the huge payload (content) completely
  2. "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)

This MR chose option number 2 as discussed in this comment

Caveats

  1. 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:

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
Screenshot_2024-03-08_at_15.13.20 Screenshot_2024-03-08_at_15.15.28

How to set up and validate locally

  1. 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 example 100000
  2. Create a project wiki, for example http://127.0.0.1:3000/gitlab-org/gitlab-test/-/wikis/home. Add a huge content.
  3. Click the Create Page button. You should not see any error

Related to #367628 (closed)

Edited by Ivan Sebastian

Merge request reports