Batchload blobs for diff generation
After installing a new gem, batch-loader, a construct can be used to queue data to be fetched in bulk. The gem was also introduced in both gitlab-org/gitlab-ce!14680 and gitlab-org/gitlab-ce!14846, but those mrs are not merged yet. For the generation of diffs, both the old blob and the new blob need to be loaded. This for every file in the diff, too. Now we collect all these so we do 1 fetch. Three `.allow_n_plus_1_calls` have been removed, which I expect to be valid, but this needs to be confirmed by a full CI run. Possibly closes: - https://gitlab.com/gitlab-org/gitlab-ce/issues/37445 - https://gitlab.com/gitlab-org/gitlab-ce/issues/37599 - https://gitlab.com/gitlab-org/gitlab-ce/issues/37431
显示
- Gemfile 2 个添加, 0 个删除Gemfile
- Gemfile.lock 2 个添加, 0 个删除Gemfile.lock
- app/controllers/projects/commit_controller.rb 2 个添加, 7 个删除app/controllers/projects/commit_controller.rb
- app/controllers/projects/merge_requests/diffs_controller.rb 1 个添加, 4 个删除app/controllers/projects/merge_requests/diffs_controller.rb
- app/models/blob.rb 16 个添加, 1 个删除app/models/blob.rb
- app/models/commit.rb 2 个添加, 2 个删除app/models/commit.rb
- app/models/repository.rb 5 个添加, 0 个删除app/models/repository.rb
- changelogs/unreleased/zj-commit-show-n-1.yml 5 个添加, 0 个删除changelogs/unreleased/zj-commit-show-n-1.yml
- config/initializers/batch_loader.rb 1 个添加, 0 个删除config/initializers/batch_loader.rb
- lib/gitlab/diff/file.rb 8 个添加, 10 个删除lib/gitlab/diff/file.rb
- lib/gitlab/diff/file_collection/base.rb 1 个添加, 4 个删除lib/gitlab/diff/file_collection/base.rb
- lib/gitlab/git/blob.rb 2 个添加, 0 个删除lib/gitlab/git/blob.rb
- lib/gitlab/git/repository.rb 5 个添加, 0 个删除lib/gitlab/git/repository.rb
- spec/controllers/projects/commit_controller_spec.rb 3 个添加, 3 个删除spec/controllers/projects/commit_controller_spec.rb
- spec/lib/gitlab/diff/file_spec.rb 2 个添加, 6 个删除spec/lib/gitlab/diff/file_spec.rb
- spec/models/blob_spec.rb 17 个添加, 0 个删除spec/models/blob_spec.rb
- spec/models/diff_viewer/base_spec.rb 8 个添加, 14 个删除spec/models/diff_viewer/base_spec.rb
- spec/models/diff_viewer/server_side_spec.rb 4 个添加, 5 个删除spec/models/diff_viewer/server_side_spec.rb
加载中
想要评论请 注册 或 登录