diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-10 18:09:32 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-10 18:09:32 +0000 |
commit | ed5add1c2f001c9bd54e664b32f212de172eca6a (patch) | |
tree | f9449cbecde36706f25a62f426b5398566ae5cca /lib | |
parent | de2fb5b82c92c90f90ed67ced45143c04e934fb8 (diff) | |
download | gitlab-ce-ed5add1c2f001c9bd54e664b32f212de172eca6a.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/alerting/alert.rb | 19 | ||||
-rw-r--r-- | lib/gitlab/diff/highlight_cache.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/import_export/group/import_export.yml | 3 |
3 files changed, 20 insertions, 4 deletions
diff --git a/lib/gitlab/alerting/alert.rb b/lib/gitlab/alerting/alert.rb index f6f52e392c6..7d97bd1bb52 100644 --- a/lib/gitlab/alerting/alert.rb +++ b/lib/gitlab/alerting/alert.rb @@ -21,6 +21,12 @@ module Gitlab end end + def gitlab_prometheus_alert_id + strong_memoize(:gitlab_prometheus_alert_id) do + payload&.dig('labels', 'gitlab_prometheus_alert_id') + end + end + def title strong_memoize(:title) do gitlab_alert&.title || parse_title_from_payload @@ -120,12 +126,19 @@ module Gitlab end def parse_gitlab_alert_from_payload - return unless metric_id + alerts_found = matching_gitlab_alerts + + return if alerts_found.blank? || alerts_found.size > 1 + + alerts_found.first + end + + def matching_gitlab_alerts + return unless metric_id || gitlab_prometheus_alert_id Projects::Prometheus::AlertsFinder - .new(project: project, metric: metric_id) + .new(project: project, metric: metric_id, id: gitlab_prometheus_alert_id) .execute - .first end def parse_title_from_payload diff --git a/lib/gitlab/diff/highlight_cache.rb b/lib/gitlab/diff/highlight_cache.rb index e79127108b4..055eae2c0fd 100644 --- a/lib/gitlab/diff/highlight_cache.rb +++ b/lib/gitlab/diff/highlight_cache.rb @@ -14,7 +14,7 @@ module Gitlab define_histogram :gitlab_redis_diff_caching_memory_usage_bytes do docstring 'Redis diff caching memory usage by key' - buckets [100, 1000, 10000, 100000, 1000000, 10000000] + buckets [100, 1_000, 10_000, 100_000, 1_000_000, 10_000_000] end define_counter :gitlab_redis_diff_caching_hit do diff --git a/lib/gitlab/import_export/group/import_export.yml b/lib/gitlab/import_export/group/import_export.yml index 49b9e0f83d9..5008639077c 100644 --- a/lib/gitlab/import_export/group/import_export.yml +++ b/lib/gitlab/import_export/group/import_export.yml @@ -36,6 +36,9 @@ excluded_attributes: - :runners_token_encrypted - :saml_discovery_token - :visibility_level + - :trial_ends_on + - :shared_runners_minute_limit + - :extra_shared_runners_minutes_limit epics: - :state_id |