Fix RSpec/FeatureCategory in _ssh_key.html.haml_spec
What does this MR do and why?
ee/spec/views/shared/credentials_inventory/ssh_keys/_ssh_key.html.haml_spec.rb declared no feature_category:, so RSpec/FeatureCategory rejects it. This MR sets feature_category: :user_management.
The change is metadata on the top-level RSpec.describe. No example body changes, and no test behaviour changes.
.rubocop_todo/rspec/feature_category.yml still lists this file. The entry is redundant now, and the scheduled Keeps::GenerateRubocopTodos run regenerates the todo files from a full rescan and drops entries whose offense is gone.
Design decisions
:user_management is a judgment call rather than a value copied from an authoritative source, so please confirm it is the right category before merging. Neither derived source was available:
- The class under test: the subject is the HAML partial
ee/app/views/shared/credentials_inventory/ssh_keys/_ssh_key.html.haml, which cannot declare a category of its own. - Sibling specs: the spec is the only file in
ee/spec/views/shared/credentials_inventory/ssh_keys/. In the neighbouring directories the signal is split:personal_access_tokens/_personal_access_token.html.haml_spec.rbandusers/_user_detail.html.haml_spec.rbuse:system_access, while thegpg_keys,resource_access_tokensand_expiry_dateview specs declare nothing.
That leaves the code that owns the partial. The only two controllers that render the credentials inventory, ee/app/controllers/admin/credentials_controller.rb and ee/app/controllers/groups/security/credentials_controller.rb, both declare feature_category :user_management. So do ee/spec/helpers/credentials_inventory_helper_spec.rb, both controller request specs, and the admin and group credentials feature specs. If reviewers prefer to match the two :system_access view specs instead, that is a one-word change.
How to set up and validate locally
The file is still listed in the RuboCop todo, so a plain rubocop run reports no offenses whether or not this change is correct. REVEAL_RUBOCOP_TODO=1 is what makes the cop see it, which is why the pipeline cannot show this and a local run can.
- Confirm the cop is satisfied on this branch, which should report no offenses
REVEAL_RUBOCOP_TODO=1 bundle exec rubocop --only RSpec/FeatureCategory ee/spec/views/shared/credentials_inventory/ssh_keys/_ssh_key.html.haml_spec.rb- Confirm the new value is a real category, which should print the matching line
grep -x -- '- user_management' config/feature_categories.yml- Confirm the file still offends on
master, so the check above is meaningful. This should report the offense this MR removes
git show master:ee/spec/views/shared/credentials_inventory/ssh_keys/_ssh_key.html.haml_spec.rb | REVEAL_RUBOCOP_TODO=1 bundle exec rubocop --only RSpec/FeatureCategory --stdin ee/spec/views/shared/credentials_inventory/ssh_keys/_ssh_key.html.haml_spec.rbReferences
- Relates to #589138
- Feature categorization in RSpec examples: https://docs.gitlab.com/development/feature_categorization/#rspec-examples