Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz@gitlab.com>2018-04-19 09:44:27 +0300
committerGrzegorz Bizon <grzegorz@gitlab.com>2018-04-19 09:44:27 +0300
commit6ef8b497e721fac49a0914802244f98dd5d99078 (patch)
tree5aed7daad2568ea843fb2a0a017fcadc27725bf8
parentd66f1882ffc5780723bbb38593aac9db590c6efe (diff)
parent5e3733da3773f187c5a8c20c26f9d5c0432dea57 (diff)
Merge branch '5320-fix-gitlab-features-env-var' into 'master'
Get GITLAB_FEATURES from Project#licensed_features instead of Namespace#features (#5320) See merge request gitlab-org/gitlab-ce!18189
-rw-r--r--app/models/ci/build.rb2
-rw-r--r--app/models/namespace.rb4
-rw-r--r--app/models/project.rb4
-rw-r--r--spec/models/ci/build_spec.rb2
4 files changed, 6 insertions, 6 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index 1c8d9ca4aa5..c7dc0826738 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -611,7 +611,7 @@ module Ci
Gitlab::Ci::Variables::Collection.new.tap do |variables|
variables.append(key: 'CI', value: 'true')
variables.append(key: 'GITLAB_CI', value: 'true')
- variables.append(key: 'GITLAB_FEATURES', value: project.namespace.features.join(','))
+ variables.append(key: 'GITLAB_FEATURES', value: project.licensed_features.join(','))
variables.append(key: 'CI_SERVER_NAME', value: 'GitLab')
variables.append(key: 'CI_SERVER_VERSION', value: Gitlab::VERSION)
variables.append(key: 'CI_SERVER_REVISION', value: Gitlab::REVISION)
diff --git a/app/models/namespace.rb b/app/models/namespace.rb
index 2b63aa33222..c29a53e5ce7 100644
--- a/app/models/namespace.rb
+++ b/app/models/namespace.rb
@@ -248,10 +248,6 @@ class Namespace < ActiveRecord::Base
all_projects.with_storage_feature(:repository).find_each(&:remove_exports)
end
- def features
- []
- end
-
def refresh_project_authorizations
owner.refresh_authorized_projects
end
diff --git a/app/models/project.rb b/app/models/project.rb
index 5c37cd85243..cec1e705aa8 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -1875,6 +1875,10 @@ class Project < ActiveRecord::Base
memoized_results[cache_key]
end
+ def licensed_features
+ []
+ end
+
private
def storage
diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb
index d7075d4a6b4..451b038e9a6 100644
--- a/spec/models/ci/build_spec.rb
+++ b/spec/models/ci/build_spec.rb
@@ -1472,7 +1472,7 @@ describe Ci::Build do
{ key: 'CI_REPOSITORY_URL', value: build.repo_url, public: false },
{ key: 'CI', value: 'true', public: true },
{ key: 'GITLAB_CI', value: 'true', public: true },
- { key: 'GITLAB_FEATURES', value: project.namespace.features.join(','), public: true },
+ { key: 'GITLAB_FEATURES', value: project.licensed_features.join(','), public: true },
{ key: 'CI_SERVER_NAME', value: 'GitLab', public: true },
{ key: 'CI_SERVER_VERSION', value: Gitlab::VERSION, public: true },
{ key: 'CI_SERVER_REVISION', value: Gitlab::REVISION, public: true },