diff options
author | Kamil TrzciĆski <ayufan@ayufan.eu> | 2018-11-14 11:11:27 +0000 |
---|---|---|
committer | GitLab Release Tools Bot <robert+release-tools@gitlab.com> | 2018-11-15 13:53:08 +0000 |
commit | d0b7bc79fa0cd663ba5a789b14dc49e1b29bb3d1 (patch) | |
tree | 590bf0dcb1307532961651c4beca14d035df4aac /app/models | |
parent | bf58952b523012017d483f71e784f5365a4dcc17 (diff) | |
download | gitlab-ce-d0b7bc79fa0cd663ba5a789b14dc49e1b29bb3d1.tar.gz |
Merge branch 'fix-deployment-metrics-in-mr-widget' into 'master'
Avoid returning deployment metrics url to MR widget when the deployment is not successful
Closes #53870
See merge request gitlab-org/gitlab-ce!23010
(cherry picked from commit 7674a8f477c90c1c8c9a969e7d80ea1ec9e72cd9)
e270fcc8 Fix deployment metrics in MR widget
15431054 Add spec for deployment metrics
2d6570f0 Do not remove the existing permission check
09e693c6 Add changelog
d8c24ac1 Remove unrelated changes
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/deployment.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/models/deployment.rb b/app/models/deployment.rb index 83434276995..811e623b7f7 100644 --- a/app/models/deployment.rb +++ b/app/models/deployment.rb @@ -160,18 +160,18 @@ class Deployment < ActiveRecord::Base end def has_metrics? - prometheus_adapter&.can_query? + prometheus_adapter&.can_query? && success? end def metrics - return {} unless has_metrics? && success? + return {} unless has_metrics? metrics = prometheus_adapter.query(:deployment, self) metrics&.merge(deployment_time: finished_at.to_i) || {} end def additional_metrics - return {} unless has_metrics? && success? + return {} unless has_metrics? metrics = prometheus_adapter.query(:additional_metrics_deployment, self) metrics&.merge(deployment_time: finished_at.to_i) || {} |