Commit 7a42d865 authored by Douwe Maan's avatar Douwe Maan

Merge branch 'zj-gitaly-license-detection' into 'master'

License detection happens solely through Gitaly now

Closes gitaly#1026

See merge request gitlab-org/gitlab-ce!19986
parents 05474b35 da8419a1
...@@ -1054,18 +1054,8 @@ module Gitlab ...@@ -1054,18 +1054,8 @@ module Gitlab
end end
def license_short_name def license_short_name
gitaly_migrate(:license_short_name, wrapped_gitaly_errors do
status: Gitlab::GitalyClient::MigrationStatus::OPT_OUT) do |is_enabled|
if is_enabled
gitaly_repository_client.license_short_name gitaly_repository_client.license_short_name
else
begin
# The licensee gem creates a Rugged object from the path:
# https://github.com/benbalter/licensee/blob/v8.7.0/lib/licensee/projects/git_project.rb
Licensee.license(path).try(:key)
rescue Rugged::Error
end
end
end end
end end
......
...@@ -1727,7 +1727,6 @@ describe Gitlab::Git::Repository, seed_helper: true do ...@@ -1727,7 +1727,6 @@ describe Gitlab::Git::Repository, seed_helper: true do
end end
describe '#license_short_name' do describe '#license_short_name' do
shared_examples 'acquiring the Licensee license key' do
subject { repository.license_short_name } subject { repository.license_short_name }
context 'when no license file can be found' do context 'when no license file can be found' do
...@@ -1746,15 +1745,6 @@ describe Gitlab::Git::Repository, seed_helper: true do ...@@ -1746,15 +1745,6 @@ describe Gitlab::Git::Repository, seed_helper: true do
end end
end end
context 'when gitaly is enabled' do
it_behaves_like 'acquiring the Licensee license key'
end
context 'when gitaly is disabled', :disable_gitaly do
it_behaves_like 'acquiring the Licensee license key'
end
end
describe '#with_repo_branch_commit' do describe '#with_repo_branch_commit' do
context 'when comparing with the same repository' do context 'when comparing with the same repository' do
let(:start_repository) { repository } let(:start_repository) { repository }
......
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