Added list_pages method to avoid loading all wiki pages content
Inside a wiki, when we show the sidebar or browse to the `pages`, all page contents are retrieved from Gitaly and that is a waste of resources, since no content from that pages are going to be showed. This MR introduces the method `ProjectWiki#list_pages`, which uses new wiki_list_pages RPC call to retrieve pages without content Also in the `WikisController` we're using the method to show pages in the sidebar and also on the `pages` page.
显示
- Gemfile 1 个添加, 1 个删除Gemfile
- Gemfile.lock 2 个添加, 2 个删除Gemfile.lock
- app/controllers/projects/wikis_controller.rb 2 个添加, 2 个删除app/controllers/projects/wikis_controller.rb
- app/models/project_wiki.rb 15 个添加, 7 个删除app/models/project_wiki.rb
- app/services/test_hooks/project_service.rb 1 个添加, 1 个删除app/services/test_hooks/project_service.rb
- changelogs/unreleased/fj-53523-add-option-avoid-loading-wiki-page-content.yml 5 个添加, 0 个删除...d/fj-53523-add-option-avoid-loading-wiki-page-content.yml
- lib/api/wikis.rb 2 个添加, 1 个删除lib/api/wikis.rb
- lib/gitlab/git/wiki.rb 18 个添加, 6 个删除lib/gitlab/git/wiki.rb
- lib/gitlab/gitaly_client/wiki_service.rb 22 个添加, 1 个删除lib/gitlab/gitaly_client/wiki_service.rb
- spec/controllers/projects/wikis_controller_spec.rb 17 个添加, 5 个删除spec/controllers/projects/wikis_controller_spec.rb
- spec/lib/gitlab/git/wiki_spec.rb 8 个添加, 8 个删除spec/lib/gitlab/git/wiki_spec.rb
- spec/lib/gitlab/gitaly_client/wiki_service_spec.rb 3 个添加, 3 个删除spec/lib/gitlab/gitaly_client/wiki_service_spec.rb
- spec/models/project_wiki_spec.rb 58 个添加, 16 个删除spec/models/project_wiki_spec.rb
- spec/models/wiki_page_spec.rb 34 个添加, 32 个删除spec/models/wiki_page_spec.rb
加载中
想要评论请 注册 或 登录