Fix comments lost when moving wiki page
What does this MR do and why?
This reverts 80a70aa6, which introduced a regression bug that caused wiki pages to lose comments when updating a wiki page to move it to a new path. This happened, because on update the old path wasn't resolved correctly and a new WikiPage::Meta record was created, because the existing one tied to the old path couldn't be found.
This also fixes a bug in Git::WikiPushService, where path file extensions wouldn't strip properly for sub-directory wiki page paths, which also contributed to not resolving the correct path for the page.
Added specs to guard against the regression.
References
Screenshots or screen recordings
| Before | After |
|---|---|
How to set up and validate locally
- Create a new wiki page.
- Add a comment and update the page changing it's path - not only the name itself, but the sub-directory it's in.
- The comments should be moved with the page in all examples.
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