Commit 5b10cf32 authored by Kamil Trzciński's avatar Kamil Trzciński

Merge branch '43818-move-external-inclusion-from-premium-to-starter' into 'master'

Move external files support from Premium to Starter

See merge request gitlab-org/gitlab-ee!4841
parents 01990196 0df39e32
...@@ -364,6 +364,7 @@ skip the download step. ...@@ -364,6 +364,7 @@ skip the download step.
### include ### include
> Introduced in [GitLab Edition Premium][ee] 10.5. > Introduced in [GitLab Edition Premium][ee] 10.5.
> Available for Starter, Premium and Ultimate [versions][gitlab-versions] since 10.6.
Using the `include` keyword, you can allow the inclusion of external YAML files. Using the `include` keyword, you can allow the inclusion of external YAML files.
...@@ -1755,4 +1756,4 @@ CI with various languages. ...@@ -1755,4 +1756,4 @@ CI with various languages.
[ce-7447]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7447 [ce-7447]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7447
[ce-3442]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/3442 [ce-3442]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/3442
[schedules]: ../../user/project/pipelines/schedules.md [schedules]: ../../user/project/pipelines/schedules.md
[ee]: https://about.gitlab.com/gitlab-ee/ [gitlab-versions]: https://about.gitlab.com/products/
...@@ -12,6 +12,7 @@ class License < ActiveRecord::Base ...@@ -12,6 +12,7 @@ class License < ActiveRecord::Base
contribution_analytics contribution_analytics
elastic_search elastic_search
export_issues export_issues
external_files_in_gitlab_ci
group_webhooks group_webhooks
issuable_default_templates issuable_default_templates
issue_board_focus_mode issue_board_focus_mode
...@@ -39,7 +40,6 @@ class License < ActiveRecord::Base ...@@ -39,7 +40,6 @@ class License < ActiveRecord::Base
db_load_balancing db_load_balancing
deploy_board deploy_board
extended_audit_events extended_audit_events
external_files_in_gitlab_ci
file_locks file_locks
geo geo
group_issue_boards group_issue_boards
......
---
title: Move support of external gitlab-ci files from Premium to Starter
merge_request: 4841
author:
type: added
...@@ -14,7 +14,7 @@ describe EE::Gitlab::Ci::Config do ...@@ -14,7 +14,7 @@ describe EE::Gitlab::Ci::Config do
end end
let(:config) { ::Gitlab::Ci::Config.new(gitlab_ci_yml, { project: project, sha: '12345' }) } let(:config) { ::Gitlab::Ci::Config.new(gitlab_ci_yml, { project: project, sha: '12345' }) }
context 'when the project does not have EEP license' do context 'when the project does not have a valid license' do
before do before do
allow(project).to receive(:feature_available?).with(:external_files_in_gitlab_ci).and_return(false) allow(project).to receive(:feature_available?).with(:external_files_in_gitlab_ci).and_return(false)
end end
...@@ -27,7 +27,7 @@ describe EE::Gitlab::Ci::Config do ...@@ -27,7 +27,7 @@ describe EE::Gitlab::Ci::Config do
end end
end end
context 'when the project has EEP license' do context 'when the project has a valid license' do
let(:remote_file_content) do let(:remote_file_content) do
<<~HEREDOC <<~HEREDOC
variables: variables:
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
describe EE::Gitlab::Ci::Pipeline::Chain::Limit::Size do describe EE::Gitlab::Ci::Pipeline::Chain::Limit::Size do
set(:namespace) { create(:namespace, plan: :gold_plan) } set(:namespace) { create(:namespace, plan: :gold_plan) }
set(:project) { create(:project, namespace: namespace) } set(:project) { create(:project, :repository, namespace: namespace) }
set(:user) { create(:user) } set(:user) { create(:user) }
let(:pipeline) do let(:pipeline) do
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
describe EE::Gitlab::Ci::Pipeline::Quota::Size do describe EE::Gitlab::Ci::Pipeline::Quota::Size do
set(:namespace) { create(:namespace, plan: :gold_plan) } set(:namespace) { create(:namespace, plan: :gold_plan) }
set(:project) { create(:project, namespace: namespace) } set(:project) { create(:project, :repository, namespace: namespace) }
let(:pipeline) { build_stubbed(:ci_pipeline, project: project) } let(:pipeline) { build_stubbed(:ci_pipeline, project: project) }
let(:limit) { described_class.new(namespace, pipeline) } let(:limit) { described_class.new(namespace, pipeline) }
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Pipeline::Chain::Create do describe Gitlab::Ci::Pipeline::Chain::Create do
set(:project) { create(:project) } set(:project) { create(:project, :repository) }
set(:user) { create(:user) } set(:user) { create(:user) }
let(:pipeline) do let(:pipeline) do
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Pipeline::Chain::Validate::Config do describe Gitlab::Ci::Pipeline::Chain::Validate::Config do
set(:project) { create(:project) } set(:project) { create(:project, :repository) }
set(:user) { create(:user) } set(:user) { create(:user) }
let(:command) do let(:command) do
......
...@@ -4,7 +4,7 @@ describe BlobViewer::GitlabCiYml do ...@@ -4,7 +4,7 @@ describe BlobViewer::GitlabCiYml do
include FakeBlobHelpers include FakeBlobHelpers
include RepoHelpers include RepoHelpers
let(:project) { build_stubbed(:project, :repository) } let(:project) { create(:project, :repository) }
let(:data) { File.read(Rails.root.join('spec/support/gitlab_stubs/gitlab_ci.yml')) } let(:data) { File.read(Rails.root.join('spec/support/gitlab_stubs/gitlab_ci.yml')) }
let(:blob) { fake_blob(path: '.gitlab-ci.yml', data: data) } let(:blob) { fake_blob(path: '.gitlab-ci.yml', data: data) }
let(:sha) { sample_commit.id } let(:sha) { sample_commit.id }
......
...@@ -1386,7 +1386,8 @@ describe Ci::Build do ...@@ -1386,7 +1386,8 @@ describe Ci::Build do
end end
context 'use from gitlab-ci.yml' do context 'use from gitlab-ci.yml' do
let(:pipeline) { create(:ci_pipeline) } let(:project) { create(:project, :repository) }
let(:pipeline) { create(:ci_pipeline, project: project) }
before do before do
stub_ci_pipeline_yaml_file(config) stub_ci_pipeline_yaml_file(config)
......
...@@ -248,8 +248,9 @@ describe Ci::Pipeline, :mailer do ...@@ -248,8 +248,9 @@ describe Ci::Pipeline, :mailer do
end end
describe '#stage_seeds' do describe '#stage_seeds' do
let(:project) { create(:project, :repository) }
let(:pipeline) do let(:pipeline) do
build(:ci_pipeline, config: { rspec: { script: 'rake' } }) build(:ci_pipeline, project: project, config: { rspec: { script: 'rake' } })
end end
it 'returns preseeded stage seeds object' do it 'returns preseeded stage seeds object' do
...@@ -259,7 +260,8 @@ describe Ci::Pipeline, :mailer do ...@@ -259,7 +260,8 @@ describe Ci::Pipeline, :mailer do
end end
describe '#seeds_size' do describe '#seeds_size' do
let(:pipeline) { build(:ci_pipeline_with_one_job) } let(:project) { create(:project, :repository) }
let(:pipeline) { build(:ci_pipeline_with_one_job, project: project) }
it 'returns number of jobs in stage seeds' do it 'returns number of jobs in stage seeds' do
expect(pipeline.seeds_size).to eq 1 expect(pipeline.seeds_size).to eq 1
...@@ -597,7 +599,8 @@ describe Ci::Pipeline, :mailer do ...@@ -597,7 +599,8 @@ describe Ci::Pipeline, :mailer do
describe '#has_stage_seeds?' do describe '#has_stage_seeds?' do
context 'when pipeline has stage seeds' do context 'when pipeline has stage seeds' do
subject { build(:ci_pipeline_with_one_job) } let(:project) { create(:project, :repository) }
subject { build(:ci_pipeline_with_one_job, project: project) }
it { is_expected.to have_stage_seeds } it { is_expected.to have_stage_seeds }
end end
...@@ -1430,8 +1433,9 @@ describe Ci::Pipeline, :mailer do ...@@ -1430,8 +1433,9 @@ describe Ci::Pipeline, :mailer do
end end
context 'when pipeline does not have errors' do context 'when pipeline does not have errors' do
let(:project) { create(:project, :repository) }
let(:pipeline) do let(:pipeline) do
create(:ci_pipeline, config: { rspec: { script: 'rake test' } }) create(:ci_pipeline, project: project, config: { rspec: { script: 'rake test' } })
end end
it 'does not contain yaml errors' do it 'does not contain yaml errors' do
......
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