Restore validation of CI job environment name

This commit is contained in:
Grzegorz Bizon 2016-09-16 11:38:56 +02:00 committed by Kamil Trzcinski
parent 2ad7753d34
commit 99f1385ee0
1 changed files with 9 additions and 0 deletions

View File

@ -18,6 +18,15 @@ module Gitlab
end
validates :name, presence: true
validates :name,
type: {
with: String,
message: Gitlab::Regex.environment_name_regex_message }
validates :name,
format: {
with: Gitlab::Regex.environment_name_regex,
message: Gitlab::Regex.environment_name_regex_message }
with_options if: :hash? do
validates :config, allowed_keys: ALLOWED_KEYS