Fix RSpec/FeatureCategory in secret_detection_spec

What does this MR do and why?

spec/lib/gitlab/ci/parsers/security/secret_detection_spec.rb declared no feature_category:, so RSpec/FeatureCategory rejects it. This MR sets feature_category: :vulnerability_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

:vulnerability_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: lib/gitlab/ci/parsers/security/secret_detection.rb declares no category of its own.
  • Sibling specs: only one sibling in the same directory has a category, common_spec.rb with :vulnerability_management. sast_spec.rb has none. One sibling is below the two-sibling threshold for a consensus.

That leaves the spec's own content. It asserts that a secret detection report is ingested into a Gitlab::Ci::Reports::Security::Report (findings, identifiers, location, metadata version), which is shared report ingestion rather than the scanner itself. The nearest related specs agree: ee/spec/lib/gitlab/ci/parsers/security/dependency_scanning_spec.rb and all seven specs under spec/lib/gitlab/ci/reports/security/ use :vulnerability_management. :secret_detection is the plausible alternative if the parser is owned by the scanner's group instead.

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.

  1. Confirm the cop is satisfied on this branch, which should report no offenses
REVEAL_RUBOCOP_TODO=1 bundle exec rubocop --only RSpec/FeatureCategory spec/lib/gitlab/ci/parsers/security/secret_detection_spec.rb
  1. Confirm the new value is a real category, which should print the matching line
grep -x -- '- vulnerability_management' config/feature_categories.yml
  1. Confirm the file still offends on master, so the check above is meaningful. This should report the offense this MR removes
git show master:spec/lib/gitlab/ci/parsers/security/secret_detection_spec.rb | REVEAL_RUBOCOP_TODO=1 bundle exec rubocop --only RSpec/FeatureCategory --stdin spec/lib/gitlab/ci/parsers/security/secret_detection_spec.rb

References

Merge request reports

Loading
Loading