diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-20 15:26:25 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-20 15:26:25 +0300 |
commit | a09983ae35713f5a2bbb100981116d31ce99826e (patch) | |
tree | 2ee2af7bd104d57086db360a7e6d8c9d5d43667a /lib/gitlab/config_checker | |
parent | 18c5ab32b738c0b6ecb4d0df3994000482f34bd8 (diff) |
Add latest changes from gitlab-org/gitlab@13-2-stable-ee
Diffstat (limited to 'lib/gitlab/config_checker')
-rw-r--r-- | lib/gitlab/config_checker/external_database_checker.rb | 49 |
1 files changed, 35 insertions, 14 deletions
diff --git a/lib/gitlab/config_checker/external_database_checker.rb b/lib/gitlab/config_checker/external_database_checker.rb index 795082a10a0..c08dd0351f3 100644 --- a/lib/gitlab/config_checker/external_database_checker.rb +++ b/lib/gitlab/config_checker/external_database_checker.rb @@ -5,22 +5,43 @@ module Gitlab module ExternalDatabaseChecker extend self - # DB is considered deprecated if it is below version 11 - def db_version_deprecated? - Gitlab::Database.version.to_f < 11 - end - def check - return [] unless db_version_deprecated? + notices = [] + + unless Gitlab::Database.postgresql_minimum_supported_version? + notices << + { + type: 'warning', + message: _('You are using PostgreSQL %{pg_version_current}, but PostgreSQL ' \ + '%{pg_version_minimum} is required for this version of GitLab. ' \ + 'Please upgrade your environment to a supported PostgreSQL version, ' \ + 'see %{pg_requirements_url} for details.') % { + pg_version_current: Gitlab::Database.version, + pg_version_minimum: Gitlab::Database::MINIMUM_POSTGRES_VERSION, + pg_requirements_url: '<a href="https://docs.gitlab.com/ee/install/requirements.html#database">database requirements</a>' + } + } + end + + if Gitlab::Database.postgresql_upcoming_deprecation? + upcoming_deprecation = Gitlab::Database::UPCOMING_POSTGRES_VERSION_DETAILS + + notices << + { + type: 'warning', + message: _('Note that PostgreSQL %{pg_version_upcoming} will become the minimum required ' \ + 'version in GitLab %{gl_version_upcoming} (%{gl_version_upcoming_date}). Please ' \ + 'consider upgrading your environment to a supported PostgreSQL version soon, ' \ + 'see <a href="%{pg_version_upcoming_url}">the related epic</a> for details.') % { + pg_version_upcoming: upcoming_deprecation[:pg_version_minimum], + gl_version_upcoming: upcoming_deprecation[:gl_version], + gl_version_upcoming_date: upcoming_deprecation[:gl_version_date], + pg_version_upcoming_url: upcoming_deprecation[:url] + } + } + end - [ - { - type: 'warning', - message: _('Note that PostgreSQL 11 will become the minimum required PostgreSQL version in GitLab 13.0 (May 2020). '\ - 'PostgreSQL 9.6 and PostgreSQL 10 will no longer be supported in GitLab 13.0. '\ - 'Please consider upgrading your PostgreSQL version (%{db_version}) soon.') % { db_version: Gitlab::Database.version.to_s } - } - ] + notices end end end |