Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToon Claes <toon@gitlab.com>2017-01-06 17:51:06 +0300
committerToon Claes <toon@gitlab.com>2017-01-09 18:35:24 +0300
commitb74677489a915570a182e624fc2c7ad537c8e75e (patch)
tree3d5a62743ea52d9e70e7a18402623ee95fd30fcc /app/models/environment.rb
parent8ab94120ee0a87c7b1158ebafea101e3952ec758 (diff)
Treat environments matching `production/*` as Production
For Cycle Analytics, the environment `production` is treated as a special case, and used to update the `first_deployed_to_production_at` metric. With the Review Apps changes, slash syntax is used to group related environments in the list. This is mostly used for `review/<branch>` environments, but it's possible for people to have multiple production environments, and someone might then want to group them like `production/eu`, `production/us`, or even just make it look prettier with `production/www.example.com`. In any of these cases, the first deploy to one of these `production/*` environments now is treated as a Production deploy.
Diffstat (limited to 'app/models/environment.rb')
-rw-r--r--app/models/environment.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/environment.rb b/app/models/environment.rb
index 5cde94b3509..652abf18a8a 100644
--- a/app/models/environment.rb
+++ b/app/models/environment.rb
@@ -87,7 +87,7 @@ class Environment < ActiveRecord::Base
end
def update_merge_request_metrics?
- self.name == "production"
+ (environment_type || name) == "production"
end
def first_deployment_for(commit)