Commit 163ba813 authored by Dylan Griffith's avatar Dylan Griffith

Merge branch 'pks-ff-drop-list-commits' into 'master'

Remove `:list_commits` feature flag

See merge request gitlab-org/gitlab!66741
parents 9a177f6a e8a98485
---
name: list_commits
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/65468
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/335208
milestone: '14.1'
type: development
group: group::gitaly
default_enabled: false
...@@ -356,11 +356,7 @@ module Gitlab ...@@ -356,11 +356,7 @@ module Gitlab
def new_commits(newrevs) def new_commits(newrevs)
wrapped_gitaly_errors do wrapped_gitaly_errors do
if Feature.enabled?(:list_commits) gitaly_commit_client.list_commits(Array.wrap(newrevs) + %w[--not --all])
gitaly_commit_client.list_commits(Array.wrap(newrevs) + %w[--not --all])
else
Array.wrap(newrevs).flat_map { |newrev| gitaly_ref_client.list_new_commits(newrev) }
end
end end
end end
......
...@@ -62,24 +62,6 @@ module Gitlab ...@@ -62,24 +62,6 @@ module Gitlab
encode!(response.name.dup) encode!(response.name.dup)
end end
def list_new_commits(newrev)
request = Gitaly::ListNewCommitsRequest.new(
repository: @gitaly_repo,
commit_id: newrev
)
commits = []
response = GitalyClient.call(@storage, :ref_service, :list_new_commits, request, timeout: GitalyClient.medium_timeout)
response.each do |msg|
msg.commits.each do |c|
commits << Gitlab::Git::Commit.new(@repository, c)
end
end
commits
end
def list_new_blobs(newrev, limit = 0, dynamic_timeout: nil) def list_new_blobs(newrev, limit = 0, dynamic_timeout: nil)
request = Gitaly::ListNewBlobsRequest.new( request = Gitaly::ListNewBlobsRequest.new(
repository: @gitaly_repo, repository: @gitaly_repo,
......
...@@ -950,44 +950,23 @@ RSpec.describe Gitlab::Git::Repository, :seed_helper do ...@@ -950,44 +950,23 @@ RSpec.describe Gitlab::Git::Repository, :seed_helper do
let(:expected_commits) { 1 } let(:expected_commits) { 1 }
let(:revisions) { [new_commit] } let(:revisions) { [new_commit] }
shared_examples 'an enumeration of new commits' do before do
it 'enumerates commits' do expect_next_instance_of(Gitlab::GitalyClient::CommitService) do |service|
commits = repository.new_commits(revisions).to_a expect(service)
.to receive(:list_commits)
expect(commits.size).to eq(expected_commits) .with([new_commit, '--not', '--all'])
commits.each do |commit| .and_call_original
expect(commit.id).to eq(new_commit)
expect(commit.message).to eq("Message")
end
end end
end end
context 'with list_commits disabled' do it 'enumerates commits' do
before do commits = repository.new_commits(revisions).to_a
stub_feature_flags(list_commits: false)
expect_next_instance_of(Gitlab::GitalyClient::RefService) do |service| expect(commits.size).to eq(expected_commits)
expect(service) commits.each do |commit|
.to receive(:list_new_commits) expect(commit.id).to eq(new_commit)
.with(new_commit) expect(commit.message).to eq("Message")
.and_call_original
end
end end
it_behaves_like 'an enumeration of new commits'
end
context 'with list_commits enabled' do
before do
expect_next_instance_of(Gitlab::GitalyClient::CommitService) do |service|
expect(service)
.to receive(:list_commits)
.with([new_commit, '--not', '--all'])
.and_call_original
end
end
it_behaves_like 'an enumeration of new commits'
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment