Reduce nested #capture_git_error calls on Wiki
requested to merge gitlab-community/gitlab:468185-dcf-wiki-refactor-to-reduce-nested-capture_git_error-calls into master
-
Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA
What does this MR do and why?
This MR refactors the wiki model to make #capture_git_error
private in order to solve the problem raised in the issue #468185:
As far as I could see in the code base, I still think that we can make the
#capture_git_error
private, as it being used outside of theWikiPage
seems like a leak of internals IMHO. This should be quite straightforward because:
- Currently,
WikiPages::CreateService
callspage.create
from within acapture_git_error
, but thepage.create
already uses thecapture_git_error
internally, so I don't see a reason why we're using it twice.- Same thing happens on
WikiPages::UpdateService
, it's callingpage.update
from within acapture_git_error
, but thepage.update
already calls thecapture_git_error
internally, therefore I think we can remove the external call as well.
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.
Edited by Dannyel Cardoso da Fonseca