Remove dead feature flag setup from remaining Jest specs

What does this MR do and why?

This is the second merge request for issue #630283 (closed). The first merge request, !256955 (merged), covered the security and work item spec areas. This MR covers the remaining files.

This MR removes dead feature-flag setup from 10 Jest spec files. It removes 11 flags. It also removes one unused factory parameter. It makes no application code changes.

A flag counts as dead when two conditions hold. First, it has no YAML file in config/feature_flags or ee/config/feature_flags. Second, it has no reference in app, ee/app, lib, ee/lib, config, ee/config, or jh. The check ran case-insensitively. It allowed an optional underscore between every character, so no snake_case, acronym, or digit spelling could hide a flag.

Dead flag setup makes a spec look like the flag drives the component. It does not. A reader can waste time on it. CI cannot catch this, because the tests pass whether the setup stays or goes.

Flags removed, by file

  • ee/spec/frontend/ai/duo_agentic_chat/components/duo_agentic_chat_state_manager_spec.js: aiAgenticWorkflows, duoChatRetry
  • ee/spec/frontend/vue_shared/components/notes/system_note_spec.js: saveDescriptionVersions
  • spec/frontend/admin/projects/index/components/app_spec.js: customAbilityReadAdminProjects
  • spec/frontend/batch_comments/components/preview_item_spec.js: improvedReviewExperience
  • spec/frontend/ci/pipeline_editor/components/editor/ci_editor_header_spec.js: aiCiConfigGenerator
  • spec/frontend/diffs/components/diff_file_spec.js: commentOnFiles, at five call sites
  • spec/frontend/diffs/components/diff_row_spec.js: dragCommentSelection
  • spec/frontend/service_accounts/components/create_edit_service_account_modal_spec.js: editServiceAccountEmail
  • spec/frontend/sidebar/components/reviewers/reviewer_title_spec.js: reviewerAssignDrawer
  • spec/frontend/tooltips/index_spec.js: glTooltips

Three edits that go past a one-line delete

A reviewer should look at these three edits.

  1. spec/frontend/admin/projects/index/components/app_spec.js also had an unused features factory parameter. No call supplied it. The parameter and the dead flag were the only content of the provide block, so the whole block is removed. This file appears in both of the issue's work streams. Both edits are made here, so the file changes only once.
  2. spec/frontend/service_accounts/components/create_edit_service_account_modal_spec.js built the component inside an it block. The enclosing beforeEach already built it with the same arguments once the dead flag was removed. The call in the it block is removed, instead of left as a duplicate.
  3. spec/frontend/tooltips/index_spec.js set the flag through window.gon.features in a beforeEach. That was the only statement in the hook, so the hook is removed. Jest resets gon between tests.

Why removing a provide entry is safe

glFeatureFlagsMixin injects glFeatures with default: () => ({}). 238 components use the mixin. One component injects without a default, app/assets/javascripts/vue_shared/components/source_viewer/components/chunk.vue. No spec in this change mounts it.

Scope note the issue does not yet reflect

The issue lists 18 files for this merge request. This MR does not touch 8 of them, for three reasons.

  • Six files under ee/spec/frontend/ci/runner set runnerMaintenanceNote or runnerPerformanceInsights. These are licensed features, not feature flags. They are live in ee/app/models/gitlab_subscriptions/features.rb, and the runner components read them. The scan wrongly reported them as dead.
  • ee/spec/frontend/ai/duo_agentic_chat/components/prompt_input_actions_spec.js uses attachmentsOn as a local variable name, not a flag name.
  • spec/frontend/wikis/components/wiki_form_spec.js was already fixed on the default branch, in commit 12b60f9a.

References

Screenshots or screen recordings

This MR changes only spec files. There is no UI change to show.

How to set up and validate locally

There is nothing to set up. This MR changes only spec files. CI runs the Jest suites in both Vue lanes.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

🤖 AI-generated

Edited by Justin Ho Tuan Duong

Merge request reports

Loading
Loading