forked from gitlabhq/gitlabhq
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add latest changes from gitlab-org/gitlab@master
- Loading branch information
GitLab Bot
committed
Apr 6, 2020
1 parent
cce8cf0
commit eaea945
Showing
42 changed files
with
457 additions
and
240 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
8.29.0 | ||
8.30.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# frozen_string_literal: true | ||
|
||
module Projects | ||
module Prometheus | ||
module Metrics | ||
class BaseService | ||
include Gitlab::Utils::StrongMemoize | ||
|
||
def initialize(metric, params = {}) | ||
@metric = metric | ||
@project = metric.project | ||
@params = params.dup | ||
end | ||
|
||
protected | ||
|
||
attr_reader :metric, :project, :params | ||
|
||
def application | ||
alert.environment.cluster_prometheus_adapter | ||
end | ||
|
||
def schedule_alert_update | ||
return unless alert | ||
return unless alert.environment | ||
|
||
::Clusters::Applications::ScheduleUpdateService.new( | ||
alert.environment.cluster_prometheus_adapter, project).execute | ||
end | ||
|
||
def alert | ||
strong_memoize(:alert) { find_alert(metric) } | ||
end | ||
|
||
def find_alert(metric) | ||
Projects::Prometheus::AlertsFinder | ||
.new(project: project, metric: metric) | ||
.execute | ||
.first | ||
end | ||
|
||
def has_alert? | ||
alert.present? | ||
end | ||
end | ||
end | ||
end | ||
end |
14 changes: 14 additions & 0 deletions
14
app/services/projects/prometheus/metrics/destroy_service.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# frozen_string_literal: true | ||
|
||
module Projects | ||
module Prometheus | ||
module Metrics | ||
class DestroyService < Metrics::BaseService | ||
def execute | ||
schedule_alert_update if has_alert? | ||
metric.destroy | ||
end | ||
end | ||
end | ||
end | ||
end |
29 changes: 29 additions & 0 deletions
29
app/services/projects/prometheus/metrics/update_service.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# frozen_string_literal: true | ||
|
||
module Projects | ||
module Prometheus | ||
module Metrics | ||
class UpdateService < Metrics::BaseService | ||
def execute | ||
metric.update!(params) | ||
schedule_alert_update if requires_alert_update? | ||
metric | ||
end | ||
|
||
private | ||
|
||
def requires_alert_update? | ||
has_alert? && (changing_title? || changing_query?) | ||
end | ||
|
||
def changing_title? | ||
metric.previous_changes.include?(:title) | ||
end | ||
|
||
def changing_query? | ||
metric.previous_changes.include?(:query) | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
changelogs/unreleased/Resolve-Migrate--fa-spinner-app-views-projects-network.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
title: Migrate .fa-spinner to .spinner for app/views/projects/network | ||
merge_request: 25050 | ||
author: nuwe1 | ||
type: other |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
title: Remove duplicate spec from closing issue spec | ||
merge_request: 28803 | ||
author: Rajendra Kadam | ||
type: added |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
title: Fix duplciate spec in merge requests | ||
merge_request: 28856 | ||
author: Rajendra Kadam | ||
type: added |
18 changes: 18 additions & 0 deletions
18
db/migrate/20200403184110_add_partial_index_on_id_to_ci_job_artifacts.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# frozen_string_literal: true | ||
|
||
class AddPartialIndexOnIdToCiJobArtifacts < ActiveRecord::Migration[6.0] | ||
include Gitlab::Database::MigrationHelpers | ||
|
||
DOWNTIME = false | ||
INDEX_NAME = 'index_ci_job_artifacts_file_store_is_null' | ||
|
||
disable_ddl_transaction! | ||
|
||
def up | ||
add_concurrent_index :ci_job_artifacts, :id, where: 'file_store IS NULL', name: INDEX_NAME | ||
end | ||
|
||
def down | ||
remove_concurrent_index_by_name :ci_job_artifacts, INDEX_NAME | ||
end | ||
end |
18 changes: 18 additions & 0 deletions
18
db/migrate/20200403185127_add_partial_index_on_id_to_lfs_objects.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# frozen_string_literal: true | ||
|
||
class AddPartialIndexOnIdToLfsObjects < ActiveRecord::Migration[6.0] | ||
include Gitlab::Database::MigrationHelpers | ||
|
||
DOWNTIME = false | ||
INDEX_NAME = 'index_lfs_objects_file_store_is_null' | ||
|
||
disable_ddl_transaction! | ||
|
||
def up | ||
add_concurrent_index :lfs_objects, :id, where: 'file_store IS NULL', name: INDEX_NAME | ||
end | ||
|
||
def down | ||
remove_concurrent_index_by_name :lfs_objects, INDEX_NAME | ||
end | ||
end |
18 changes: 18 additions & 0 deletions
18
db/migrate/20200403185422_add_partial_index_on_id_to_uploads.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# frozen_string_literal: true | ||
|
||
class AddPartialIndexOnIdToUploads < ActiveRecord::Migration[6.0] | ||
include Gitlab::Database::MigrationHelpers | ||
|
||
DOWNTIME = false | ||
INDEX_NAME = 'index_uploads_store_is_null' | ||
|
||
disable_ddl_transaction! | ||
|
||
def up | ||
add_concurrent_index :uploads, :id, where: 'store IS NULL', name: INDEX_NAME | ||
end | ||
|
||
def down | ||
remove_concurrent_index_by_name :uploads, INDEX_NAME | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
qa/qa/specs/features/browser_ui/6_release/deploy_token/add_deploy_token_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.