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
def type
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'
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'
when /staging/i
'staging'
when /(dev|review)/i
when /\A(.*[^a-z0-9])?(dev|review|development)([^a-z0-9].*)?\z/i
'development'
else
'unmapped'
......
......@@ -46,12 +46,22 @@ RSpec.describe Atlassian::JiraConnect::Serializers::DeploymentEntity do
using RSpec::Parameterized::TableSyntax
where(:env_name, :env_type) do
'PRODUCTION' | 'production'
'prod' | 'production'
'prod-east-2' | 'production'
'us-prod-east' | 'production'
'fe-production' | 'production'
'test' | 'testing'
'qa-env-2' | 'testing'
'staging' | 'staging'
'pre-prod' | 'staging'
'blue-kit-stage' | 'staging'
'pre-prod' | 'staging'
'dev' | 'development'
'review/app' | 'development'
'something-else' | 'unmapped'
'store-produce' | 'unmapped'
'unproductive' | 'unmapped'
end
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