diff options
author | Rémy Coutable <remy@rymai.me> | 2019-03-19 09:36:05 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2019-03-19 09:36:05 +0000 |
commit | 20f4815ebf144816d899b34298e1ad9f1381dfda (patch) | |
tree | 9311131e3b73deb1ef999c416a0661571b158175 | |
parent | afeb2dd98e4a32a4f5355a59c6db1e599707e9c2 (diff) | |
download | gitlab-ce-20f4815ebf144816d899b34298e1ad9f1381dfda.tar.gz |
Revert "Merge branch..."
This reverts merge request !26183
-rw-r--r-- | app/models/repository.rb | 11 | ||||
-rw-r--r-- | lib/gitlab/file_detector.rb | 1 | ||||
-rw-r--r-- | spec/lib/gitlab/file_detector_spec.rb | 4 | ||||
-rw-r--r-- | spec/models/repository_spec.rb | 23 |
4 files changed, 3 insertions, 36 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb index 0d60b5a6434..ff355295862 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -39,8 +39,7 @@ class Repository changelog license_blob license_key gitignore gitlab_ci_yml branch_names tag_names branch_count tag_count avatar exists? root_ref has_visible_content? - issue_template_names merge_request_template_names xcode_project? - insights_config).freeze + issue_template_names merge_request_template_names xcode_project?).freeze # Methods that use cache_method but only memoize the value MEMOIZED_CACHED_METHODS = %i(license).freeze @@ -58,8 +57,7 @@ class Repository avatar: :avatar, issue_template: :issue_template_names, merge_request_template: :merge_request_template_names, - xcode_config: :xcode_project?, - insights_config: :insights_config + xcode_config: :xcode_project? }.freeze def initialize(full_path, project, disk_path: nil, is_wiki: false) @@ -665,11 +663,6 @@ class Repository end cache_method :xcode_project? - def insights_config - file_on_head(:insights_config) - end - cache_method :insights_config - def head_commit @head_commit ||= commit(self.root_ref) end diff --git a/lib/gitlab/file_detector.rb b/lib/gitlab/file_detector.rb index 4678ef792c0..2770469ca9f 100644 --- a/lib/gitlab/file_detector.rb +++ b/lib/gitlab/file_detector.rb @@ -22,7 +22,6 @@ module Gitlab gitignore: '.gitignore', gitlab_ci: '.gitlab-ci.yml', route_map: '.gitlab/route-map.yml', - insights_config: '.gitlab/insights.yml', # Dependency files cartfile: %r{\ACartfile[^/]*\z}, diff --git a/spec/lib/gitlab/file_detector_spec.rb b/spec/lib/gitlab/file_detector_spec.rb index 933366fd855..4ba9094b24e 100644 --- a/spec/lib/gitlab/file_detector_spec.rb +++ b/spec/lib/gitlab/file_detector_spec.rb @@ -77,10 +77,6 @@ describe Gitlab::FileDetector do expect(described_class.type_of('.gitlab/merge_request_templates/foo.md')).to eq(:merge_request_template) end - it 'returns the type of an Insights config file' do - expect(described_class.type_of('.gitlab/insights.yml')).to eq(:insights_config) - end - it 'returns nil for an unknown file' do expect(described_class.type_of('foo.txt')).to be_nil end diff --git a/spec/models/repository_spec.rb b/spec/models/repository_spec.rb index 759dcd22b42..6599b4e765a 100644 --- a/spec/models/repository_spec.rb +++ b/spec/models/repository_spec.rb @@ -1616,8 +1616,7 @@ describe Repository do :has_visible_content?, :issue_template_names, :merge_request_template_names, - :xcode_project?, - :insights_config + :xcode_project? ]) repository.after_change_head @@ -1883,26 +1882,6 @@ describe Repository do end end - describe "#insights_config", :use_clean_rails_memory_store_caching do - it 'returns a valid Insights config file' do - files = [TestBlob.new('file'), TestBlob.new('.gitlab/insights.yml')] - - expect(repository.tree).to receive(:blobs).and_return(files) - expect(repository.insights_config.path).to eq('.gitlab/insights.yml') - end - - it 'returns nil if does not exist' do - expect(repository.tree).to receive(:blobs).and_return([]) - expect(repository.insights_config).to be_nil - end - - it 'returns nil for an empty repository' do - allow(repository).to receive(:root_ref).and_raise(Gitlab::Git::Repository::NoRepository) - - expect(repository.insights_config).to be_nil - end - end - describe "#keep_around" do it "does not fail if we attempt to reference bad commit" do expect(repository.kept_around?('abc1234')).to be_falsey |