Commit ebb9f2ce authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch 'mj/danger-single-codebase' into 'master'

Edit gitlab danger to account for single codebase

See merge request gitlab-org/gitlab!17354
parents 6f1bf83a d8787142
...@@ -122,5 +122,4 @@ ...@@ -122,5 +122,4 @@
.only-ee: .only-ee:
only: only:
variables: variables:
- $CI_PROJECT_NAME == "gitlab-ee" - $CI_PROJECT_NAME == "gitlab"
- $CI_PROJECT_NAME == "gitlab" # New name of gitlab-ee after the single codebase migration
...@@ -35,7 +35,7 @@ module Gitlab ...@@ -35,7 +35,7 @@ module Gitlab
end end
def ee? def ee?
ENV['CI_PROJECT_NAME'] == 'gitlab-ee' || File.exist?('../../CHANGELOG-EE.md') ENV['CI_PROJECT_NAME'] == 'gitlab' || File.exist?('../../CHANGELOG-EE.md')
end end
def gitlab_helper def gitlab_helper
...@@ -52,7 +52,7 @@ module Gitlab ...@@ -52,7 +52,7 @@ module Gitlab
end end
def project_name def project_name
ee? ? 'gitlab-ee' : 'gitlab-ce' ee? ? 'gitlab' : 'gitlab-foss'
end end
def markdown_list(items) def markdown_list(items)
......
...@@ -86,8 +86,8 @@ describe Gitlab::Danger::Helper do ...@@ -86,8 +86,8 @@ describe Gitlab::Danger::Helper do
describe '#ee?' do describe '#ee?' do
subject { helper.ee? } subject { helper.ee? }
it 'returns true if CI_PROJECT_NAME if set to gitlab-ee' do it 'returns true if CI_PROJECT_NAME if set to gitlab' do
stub_env('CI_PROJECT_NAME', 'gitlab-ee') stub_env('CI_PROJECT_NAME', 'gitlab')
expect(File).not_to receive(:exist?) expect(File).not_to receive(:exist?)
is_expected.to be_truthy is_expected.to be_truthy
...@@ -118,16 +118,16 @@ describe Gitlab::Danger::Helper do ...@@ -118,16 +118,16 @@ describe Gitlab::Danger::Helper do
describe '#project_name' do describe '#project_name' do
subject { helper.project_name } subject { helper.project_name }
it 'returns gitlab-ee if ee? returns true' do it 'returns gitlab if ee? returns true' do
expect(helper).to receive(:ee?) { true } expect(helper).to receive(:ee?) { true }
is_expected.to eq('gitlab-ee') is_expected.to eq('gitlab')
end end
it 'returns gitlab-ce if ee? returns false' do it 'returns gitlab-ce if ee? returns false' do
expect(helper).to receive(:ee?) { false } expect(helper).to receive(:ee?) { false }
is_expected.to eq('gitlab-ce') is_expected.to eq('gitlab-foss')
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