diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-17 15:10:12 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-17 15:10:12 +0300 |
commit | 4203215d542505bba491a01d637479934c8005d6 (patch) | |
tree | 000a956ac60247021ff8c36a1a17a1ea6ed1ff38 /lib/gitlab/config_checker | |
parent | 325318e2ddfcaedf0527053dd3c9bd62db547089 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/config_checker')
-rw-r--r-- | lib/gitlab/config_checker/external_database_checker.rb | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/lib/gitlab/config_checker/external_database_checker.rb b/lib/gitlab/config_checker/external_database_checker.rb index af828acb9c0..dfcdbdf39e0 100644 --- a/lib/gitlab/config_checker/external_database_checker.rb +++ b/lib/gitlab/config_checker/external_database_checker.rb @@ -9,35 +9,41 @@ module Gitlab notices = [] unless Gitlab::Database.postgresql_minimum_supported_version? + string_args = { + pg_version_current: Gitlab::Database.version, + pg_version_minimum: Gitlab::Database::MINIMUM_POSTGRES_VERSION, + pg_requirements_url_open: '<a href="https://docs.gitlab.com/ee/install/requirements.html#database">'.html_safe, + pg_requirements_url_close: '</a>'.html_safe + } + notices << { type: 'warning', - message: _('You are using PostgreSQL %{pg_version_current}, but PostgreSQL ' \ + message: html_escape(_('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>' - } + 'see %{pg_requirements_url_open}database requirements%{pg_requirements_url_close} for details.')) % string_args } end if Gitlab::Database.postgresql_upcoming_deprecation? && Gitlab::Database.within_deprecation_notice_window? upcoming_deprecation = Gitlab::Database::UPCOMING_POSTGRES_VERSION_DETAILS + string_args = { + 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_open: "<a href=\"#{upcoming_deprecation[:url]}\">".html_safe, + pg_version_upcoming_url_close: '</a>'.html_safe + } + notices << { type: 'warning', - message: _('Note that PostgreSQL %{pg_version_upcoming} will become the minimum required ' \ + message: html_escape(_('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] - } + 'see %{pg_version_upcoming_url_open}the related epic%{pg_version_upcoming_url_close} for details.')) % string_args } end |