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:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-09-07 00:10:03 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-09-07 00:10:03 +0300
commit179a30a49dbbbf4de03f28ac0fe9a8925d5f4883 (patch)
tree0be0608ccc4ea671ca23914c17bab454d6f872cf
parentf011d78ffe71ec6778c8eb9ad981a6dbadd3a4dc (diff)
Add latest changes from gitlab-org/gitlab@master
-rw-r--r--.rubocop_todo/capybara/testid_finders.yml1
-rw-r--r--GITALY_SERVER_VERSION2
-rw-r--r--app/assets/javascripts/super_sidebar/components/flyout_menu.vue2
-rw-r--r--app/assets/javascripts/usage_quotas/storage/components/usage_graph.vue1
-rw-r--r--config/feature_flags/development/fill_in_mr_template.yml2
-rw-r--r--config/feature_flags/development/post_import_repository_size_check.yml8
-rw-r--r--danger/database/clickhouse/Dangerfile24
-rw-r--r--doc/ci/pipeline_editor/index.md2
-rw-r--r--doc/ci/yaml/index.md2
-rw-r--r--lib/generators/batched_background_migration/templates/batched_background_migration_job_spec.template2
-rw-r--r--lib/gitlab/ci/jwt_v2.rb4
-rw-r--r--lib/gitlab/database/load_balancing/host.rb7
-rw-r--r--qa/lib/gitlab/page/group/settings/usage_quotas.rb25
-rw-r--r--qa/lib/gitlab/page/group/settings/usage_quotas.stub.rb144
-rw-r--r--spec/lib/generators/batched_background_migration/expected_files/my_batched_migration_spec_matcher.txt2
-rw-r--r--spec/lib/gitlab/database/load_balancing/host_spec.rb33
-rw-r--r--spec/tooling/danger/clickhouse_spec.rb70
-rw-r--r--tooling/danger/clickhouse.rb11
-rw-r--r--tooling/danger/project_helper.rb4
19 files changed, 153 insertions, 193 deletions
diff --git a/.rubocop_todo/capybara/testid_finders.yml b/.rubocop_todo/capybara/testid_finders.yml
index 4b2e7ac3a77..30d41f95fef 100644
--- a/.rubocop_todo/capybara/testid_finders.yml
+++ b/.rubocop_todo/capybara/testid_finders.yml
@@ -45,7 +45,6 @@ Capybara/TestidFinders:
- 'ee/spec/features/groups/show_spec.rb'
- 'ee/spec/features/groups/usage_quotas/pipelines_tab_spec.rb'
- 'ee/spec/features/groups/usage_quotas/seats_tab_spec.rb'
- - 'ee/spec/features/groups/usage_quotas/usage_quotas_spec.rb'
- 'ee/spec/features/incidents/incident_details_spec.rb'
- 'ee/spec/features/incidents/user_uploads_metric_images_spec.rb'
- 'ee/spec/features/issues/blocking_issues_spec.rb'
diff --git a/GITALY_SERVER_VERSION b/GITALY_SERVER_VERSION
index b3754d9b475..1f48fdddf7d 100644
--- a/GITALY_SERVER_VERSION
+++ b/GITALY_SERVER_VERSION
@@ -1 +1 @@
-638126d9b6839f340c151f55d66ec5742223c901
+1dd095a9550ba00c5f673c207e3e3f31fe917d15
diff --git a/app/assets/javascripts/super_sidebar/components/flyout_menu.vue b/app/assets/javascripts/super_sidebar/components/flyout_menu.vue
index 441b19cfe23..e73b9b275ee 100644
--- a/app/assets/javascripts/super_sidebar/components/flyout_menu.vue
+++ b/app/assets/javascripts/super_sidebar/components/flyout_menu.vue
@@ -117,7 +117,7 @@ export default {
},
onMouseMove(e) {
// add some wiggle room to the left of mouse cursor
- this.currentMouseX = Math.max(0, e.clientX - 20);
+ this.currentMouseX = Math.max(0, e.clientX - 5);
},
},
};
diff --git a/app/assets/javascripts/usage_quotas/storage/components/usage_graph.vue b/app/assets/javascripts/usage_quotas/storage/components/usage_graph.vue
index 33f202e69db..d5e7b7e2063 100644
--- a/app/assets/javascripts/usage_quotas/storage/components/usage_graph.vue
+++ b/app/assets/javascripts/usage_quotas/storage/components/usage_graph.vue
@@ -121,7 +121,6 @@ export default {
:key="storageType.name"
class="col-md-auto gl-display-flex gl-align-items-center"
data-testid="storage-type-legend"
- data-qa-selector="storage_type_legend"
>
<div class="gl-h-2 gl-w-5 gl-mr-2 gl-display-inline-block" :class="storageType.class"></div>
<span class="gl-mr-2 gl-font-weight-bold gl-font-sm">
diff --git a/config/feature_flags/development/fill_in_mr_template.yml b/config/feature_flags/development/fill_in_mr_template.yml
index 871d2d09f2e..a40ddc24ed2 100644
--- a/config/feature_flags/development/fill_in_mr_template.yml
+++ b/config/feature_flags/development/fill_in_mr_template.yml
@@ -5,4 +5,4 @@ rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/412796
milestone: '16.1'
type: development
group: group::code review
-default_enabled: false
+default_enabled: true
diff --git a/config/feature_flags/development/post_import_repository_size_check.yml b/config/feature_flags/development/post_import_repository_size_check.yml
deleted file mode 100644
index a51e9085b9b..00000000000
--- a/config/feature_flags/development/post_import_repository_size_check.yml
+++ /dev/null
@@ -1,8 +0,0 @@
----
-name: post_import_repository_size_check
-introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/122814
-rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/414530
-milestone: '16.1'
-type: development
-group: group::import and integrate
-default_enabled: false
diff --git a/danger/database/clickhouse/Dangerfile b/danger/database/clickhouse/Dangerfile
new file mode 100644
index 00000000000..5a82779ce90
--- /dev/null
+++ b/danger/database/clickhouse/Dangerfile
@@ -0,0 +1,24 @@
+# frozen_string_literal: true
+
+CH_MESSAGE = <<~MSG
+This merge request requires a ClickHouse review. To make sure these
+changes are reviewed, take the following steps:
+
+1. Ensure the merge request has ~clickhouse and ~"clickhouse::review pending" labels.
+1. Assign and mention a ClickHouse reviewer.
+MSG
+
+CH_UNREVIEWED_LABEL = 'clickhouse::review pending'
+CH_APPROVED_LABEL = 'clickhouse::approved'
+
+return if stable_branch.valid_stable_branch?
+return if helper.mr_labels.include?(CH_UNREVIEWED_LABEL)
+
+if helper.mr_labels.include?('clickhouse') || clickhouse.changes.any?
+ message 'This merge request adds or changes files that require a ' \
+ 'review from the [GitLab ClickHouse team](https://gitlab.com/groups/gl-clickhouse/-/group_members).'
+
+ markdown(CH_MESSAGE)
+
+ helper.labels_to_add << CH_UNREVIEWED_LABEL unless helper.has_scoped_label_with_scope?("clickhouse")
+end
diff --git a/doc/ci/pipeline_editor/index.md b/doc/ci/pipeline_editor/index.md
index 5291a8abb49..1dc6bc05e71 100644
--- a/doc/ci/pipeline_editor/index.md
+++ b/doc/ci/pipeline_editor/index.md
@@ -5,7 +5,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w
type: reference
---
-# Pipeline Editor **(FREE ALL)**
+# Pipeline editor **(FREE ALL)**
> - [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/4540) in GitLab 13.8.
> - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/270059) in GitLab 13.10.
diff --git a/doc/ci/yaml/index.md b/doc/ci/yaml/index.md
index ed30c746ffb..59ea2c5f568 100644
--- a/doc/ci/yaml/index.md
+++ b/doc/ci/yaml/index.md
@@ -3397,6 +3397,8 @@ only one of the jobs starts. The other jobs wait until the `resource_group` is f
Resource groups behave similar to semaphores in other programming languages.
+You can choose a [process mode](../resource_groups/index.md#process-modes) to strategically control the job concurrency for your deployment preferences. The default process mode is `unordered`. To change the process mode of a resource group, use the [API](../../api/resource_groups.md#edit-an-existing-resource-group) to send a request to edit an existing resource group.
+
You can define multiple resource groups per environment. For example,
when deploying to physical devices, you might have multiple physical devices. Each device
can be deployed to, but only one deployment can occur per device at any given time.
diff --git a/lib/generators/batched_background_migration/templates/batched_background_migration_job_spec.template b/lib/generators/batched_background_migration/templates/batched_background_migration_job_spec.template
index c41b8107c95..b05695ffa3b 100644
--- a/lib/generators/batched_background_migration/templates/batched_background_migration_job_spec.template
+++ b/lib/generators/batched_background_migration/templates/batched_background_migration_job_spec.template
@@ -2,6 +2,6 @@
require 'spec_helper'
-RSpec.describe Gitlab::BackgroundMigration::<%= class_name %>, schema: <%= migration_number %>, feature_category: :<%= feature_category %> do # rubocop:disable Layout/LineLength
+RSpec.describe Gitlab::BackgroundMigration::<%= class_name %>, feature_category: :<%= feature_category %> do # rubocop:disable Layout/LineLength
# Tests go here
end
diff --git a/lib/gitlab/ci/jwt_v2.rb b/lib/gitlab/ci/jwt_v2.rb
index 8c730a9548f..29beba4774a 100644
--- a/lib/gitlab/ci/jwt_v2.rb
+++ b/lib/gitlab/ci/jwt_v2.rb
@@ -61,10 +61,6 @@ module Gitlab
pipeline_source: pipeline.source&.to_sym,
pipeline_source_bridge: pipeline.source_bridge
)
- rescue StandardError => e
- # We don't want endpoints relying on this code to fail if there's an error here.
- Gitlab::ErrorTracking.track_and_raise_for_dev_exception(e, pipeline_id: pipeline.id)
- nil
end
strong_memoize_attr(:project_config)
diff --git a/lib/gitlab/database/load_balancing/host.rb b/lib/gitlab/database/load_balancing/host.rb
index c4ed1aa5eb5..880324f3ae4 100644
--- a/lib/gitlab/database/load_balancing/host.rb
+++ b/lib/gitlab/database/load_balancing/host.rb
@@ -119,16 +119,19 @@ module Gitlab
def online?
return @online unless check_replica_status?
+ was_online = @online
refresh_status
- if @online
+ # Log that the host came back online if it was previously offline
+ if @online && !was_online
::Gitlab::Database::LoadBalancing::Logger.info(
event: :host_online,
message: 'Host is online after replica status check',
db_host: @host,
db_port: @port
)
- else
+ # Always log if the host goes offline
+ elsif !@online
::Gitlab::Database::LoadBalancing::Logger.warn(
event: :host_offline,
message: 'Host is offline after replica status check',
diff --git a/qa/lib/gitlab/page/group/settings/usage_quotas.rb b/qa/lib/gitlab/page/group/settings/usage_quotas.rb
index cdb0760ad9c..8ae9e8fd25a 100644
--- a/qa/lib/gitlab/page/group/settings/usage_quotas.rb
+++ b/qa/lib/gitlab/page/group/settings/usage_quotas.rb
@@ -6,14 +6,10 @@ module Gitlab
module Settings
class UsageQuotas < Chemlab::Page
# Seats section
- link :seats_tab
div :seats_in_use
p :seats_used
p :seats_owed
table :subscription_users
- div :pending_members_alert
- button :remove_user
- button :view_pending_approvals, text: /View pending approvals/
# Pipelines section
link :pipelines_tab
@@ -27,23 +23,17 @@ module Gitlab
link :purchase_more_storage
div :namespace_usage_total
div :group_usage_message
- div :dependency_proxy_usage
span :dependency_proxy_size
- div :container_registry_usage
- div :project
- div :storage_type_legend
- span :container_registry_size
- div :storage_purchased, 'data-testid': 'storage-purchased'
+ div :storage_purchased
div :storage_purchase_successful_alert, text: /You have successfully purchased a storage/
span :project_repository_size
- span :project_lfs_object_size
- span :project_build_artifact_size
- span :project_packages_size
span :project_wiki_size
span :project_snippets_size
span :project_containers_registry_size
# Pending members
+ button :view_pending_approvals, text: /View pending approvals/
+ div :pending_members_alert
div :pending_members
button :approve_member
button :confirm_member_approval, text: /^OK$/
@@ -62,15 +52,6 @@ module Gitlab
additional_ci_minutes?
end
- # Waits and Checks if storage project data loaded
- #
- # @return [Boolean] True if the alert presents, false if not after 5 second wait
- def project_storage_data_available?
- storage_type_legend_element.wait_until(timeout: 3, &:present?)
- rescue Watir::Wait::TimeoutError
- false
- end
-
# Returns total purchased storage value once it's ready on page
#
# @return [Float] Total purchased storage value in GiB
diff --git a/qa/lib/gitlab/page/group/settings/usage_quotas.stub.rb b/qa/lib/gitlab/page/group/settings/usage_quotas.stub.rb
index 8099d1cf53a..748c9a82d59 100644
--- a/qa/lib/gitlab/page/group/settings/usage_quotas.stub.rb
+++ b/qa/lib/gitlab/page/group/settings/usage_quotas.stub.rb
@@ -5,30 +5,6 @@ module Gitlab
module Group
module Settings
module UsageQuotas
- # @note Defined as +link :seats_tab+
- # Clicks +seats_tab+
- def seats_tab
- # This is a stub, used for indexing. The method is dynamically generated.
- end
-
- # @example
- # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
- # expect(usage_quotas.seats_tab_element).to exist
- # end
- # @return [Watir::Link] The raw +Link+ element
- def seats_tab_element
- # This is a stub, used for indexing. The method is dynamically generated.
- end
-
- # @example
- # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
- # expect(usage_quotas).to be_seats_tab
- # end
- # @return [Boolean] true if the +seats_tab+ element is present on the page
- def seats_tab?
- # This is a stub, used for indexing. The method is dynamically generated.
- end
-
# @note Defined as +div :seats_in_use+
# @return [String] The text content or value of +seats_in_use+
def seats_in_use
@@ -125,30 +101,6 @@ module Gitlab
# This is a stub, used for indexing. The method is dynamically generated.
end
- # @note Defined as +button :remove_user+
- # Clicks +remove_user+
- def remove_user
- # This is a stub, used for indexing. The method is dynamically generated.
- end
-
- # @example
- # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
- # expect(usage_quotas.remove_user_element).to exist
- # end
- # @return [Watir::Button] The raw +Button+ element
- def remove_user_element
- # This is a stub, used for indexing. The method is dynamically generated.
- end
-
- # @example
- # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
- # expect(usage_quotas).to be_remove_user
- # end
- # @return [Boolean] true if the +remove_user+ element is present on the page
- def remove_user?
- # This is a stub, used for indexing. The method is dynamically generated.
- end
-
# @note Defined as +link :pipelines_tab+
# Clicks +pipelines_tab+
def pipelines_tab
@@ -365,30 +317,6 @@ module Gitlab
# This is a stub, used for indexing. The method is dynamically generated.
end
- # @note Defined as +div :dependency_proxy_usage+
- # @return [String] The text content or value of +dependency_proxy_usage+
- def dependency_proxy_usage
- # This is a stub, used for indexing. The method is dynamically generated.
- end
-
- # @example
- # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
- # expect(usage_quotas.dependency_proxy_usage_element).to exist
- # end
- # @return [Watir::Div] The raw +Div+ element
- def dependency_proxy_usage_element
- # This is a stub, used for indexing. The method is dynamically generated.
- end
-
- # @example
- # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
- # expect(usage_quotas).to be_dependency_proxy_usage
- # end
- # @return [Boolean] true if the +dependency_proxy_usage+ element is present on the page
- def dependency_proxy_usage?
- # This is a stub, used for indexing. The method is dynamically generated.
- end
-
# @note Defined as +span :dependency_proxy_size+
# @return [String] The text content or value of +dependency_proxy_size+
def dependency_proxy_size
@@ -413,30 +341,6 @@ module Gitlab
# This is a stub, used for indexing. The method is dynamically generated.
end
- # @note Defined as +div :container_registry_usage+
- # @return [String] The text content or value of +container_registry_usage+
- def container_registry_usage
- # This is a stub, used for indexing. The method is dynamically generated.
- end
-
- # @example
- # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
- # expect(usage_quotas.container_registry_usage_element).to exist
- # end
- # @return [Watir::Div] The raw +Div+ element
- def container_registry_usage_element
- # This is a stub, used for indexing. The method is dynamically generated.
- end
-
- # @example
- # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
- # expect(usage_quotas).to be_container_registry_usage
- # end
- # @return [Boolean] true if the +container_registry_usage+ element is present on the page
- def container_registry_usage?
- # This is a stub, used for indexing. The method is dynamically generated.
- end
-
# @note Defined as +div :project_storage_used+
# @return [String] The text content or value of +project_storage_used+
def project_storage_used
@@ -485,54 +389,6 @@ module Gitlab
# This is a stub, used for indexing. The method is dynamically generated.
end
- # @note Defined as +div :storage_type_legend+
- # @return [String] The text content or value of +storage_type_legend+
- def storage_type_legend
- # This is a stub, used for indexing. The method is dynamically generated.
- end
-
- # @example
- # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
- # expect(usage_quotas.storage_type_legend_element).to exist
- # end
- # @return [Watir::Div] The raw +Div+ element
- def storage_type_legend_element
- # This is a stub, used for indexing. The method is dynamically generated.
- end
-
- # @example
- # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
- # expect(usage_quotas).to be_storage_type_legend
- # end
- # @return [Boolean] true if the +storage_type_legend+ element is present on the page
- def storage_type_legend?
- # This is a stub, used for indexing. The method is dynamically generated.
- end
-
- # @note Defined as +span :container_registry_size+
- # @return [String] The text content or value of +container_registry_size+
- def container_registry_size
- # This is a stub, used for indexing. The method is dynamically generated.
- end
-
- # @example
- # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
- # expect(usage_quotas.container_registry_size_element).to exist
- # end
- # @return [Watir::Span] The raw +Span+ element
- def container_registry_size_element
- # This is a stub, used for indexing. The method is dynamically generated.
- end
-
- # @example
- # Gitlab::Page::Group::Settings::UsageQuotas.perform do |usage_quotas|
- # expect(usage_quotas).to be_container_registry_size
- # end
- # @return [Boolean] true if the +container_registry_size+ element is present on the page
- def container_registry_size?
- # This is a stub, used for indexing. The method is dynamically generated.
- end
-
# @note Defined as +div :storage_purchased+
# @return [String] The text content or value of +storage_purchased+
def storage_purchased
diff --git a/spec/lib/generators/batched_background_migration/expected_files/my_batched_migration_spec_matcher.txt b/spec/lib/generators/batched_background_migration/expected_files/my_batched_migration_spec_matcher.txt
index 2728d65d54b..185f6deeade 100644
--- a/spec/lib/generators/batched_background_migration/expected_files/my_batched_migration_spec_matcher.txt
+++ b/spec/lib/generators/batched_background_migration/expected_files/my_batched_migration_spec_matcher.txt
@@ -2,6 +2,6 @@
require 'spec_helper'
-RSpec.describe Gitlab::BackgroundMigration::MyBatchedMigration, schema: [0-9]+, feature_category: :database do # rubocop:disable Layout/LineLength
+RSpec.describe Gitlab::BackgroundMigration::MyBatchedMigration, feature_category: :database do # rubocop:disable Layout/LineLength
# Tests go here
end
diff --git a/spec/lib/gitlab/database/load_balancing/host_spec.rb b/spec/lib/gitlab/database/load_balancing/host_spec.rb
index 5ef6d9173c4..89cecaff075 100644
--- a/spec/lib/gitlab/database/load_balancing/host_spec.rb
+++ b/spec/lib/gitlab/database/load_balancing/host_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe Gitlab::Database::LoadBalancing::Host do
+RSpec.describe Gitlab::Database::LoadBalancing::Host, feature_category: :database do
let(:load_balancer) do
Gitlab::Database::LoadBalancing::LoadBalancer
.new(Gitlab::Database::LoadBalancing::Configuration.new(ActiveRecord::Base))
@@ -124,13 +124,36 @@ RSpec.describe Gitlab::Database::LoadBalancing::Host do
end
it 'refreshes the status' do
- expect(Gitlab::Database::LoadBalancing::Logger).to receive(:info)
- .with(hash_including(event: :host_online))
- .and_call_original
-
expect(host).to be_online
end
+ context 'and the host was previously online' do
+ # Hosts are online by default
+
+ it 'does not log the online event' do
+ expect(Gitlab::Database::LoadBalancing::Logger)
+ .not_to receive(:info)
+ .with(hash_including(event: :host_online))
+
+ expect(host).to be_online
+ end
+ end
+
+ context 'and the host was previously offline' do
+ before do
+ host.offline!
+ end
+
+ it 'logs the online event' do
+ expect(Gitlab::Database::LoadBalancing::Logger)
+ .to receive(:info)
+ .with(hash_including(event: :host_online))
+ .and_call_original
+
+ expect(host).to be_online
+ end
+ end
+
context 'and replica is not up to date' do
before do
expect(host).to receive(:replica_is_up_to_date?).and_return(false)
diff --git a/spec/tooling/danger/clickhouse_spec.rb b/spec/tooling/danger/clickhouse_spec.rb
new file mode 100644
index 00000000000..ad2f0b4a827
--- /dev/null
+++ b/spec/tooling/danger/clickhouse_spec.rb
@@ -0,0 +1,70 @@
+# frozen_string_literal: true
+
+require 'rspec-parameterized'
+require 'gitlab-dangerfiles'
+require 'danger'
+require 'danger/plugins/internal/helper'
+require 'gitlab/dangerfiles/spec_helper'
+
+require_relative '../../../tooling/danger/clickhouse'
+
+RSpec.describe Tooling::Danger::Clickhouse, feature_category: :tooling do
+ include_context "with dangerfile"
+
+ let(:fake_danger) { DangerSpecHelper.fake_danger.include(described_class) }
+ let(:migration_files) do
+ %w[
+ db/click_house/20220901010203_add_widgets_table.rb
+ db/click_house/20220909010203_add_properties_column.rb
+ db/click_house/20220910010203_drop_tools_table.rb
+ db/click_house/20220912010203_add_index_to_widgets_table.rb
+ ]
+ end
+
+ subject(:clickhouse) { fake_danger.new(helper: fake_helper) }
+
+ describe '#changes' do
+ using RSpec::Parameterized::TableSyntax
+
+ where do
+ {
+ 'with click_house gem changes' => {
+ modified_files: %w[gems/click_house-client/lib/click_house/client.rb],
+ changes_by_category: {
+ database: [],
+ clickhouse: %w[gems/click_house-client/lib/click_house/client.rb]
+ },
+ impacted_files: %w[gems/click_house-client/lib/click_house/client.rb]
+ },
+ 'with clickhouse data changes' => {
+ modified_files: %w[db/clickhouse/20230720114001_add_magic_table_migration.rb],
+ changes_by_category: {
+ database: [],
+ clickhouse: %w[db/clickhouse/20230720114001_add_magic_table_migration.rb]
+ },
+ impacted_files: %w[db/clickhouse/20230720114001_add_magic_table_migration.rb]
+ },
+ 'with clickhouse app changes' => {
+ modified_files: %w[lib/click_house/query_builder.rb],
+ changes_by_category: {
+ database: [],
+ clickhouse: %w[lib/click_house/query_builder.rb]
+ },
+ impacted_files: %w[lib/click_house/query_builder.rb]
+ }
+ }
+ end
+
+ with_them do
+ before do
+ allow(fake_helper).to receive(:modified_files).and_return(modified_files)
+ allow(fake_helper).to receive(:all_changed_files).and_return(modified_files)
+ allow(fake_helper).to receive(:changes_by_category).and_return(changes_by_category)
+ end
+
+ it 'returns only clickhouse changes' do
+ expect(clickhouse.changes).to match impacted_files
+ end
+ end
+ end
+end
diff --git a/tooling/danger/clickhouse.rb b/tooling/danger/clickhouse.rb
new file mode 100644
index 00000000000..b36e12219ed
--- /dev/null
+++ b/tooling/danger/clickhouse.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+module Tooling
+ module Danger
+ module Clickhouse
+ def changes
+ helper.changes_by_category[:clickhouse]
+ end
+ end
+ end
+end
diff --git a/tooling/danger/project_helper.rb b/tooling/danger/project_helper.rb
index 633c7b57097..90166438ca0 100644
--- a/tooling/danger/project_helper.rb
+++ b/tooling/danger/project_helper.rb
@@ -106,6 +106,10 @@ module Tooling
%r{\A((ee|jh)/)?app/finders/} => [:database, :backend],
%r{\Arubocop/cop/migration(/|\.rb)} => :database,
+ %r{\A(ee/)?db/click_house/} => :clickhouse,
+ %r{\Agems/click_house-client/} => :clickhouse,
+ %r{click(-)?house} => :clickhouse,
+
%r{\Alib/gitlab/ci/templates} => :ci_template,
%r{\A((ee|jh)/)?spec/features/} => :test,