Skip to content

Fix absolute_image_urls for wiki path

What does this MR do and why?

When a project wiki webhook is triggered with an uploaded image URL inside the description, the sent payload does not contain the proper absolute image URL.

There are 2 issues:

  1. Conditional to add uploads_prefix is not called. It is because uploading in wiki is prefixed by uploads (instead of /uploads). TBH, I don't know yet how it historically happened
  2. The uploaded image in wiki has /-/wikis/ on the URL. We can use wiki_page.wiki.wiki_base_path to generate that

Linked MR(s) for Reference

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-25_at_23.30.11 Screenshot_2024-03-25_at_23.57.32

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Create a project webhook: [Go to your project] > Settings > Webhooks > Add new webhook > tick "Wiki page events"
  2. Create or edit a project wiki: [Go to your project] > Plan > Wiki
  3. Upload an image to the description
  4. Click "Create Page"
  5. Check the sent payload on your configured server on point 1

Related to #448980 (closed)

Merge request reports