Skip to content

Fix recursive wiki page redirects

What does this MR do and why?

In wikis, when we rename a sub-page in a hierarchy of pages, every page under it should be renamed as well. Under the hood in the wiki git repository, the folder holding all the children sub-pages gets renamed.

Currently it's possible to get into an infinite redirect loop for wiki pages when we rename foo to foo/bar. To hold true to the above behavior, we iterate through foo/bar again, considering first foo and foo/bar for redirection. We encounter foo again, and make the path foo/bar/bar, and so on.

This MR changes the redirection logic so that we don't replace the sub-pages that we've already encountered and prevent the loop.

References

Screenshots or screen recordings

Before After

How to set up and validate locally

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Piotr Skorupa

Merge request reports

Loading