diff options
-rw-r--r-- | config/feature_flags/development/git_access_batched_changes_size.yml | 8 | ||||
-rw-r--r-- | lib/gitlab/git_access.rb | 17 | ||||
-rw-r--r-- | qa/Gemfile | 4 | ||||
-rw-r--r-- | qa/qa/runtime/browser.rb | 1 | ||||
-rw-r--r-- | qa/qa/runtime/env.rb | 4 | ||||
-rw-r--r-- | qa/qa/specs/features/api/1_manage/import_large_github_repo_spec.rb | 142 | ||||
-rw-r--r-- | qa/spec/support/matchers/eventually_matcher.rb | 4 | ||||
-rw-r--r-- | spec/features/projects/blobs/blob_show_spec.rb | 452 | ||||
-rw-r--r-- | spec/lib/gitlab/git_access_snippet_spec.rb | 19 |
9 files changed, 572 insertions, 79 deletions
diff --git a/config/feature_flags/development/git_access_batched_changes_size.yml b/config/feature_flags/development/git_access_batched_changes_size.yml deleted file mode 100644 index 881ffcad5f1..00000000000 --- a/config/feature_flags/development/git_access_batched_changes_size.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: git_access_batched_changes_size -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/64503 -rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/334130 -milestone: '14.1' -type: development -group: group::gitaly -default_enabled: false diff --git a/lib/gitlab/git_access.rb b/lib/gitlab/git_access.rb index 642a77ced11..759c6b93d9a 100644 --- a/lib/gitlab/git_access.rb +++ b/lib/gitlab/git_access.rb @@ -498,21 +498,10 @@ module Gitlab end def check_changes_size - changes_size = - if Feature.enabled?(:git_access_batched_changes_size, project, default_enabled: :yaml) - revs = ['--not', '--all', '--not'] - revs += changes_list.map { |change| change[:newrev] } + revs = ['--not', '--all', '--not'] + revs += changes_list.map { |change| change[:newrev] } - repository.blobs(revs).sum(&:size) - else - changes_size = 0 - - changes_list.each do |change| - changes_size += repository.new_blobs(change[:newrev]).sum(&:size) - end - - changes_size - end + changes_size = repository.blobs(revs).sum(&:size) check_size_against_limit(changes_size) end diff --git a/qa/Gemfile b/qa/Gemfile index 4a47e43d557..aef75b16089 100644 --- a/qa/Gemfile +++ b/qa/Gemfile @@ -22,8 +22,8 @@ gem 'rotp', '~> 3.1.0' gem 'timecop', '~> 0.9.1' gem 'parallel', '~> 1.19' gem 'rspec-parameterized', '~> 0.4.2' -gem "octokit", "~> 4.21" -gem "webdrivers", "~> 4.6" +gem 'octokit', '~> 4.21' +gem 'webdrivers', '~> 4.6' gem 'chemlab', '~> 0.7' gem 'chemlab-library-www-gitlab-com', '~> 0.1' diff --git a/qa/qa/runtime/browser.rb b/qa/qa/runtime/browser.rb index e13061e2648..3844c54f4db 100644 --- a/qa/qa/runtime/browser.rb +++ b/qa/qa/runtime/browser.rb @@ -143,6 +143,7 @@ module QA if QA::Runtime::Env.remote_grid selenium_options[:url] = QA::Runtime::Env.remote_grid capabilities[:browserVersion] = 'latest' + capabilities['sauce:options'] = { tunnelIdentifier: QA::Runtime::Env.remote_tunnel_id } end Capybara::Selenium::Driver.new( diff --git a/qa/qa/runtime/env.rb b/qa/qa/runtime/env.rb index 5cac811d95b..a076d8db9e0 100644 --- a/qa/qa/runtime/env.rb +++ b/qa/qa/runtime/env.rb @@ -142,6 +142,10 @@ module QA ENV['QA_REMOTE_GRID_PROTOCOL'] || 'http' end + def remote_tunnel_id + ENV['QA_REMOTE_TUNNEL_ID'] || 'gitlab-sl_tunnel_id' + end + def browser ENV['QA_BROWSER'].nil? ? :chrome : ENV['QA_BROWSER'].to_sym end diff --git a/qa/qa/specs/features/api/1_manage/import_large_github_repo_spec.rb b/qa/qa/specs/features/api/1_manage/import_large_github_repo_spec.rb index 22917d0d146..68afa64df6e 100644 --- a/qa/qa/specs/features/api/1_manage/import_large_github_repo_spec.rb +++ b/qa/qa/specs/features/api/1_manage/import_large_github_repo_spec.rb @@ -8,6 +8,9 @@ module QA # Only executes in custom job/pipeline RSpec.describe 'Manage', :github, :requires_admin, only: { job: 'large-github-import' } do describe 'Project import' do + let(:logger) { Runtime::Logger.logger } + let(:differ) { RSpec::Support::Differ.new(color: true) } + let(:api_client) { Runtime::API::Client.as_admin } let(:group) do Resource::Group.fabricate_via_api! do |resource| @@ -22,12 +25,10 @@ module QA end end - let(:differ) { RSpec::Support::Differ.new(color: true) } - let(:github_repo) { 'allure-framework/allure-ruby' } - + let(:github_repo) { 'rspec/rspec-core' } let(:github_client) do Octokit.middleware = Faraday::RackBuilder.new do |builder| - builder.response(:logger, Runtime::Logger.logger, headers: false, bodies: false) + builder.response(:logger, logger, headers: false, bodies: false) end Octokit::Client.new(access_token: Runtime::Env.github_access_token, auto_paginate: true) @@ -36,8 +37,16 @@ module QA let(:gh_branches) { github_client.branches(github_repo).map(&:name) } let(:gh_commits) { github_client.commits(github_repo).map(&:sha) } let(:gh_repo) { github_client.repository(github_repo) } - let(:gh_labels) { github_client.labels(github_repo) } - let(:gh_milestones) { github_client.list_milestones(github_repo, state: 'all') } + + let(:gh_labels) do + github_client.labels(github_repo).map { |label| { name: label.name, color: "##{label.color}" } } + end + + let(:gh_milestones) do + github_client + .list_milestones(github_repo, state: 'all') + .map { |ms| { title: ms.title, description: ms.description } } + end let(:gh_all_issues) do github_client.list_issues(github_repo, state: 'all') @@ -88,6 +97,31 @@ module QA group.add_member(user, Resource::Members::AccessLevel::MAINTAINER) end + after do + # save data for comparison after run finished + save_json( + "data", + { + github: { + branches: gh_branches, + commits: gh_commits, + labels: gh_labels, + milestones: gh_milestones, + prs: gh_prs, + issues: gh_issues + }, + gitlab: { + branches: gl_branches, + commits: gl_commits, + labels: gl_labels, + milestones: gl_milestones, + mrs: mrs, + issues: gl_issues + } + }.to_json + ) + end + it 'imports large Github repo via api' do imported_project # import the project fetch_github_objects # fetch all objects right after import has started @@ -99,10 +133,10 @@ module QA aggregate_failures do verify_repository_import - verify_merge_requests_import - verify_issues_import verify_labels_import verify_milestones_import + verify_merge_requests_import + verify_issues_import end end @@ -110,7 +144,7 @@ module QA # # @return [void] def fetch_github_objects - Runtime::Logger.debug("Fetching objects for github repo: '#{github_repo}'") + logger.debug("Fetching objects for github repo: '#{github_repo}'") gh_repo gh_branches @@ -125,50 +159,44 @@ module QA # # @return [void] def verify_repository_import - branches = imported_project.repository_branches(auto_paginate: true).map { |b| b[:name] } - commits = imported_project.commits(auto_paginate: true).map { |c| c[:id] } - + logger.debug("Verifying repository import") expect(imported_project.description).to eq(gh_repo.description) # check via include, importer creates more branches # https://gitlab.com/gitlab-org/gitlab/-/issues/332711 - expect(branches).to include(*gh_branches) - expect(commits).to match_array(gh_commits) + expect(gl_branches).to include(*gh_branches) + expect(gl_commits).to match_array(gh_commits) end # Verify imported merge requests and mr issues # # @return [void] def verify_merge_requests_import - verify_mrs_or_issues('mrs') + logger.debug("Verifying merge request import") + verify_mrs_or_issues('mr') end # Verify imported issues and issue comments # # @return [void] def verify_issues_import - verify_mrs_or_issues('issues') + logger.debug("Verifying issue import") + verify_mrs_or_issues('issue') end # Verify imported labels # # @return [void] def verify_labels_import - labels = imported_project.labels(auto_paginate: true).map { |label| label.slice(:name, :color) } - actual_labels = gh_labels.map { |label| { name: label.name, color: "##{label.color}" } } - - expect(labels.length).to eq(actual_labels.length) - expect(labels).to match_array(actual_labels) + logger.debug("Verifying label import") + expect(gl_labels).to match_array(gh_labels) end # Verify milestones import # # @return [void] def verify_milestones_import - milestones = imported_project.milestones(auto_paginate: true).map { |ms| ms.slice(:title, :description) } - actual_milestones = gh_milestones.map { |ms| { title: ms.title, description: ms.description } } - - expect(milestones.length).to eq(actual_milestones.length) - expect(milestones).to match_array(actual_milestones) + logger.debug("Verifying milestones import") + expect(gl_milestones).to match_array(gh_milestones) end private @@ -179,11 +207,17 @@ module QA # @return [void] def verify_mrs_or_issues(type) msg = ->(title) { "expected #{type} with title '#{title}' to have" } - expected = type == 'mrs' ? mrs : gl_issues - actual = type == 'mrs' ? gh_prs : gh_issues + expected = type == 'mr' ? mrs : gl_issues + actual = type == 'mr' ? gh_prs : gh_issues - expect(expected.keys).to match_array(actual.keys) + # Compare length to have easy to read overview how many objects are missing + expect(expected.length).to( + eq(actual.length), + "Expected to contain same amount of #{type}s. Expected: #{expected.length}, actual: #{actual.length}" + ) actual.each do |title, actual_item| + logger.debug("Comparing #{type} with title '#{title}'") + expected_item = expected[title] expect(expected_item).to be_truthy, "#{msg.call(title)} been imported" @@ -191,7 +225,7 @@ module QA expect(expected_item[:body]).to( include(actual_item[:body]), - "#{msg.call(title)} same description. #{diff(expected_item[:body], actual_item[:body])}" + "#{msg.call(title)} same description. diff:\n#{differ.diff(expected_item[:body], actual_item[:body])}" ) expect(expected_item[:comments].length).to( eq(actual_item[:comments].length), @@ -201,14 +235,44 @@ module QA end end + # Imported project branches + # + # @return [Array] + def gl_branches + @gl_branches ||= imported_project.repository_branches(auto_paginate: true).map { |b| b[:name] } + end + + # Imported project commits + # + # @return [Array] + def gl_commits + @gl_commits ||= imported_project.commits(auto_paginate: true).map { |c| c[:id] } + end + + # Imported project labels + # + # @return [Array] + def gl_labels + @gl_labels ||= imported_project.labels(auto_paginate: true).map { |label| label.slice(:name, :color) } + end + + # Imported project milestones + # + # @return [<Type>] <description> + def gl_milestones + @gl_milestones ||= imported_project.milestones(auto_paginate: true).map { |ms| ms.slice(:title, :description) } + end + # Imported project merge requests # # @return [Hash] def mrs @mrs ||= begin + logger.debug("Fetching merge requests") imported_mrs = imported_project.merge_requests(auto_paginate: true) # fetch comments in parallel since we need to do it for each mr separately - mrs_hashes = Parallel.map(imported_mrs, in_processes: 5) do |mr| + logger.debug("Transforming merge request objects for comparison") + mrs_hashes = Parallel.map(imported_mrs) do |mr| resource = Resource::MergeRequest.init do |resource| resource.project = imported_project resource.iid = mr[:iid] @@ -239,9 +303,11 @@ module QA # @return [Hash] def gl_issues @gl_issues ||= begin + logger.debug("Fetching issues") imported_issues = imported_project.issues(auto_paginate: true) # fetch comments in parallel since we need to do it for each mr separately - issue_hashes = Parallel.map(imported_issues, in_processes: 5) do |issue| + logger.debug("Transforming issue objects for comparison") + issue_hashes = Parallel.map(imported_issues) do |issue| resource = Resource::Issue.init do |issue_resource| issue_resource.project = imported_project issue_resource.iid = issue[:iid] @@ -272,13 +338,13 @@ module QA body.gsub(/\*Created by: \S+\*\n\n/, "") end - # Diff of 2 objects + # Save json as file # - # @param [Object] actual - # @param [Object] expected - # @return [String] - def diff(actual, expected) - "diff:\n#{differ.diff(actual, expected)}" + # @param [String] name + # @param [String] json + # @return [void] + def save_json(name, json) + File.open("tmp/#{name}.json", "w") { |file| file.write(json) } end end end diff --git a/qa/spec/support/matchers/eventually_matcher.rb b/qa/spec/support/matchers/eventually_matcher.rb index 2de6598be4c..2b59b954102 100644 --- a/qa/spec/support/matchers/eventually_matcher.rb +++ b/qa/spec/support/matchers/eventually_matcher.rb @@ -53,11 +53,15 @@ module Matchers # @param [Symbol] expectation_name # @return [Boolean] def wait_and_check(actual, expectation_name) + attempt = 0 + QA::Support::Retrier.retry_until( max_attempts: @attempts, max_duration: @duration, sleep_interval: @interval || 0.5 ) do + QA::Runtime::Logger.debug("Evaluating expectation '#{operator_msg}', attempt: #{attempt += 1}") + public_send(expectation_name, actual) rescue RSpec::Expectations::ExpectationNotMetError, QA::Resource::ApiFabricator::ResourceNotFoundError false diff --git a/spec/features/projects/blobs/blob_show_spec.rb b/spec/features/projects/blobs/blob_show_spec.rb index 9e4cec200d4..b6b9a8ae962 100644 --- a/spec/features/projects/blobs/blob_show_spec.rb +++ b/spec/features/projects/blobs/blob_show_spec.rb @@ -1050,6 +1050,458 @@ RSpec.describe 'File blob', :js do end end end + + context 'when refactor_blob_viewer is disabled' do + before do + stub_feature_flags(refactor_blob_viewer: false) + end + + describe '.gitlab-ci.yml' do + before do + project.add_maintainer(project.creator) + + Files::CreateService.new( + project, + project.creator, + start_branch: 'master', + branch_name: 'master', + commit_message: "Add .gitlab-ci.yml", + file_path: '.gitlab-ci.yml', + file_content: File.read(Rails.root.join('spec/support/gitlab_stubs/gitlab_ci.yml')) + ).execute + + visit_blob('.gitlab-ci.yml') + end + + it 'displays an auxiliary viewer' do + aggregate_failures do + # shows that configuration is valid + expect(page).to have_content('This GitLab CI configuration is valid.') + + # shows a learn more link + expect(page).to have_link('Learn more') + end + end + end + + describe '.gitlab/route-map.yml' do + before do + project.add_maintainer(project.creator) + + Files::CreateService.new( + project, + project.creator, + start_branch: 'master', + branch_name: 'master', + commit_message: "Add .gitlab/route-map.yml", + file_path: '.gitlab/route-map.yml', + file_content: <<-MAP.strip_heredoc + # Team data + - source: 'data/team.yml' + public: 'team/' + MAP + ).execute + + visit_blob('.gitlab/route-map.yml') + end + + it 'displays an auxiliary viewer' do + aggregate_failures do + # shows that map is valid + expect(page).to have_content('This Route Map is valid.') + + # shows a learn more link + expect(page).to have_link('Learn more') + end + end + end + + describe '.gitlab/dashboards/custom-dashboard.yml' do + before do + project.add_maintainer(project.creator) + + Files::CreateService.new( + project, + project.creator, + start_branch: 'master', + branch_name: 'master', + commit_message: "Add .gitlab/dashboards/custom-dashboard.yml", + file_path: '.gitlab/dashboards/custom-dashboard.yml', + file_content: file_content + ).execute + end + + context 'with metrics_dashboard_exhaustive_validations feature flag off' do + before do + stub_feature_flags(metrics_dashboard_exhaustive_validations: false) + visit_blob('.gitlab/dashboards/custom-dashboard.yml') + end + + context 'valid dashboard file' do + let(:file_content) { File.read(Rails.root.join('config/prometheus/common_metrics.yml')) } + + it 'displays an auxiliary viewer' do + aggregate_failures do + # shows that dashboard yaml is valid + expect(page).to have_content('Metrics Dashboard YAML definition is valid.') + + # shows a learn more link + expect(page).to have_link('Learn more') + end + end + end + + context 'invalid dashboard file' do + let(:file_content) { "dashboard: 'invalid'" } + + it 'displays an auxiliary viewer' do + aggregate_failures do + # shows that dashboard yaml is invalid + expect(page).to have_content('Metrics Dashboard YAML definition is invalid:') + expect(page).to have_content("panel_groups: should be an array of panel_groups objects") + + # shows a learn more link + expect(page).to have_link('Learn more') + end + end + end + end + + context 'with metrics_dashboard_exhaustive_validations feature flag on' do + before do + stub_feature_flags(metrics_dashboard_exhaustive_validations: true) + visit_blob('.gitlab/dashboards/custom-dashboard.yml') + end + + context 'valid dashboard file' do + let(:file_content) { File.read(Rails.root.join('config/prometheus/common_metrics.yml')) } + + it 'displays an auxiliary viewer' do + aggregate_failures do + # shows that dashboard yaml is valid + expect(page).to have_content('Metrics Dashboard YAML definition is valid.') + + # shows a learn more link + expect(page).to have_link('Learn more') + end + end + end + + context 'invalid dashboard file' do + let(:file_content) { "dashboard: 'invalid'" } + + it 'displays an auxiliary viewer' do + aggregate_failures do + # shows that dashboard yaml is invalid + expect(page).to have_content('Metrics Dashboard YAML definition is invalid:') + expect(page).to have_content("root is missing required keys: panel_groups") + + # shows a learn more link + expect(page).to have_link('Learn more') + end + end + end + end + end + + context 'LICENSE' do + before do + visit_blob('LICENSE') + end + + it 'displays an auxiliary viewer' do + aggregate_failures do + # shows license + expect(page).to have_content('This project is licensed under the MIT License.') + + # shows a learn more link + expect(page).to have_link('Learn more', href: 'http://choosealicense.com/licenses/mit/') + end + end + end + + context '*.gemspec' do + before do + project.add_maintainer(project.creator) + + Files::CreateService.new( + project, + project.creator, + start_branch: 'master', + branch_name: 'master', + commit_message: "Add activerecord.gemspec", + file_path: 'activerecord.gemspec', + file_content: <<-SPEC.strip_heredoc + Gem::Specification.new do |s| + s.platform = Gem::Platform::RUBY + s.name = "activerecord" + end + SPEC + ).execute + + visit_blob('activerecord.gemspec') + end + + it 'displays an auxiliary viewer' do + aggregate_failures do + # shows names of dependency manager and package + expect(page).to have_content('This project manages its dependencies using RubyGems.') + + # shows a learn more link + expect(page).to have_link('Learn more', href: 'https://rubygems.org/') + end + end + end + + context 'CONTRIBUTING.md' do + before do + file_name = 'CONTRIBUTING.md' + + create_file(file_name, '## Contribution guidelines') + visit_blob(file_name) + end + + it 'displays an auxiliary viewer' do + aggregate_failures do + expect(page).to have_content("After you've reviewed these contribution guidelines, you'll be all set to contribute to this project.") + end + end + end + + context 'CHANGELOG.md' do + before do + file_name = 'CHANGELOG.md' + + create_file(file_name, '## Changelog for v1.0.0') + visit_blob(file_name) + end + + it 'displays an auxiliary viewer' do + aggregate_failures do + expect(page).to have_content("To find the state of this project's repository at the time of any of these versions, check out the tags.") + end + end + end + + context 'Cargo.toml' do + before do + file_name = 'Cargo.toml' + + create_file(file_name, ' + [package] + name = "hello_world" # the name of the package + version = "0.1.0" # the current version, obeying semver + authors = ["Alice <a@example.com>", "Bob <b@example.com>"] + ') + visit_blob(file_name) + end + + it 'displays an auxiliary viewer' do + aggregate_failures do + expect(page).to have_content("This project manages its dependencies using Cargo.") + end + end + end + + context 'Cartfile' do + before do + file_name = 'Cartfile' + + create_file(file_name, ' + gitlab "Alamofire/Alamofire" == 4.9.0 + gitlab "Alamofire/AlamofireImage" ~> 3.4 + ') + visit_blob(file_name) + end + + it 'displays an auxiliary viewer' do + aggregate_failures do + expect(page).to have_content("This project manages its dependencies using Carthage.") + end + end + end + + context 'composer.json' do + before do + file_name = 'composer.json' + + create_file(file_name, ' + { + "license": "MIT" + } + ') + visit_blob(file_name) + end + + it 'displays an auxiliary viewer' do + aggregate_failures do + expect(page).to have_content("This project manages its dependencies using Composer.") + end + end + end + + context 'Gemfile' do + before do + file_name = 'Gemfile' + + create_file(file_name, ' + source "https://rubygems.org" + + # Gems here + ') + visit_blob(file_name) + end + + it 'displays an auxiliary viewer' do + aggregate_failures do + expect(page).to have_content("This project manages its dependencies using Bundler.") + end + end + end + + context 'Godeps.json' do + before do + file_name = 'Godeps.json' + + create_file(file_name, ' + { + "GoVersion": "go1.6" + } + ') + visit_blob(file_name) + end + + it 'displays an auxiliary viewer' do + aggregate_failures do + expect(page).to have_content("This project manages its dependencies using godep.") + end + end + end + + context 'go.mod' do + before do + file_name = 'go.mod' + + create_file(file_name, ' + module example.com/mymodule + + go 1.14 + ') + visit_blob(file_name) + end + + it 'displays an auxiliary viewer' do + aggregate_failures do + expect(page).to have_content("This project manages its dependencies using Go Modules.") + end + end + end + + context 'package.json' do + before do + file_name = 'package.json' + + create_file(file_name, ' + { + "name": "my-awesome-package", + "version": "1.0.0" + } + ') + visit_blob(file_name) + end + + it 'displays an auxiliary viewer' do + aggregate_failures do + expect(page).to have_content("This project manages its dependencies using npm.") + end + end + end + + context 'podfile' do + before do + file_name = 'podfile' + + create_file(file_name, 'platform :ios, "8.0"') + visit_blob(file_name) + end + + it 'displays an auxiliary viewer' do + aggregate_failures do + expect(page).to have_content("This project manages its dependencies using CocoaPods.") + end + end + end + + context 'test.podspec' do + before do + file_name = 'test.podspec' + + create_file(file_name, ' + Pod::Spec.new do |s| + s.name = "TensorFlowLiteC" + ') + visit_blob(file_name) + end + + it 'displays an auxiliary viewer' do + aggregate_failures do + expect(page).to have_content("This project manages its dependencies using CocoaPods.") + end + end + end + + context 'JSON.podspec.json' do + before do + file_name = 'JSON.podspec.json' + + create_file(file_name, ' + { + "name": "JSON" + } + ') + visit_blob(file_name) + end + + it 'displays an auxiliary viewer' do + aggregate_failures do + expect(page).to have_content("This project manages its dependencies using CocoaPods.") + end + end + end + + context 'requirements.txt' do + before do + file_name = 'requirements.txt' + + create_file(file_name, 'Project requirements') + visit_blob(file_name) + end + + it 'displays an auxiliary viewer' do + aggregate_failures do + expect(page).to have_content("This project manages its dependencies using pip.") + end + end + end + + context 'yarn.lock' do + before do + file_name = 'yarn.lock' + + create_file(file_name, ' + # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + # yarn lockfile v1 + ') + visit_blob(file_name) + end + + it 'displays an auxiliary viewer' do + aggregate_failures do + expect(page).to have_content("This project manages its dependencies using Yarn.") + end + end + end + end end context 'realtime pipelines' do diff --git a/spec/lib/gitlab/git_access_snippet_spec.rb b/spec/lib/gitlab/git_access_snippet_spec.rb index 3b85e3ddd1d..d690a4b2db4 100644 --- a/spec/lib/gitlab/git_access_snippet_spec.rb +++ b/spec/lib/gitlab/git_access_snippet_spec.rb @@ -382,12 +382,11 @@ RSpec.describe Gitlab::GitAccessSnippet do it_behaves_like 'a push to repository to make it over the limit' end - shared_examples_for 'a change with GIT_OBJECT_DIRECTORY_RELATIVE env var unset' do + context 'a change with GIT_OBJECT_DIRECTORY_RELATIVE env var unset' do let(:change_size) { 200 } before do - stub_feature_flags(git_access_batched_changes_size: batched) - allow(snippet.repository).to receive(expected_call).and_return( + allow(snippet.repository).to receive(:blobs).and_return( [double(:blob, size: change_size)] ) end @@ -396,20 +395,6 @@ RSpec.describe Gitlab::GitAccessSnippet do it_behaves_like 'a push to repository below the limit' it_behaves_like 'a push to repository to make it over the limit' end - - context 'when batched computation is enabled' do - let(:batched) { true } - let(:expected_call) { :blobs } - - it_behaves_like 'a change with GIT_OBJECT_DIRECTORY_RELATIVE env var unset' - end - - context 'when batched computation is disabled' do - let(:batched) { false } - let(:expected_call) { :new_blobs } - - it_behaves_like 'a change with GIT_OBJECT_DIRECTORY_RELATIVE env var unset' - end end describe 'HEAD realignment' do |