summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-10 12:07:47 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-10 12:07:47 +0000
commit96b0c1245c93585a8b0fe23e22306d32ff4e4905 (patch)
treed2904751e1a2529e8239381ce747339cdbf5116c /lib
parent0ba3a054d2190094ffda1ebe3aa53ffc5b92247d (diff)
downloadgitlab-ce-96b0c1245c93585a8b0fe23e22306d32ff4e4905.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib')
-rw-r--r--lib/feature.rb4
-rw-r--r--lib/gitlab/ci/templates/Jobs/Code-Quality.gitlab-ci.yml2
-rw-r--r--lib/gitlab/database.rb8
3 files changed, 13 insertions, 1 deletions
diff --git a/lib/feature.rb b/lib/feature.rb
index 88b0d871c3a..543512b1598 100644
--- a/lib/feature.rb
+++ b/lib/feature.rb
@@ -52,6 +52,10 @@ class Feature
# use `default_enabled: true` to default the flag to being `enabled`
# unless set explicitly. The default is `disabled`
def enabled?(key, thing = nil, default_enabled: false)
+ # During setup the database does not exist yet. So we haven't stored a value
+ # for the feature yet and return the default.
+ return default_enabled unless Gitlab::Database.exists?
+
feature = Feature.get(key)
# If we're not default enabling the flag or the feature has been set, always evaluate.
diff --git a/lib/gitlab/ci/templates/Jobs/Code-Quality.gitlab-ci.yml b/lib/gitlab/ci/templates/Jobs/Code-Quality.gitlab-ci.yml
index 1708984c1cb..8bc60a36ebd 100644
--- a/lib/gitlab/ci/templates/Jobs/Code-Quality.gitlab-ci.yml
+++ b/lib/gitlab/ci/templates/Jobs/Code-Quality.gitlab-ci.yml
@@ -7,7 +7,7 @@ code_quality:
variables:
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
- CODE_QUALITY_IMAGE: "registry.gitlab.com/gitlab-org/security-products/codequality:0.85.5"
+ CODE_QUALITY_IMAGE: "registry.gitlab.com/gitlab-org/security-products/codequality:0.85.6"
script:
- |
if ! docker info &>/dev/null; then
diff --git a/lib/gitlab/database.rb b/lib/gitlab/database.rb
index ceab9322857..82ec740ade1 100644
--- a/lib/gitlab/database.rb
+++ b/lib/gitlab/database.rb
@@ -241,6 +241,14 @@ module Gitlab
row['version']
end
+ def self.exists?
+ connection
+
+ true
+ rescue
+ false
+ end
+
private_class_method :database_version
def self.add_post_migrate_path_to_rails(force: false)