Commit 694078cb authored by Arturo Herrero's avatar Arturo Herrero

Merge branch 'issue-334953-improve-env-mapping' into 'master'

Improve deployment information from the GitLab.com for Jira Cloud app

See merge request gitlab-org/gitlab!70880
parents f9ca04fd 1b0cbfb8
...@@ -21,13 +21,13 @@ module Atlassian ...@@ -21,13 +21,13 @@ module Atlassian
def type def type
case environment.name case environment.name
when /prod/i when /\A(.*[^a-z0-9])?(staging|stage|stg|preprod|pre-prod|model|internal)([^a-z0-9].*)?\z/i
'staging'
when /\A(.*[^a-z0-9])?(prod|production|prd|live)([^a-z0-9].*)?\z/i
'production' 'production'
when /test/i when /\A(.*[^a-z0-9])?(test|testing|tests|tst|integration|integ|intg|int|acceptance|accept|acpt|qa|qc|control|quality)([^a-z0-9].*)?\z/i
'testing' 'testing'
when /staging/i when /\A(.*[^a-z0-9])?(dev|review|development)([^a-z0-9].*)?\z/i
'staging'
when /(dev|review)/i
'development' 'development'
else else
'unmapped' 'unmapped'
......
...@@ -46,12 +46,22 @@ RSpec.describe Atlassian::JiraConnect::Serializers::DeploymentEntity do ...@@ -46,12 +46,22 @@ RSpec.describe Atlassian::JiraConnect::Serializers::DeploymentEntity do
using RSpec::Parameterized::TableSyntax using RSpec::Parameterized::TableSyntax
where(:env_name, :env_type) do where(:env_name, :env_type) do
'PRODUCTION' | 'production'
'prod' | 'production' 'prod' | 'production'
'prod-east-2' | 'production'
'us-prod-east' | 'production'
'fe-production' | 'production'
'test' | 'testing' 'test' | 'testing'
'qa-env-2' | 'testing'
'staging' | 'staging' 'staging' | 'staging'
'pre-prod' | 'staging'
'blue-kit-stage' | 'staging'
'pre-prod' | 'staging'
'dev' | 'development' 'dev' | 'development'
'review/app' | 'development' 'review/app' | 'development'
'something-else' | 'unmapped' 'something-else' | 'unmapped'
'store-produce' | 'unmapped'
'unproductive' | 'unmapped'
end end
with_them do with_them do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment