Commit 1b0cbfb8 authored by Remy Bordignon's avatar Remy Bordignon Committed by Arturo Herrero

Improve deployment information on Jira Cloud app

40% of deployment events sent from GitLab to Jira have an environment
type as unmapped. This improves the mapping to get information about the
environment.

Changelog: changed
parent 2a6cf8a3
...@@ -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