diff --git a/.rubocop_todo/rspec/invalid_feature_category.yml b/.rubocop_todo/rspec/invalid_feature_category.yml index fb5e2299337ee6bd7590f17c551ecf776cabcbf3..469c0e2a8a889fefbdb76670acf8243fca8fc383 100644 --- a/.rubocop_todo/rspec/invalid_feature_category.yml +++ b/.rubocop_todo/rspec/invalid_feature_category.yml @@ -88,7 +88,6 @@ RSpec/InvalidFeatureCategory: - 'spec/lib/gitlab/graphql/tracers/logger_tracer_spec.rb' - 'spec/lib/gitlab/graphql/tracers/metrics_tracer_spec.rb' - 'spec/lib/gitlab/import_export/version_checker_spec.rb' - - 'spec/lib/gitlab/job_waiter_spec.rb' - 'spec/lib/gitlab/metrics/background_transaction_spec.rb' - 'spec/lib/gitlab/sidekiq_middleware/worker_context/client_spec.rb' - 'spec/lib/gitlab/sidekiq_middleware/worker_context/server_spec.rb' diff --git a/doc/development/feature_categorization/index.md b/doc/development/feature_categorization/index.md index 26c2c553d593f0abdf356a92ce377027e340e489..dad94a2aae230ceb2813d0dbd11890b67c896c06 100644 --- a/doc/development/feature_categorization/index.md +++ b/doc/development/feature_categorization/index.md @@ -221,3 +221,8 @@ Additionally, we flag the offenses via `RSpec/MissingFeatureCategory` RuboCop ru For Engineering Productivity internal tooling we use `feature_category: :tooling`. For example in [`spec/tooling/danger/specs_spec.rb`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/spec/tooling/danger/specs_spec.rb#L12). + +### Shared feature category + +For features that support developers and they are not specific to a product group we use `feature_category: :shared` +For example [`spec/lib/gitlab/job_waiter_spec.rb`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/spec/lib/gitlab/job_waiter_spec.rb) diff --git a/rubocop/cop/rspec/invalid_feature_category.rb b/rubocop/cop/rspec/invalid_feature_category.rb index 4d658fdc36f38da6a9f2eabf1d6bed96db3c7fea..be6d802bc92bacf61ab89f8f4d880a1646898da8 100644 --- a/rubocop/cop/rspec/invalid_feature_category.rb +++ b/rubocop/cop/rspec/invalid_feature_category.rb @@ -36,7 +36,9 @@ class InvalidFeatureCategory < RuboCop::Cop::RSpec::Base # List of feature categories which are not defined in config/feature_categories.yml CUSTOM_FEATURE_CATEGORIES = [ # https://docs.gitlab.com/ee/development/feature_categorization/#tooling-feature-category - :tooling + :tooling, + # https://docs.gitlab.com/ee/development/feature_categorization/#shared-feature-category + :shared ].to_set.freeze # @!method feature_category?(node) diff --git a/spec/lib/gitlab/job_waiter_spec.rb b/spec/lib/gitlab/job_waiter_spec.rb index f7a76035203cc139bdedbd426f37f5105d32f320..af2da8f20c0e54953cbc57a830dd3ee0f0463940 100644 --- a/spec/lib/gitlab/job_waiter_spec.rb +++ b/spec/lib/gitlab/job_waiter_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Gitlab::JobWaiter, :redis, feature_category: :not_owned do +RSpec.describe Gitlab::JobWaiter, :redis, feature_category: :shared do describe '.notify' do it 'pushes the jid to the named queue' do key = described_class.new.key diff --git a/spec/rubocop/cop/rspec/invalid_feature_category_spec.rb b/spec/rubocop/cop/rspec/invalid_feature_category_spec.rb index 0514197d6c4bd2e7be5e949d22b52c51d79f5320..e60cbe2d3ca904931ec23386d85f0350bd6cca83 100644 --- a/spec/rubocop/cop/rspec/invalid_feature_category_spec.rb +++ b/spec/rubocop/cop/rspec/invalid_feature_category_spec.rb @@ -61,6 +61,7 @@ context 'with custom categories' do it_behaves_like 'feature category validation', 'tooling' + it_behaves_like 'feature category validation', 'shared' end it 'flags invalid feature category for non-symbols' do