Remove unused glFeatureFlagsMixin registrations in EE
What does this MR do and why?
Removes the glFeatureFlagsMixin import and the mixins entry from EE components (ee/app/) that never read glFeatures. The CE half is a separate MR so each side stays small and rebases cleanly.
- Touches 27 components.
- Removing an unused registration does not change behaviour. A mixin whose members are never read only adds an
injector a method nobody calls. - The change was produced by the
local-rules/vue-mixin-pairingrule from !256664 (merged) (now merged), then Prettier ran on the touched files. - The rule shipped with its unused-registration half switched off for this mixin (
reportUnused: false), because the missing-registration half is what prevents Vue 3 runtime breakage and must not wait. This cleanup can merge in any order relative to the other cleanups. A last MR switches the unused half on once they are all in. - After a rebase onto
master, the rule was run again overee/app/assets/javascriptswithreportUnused: true. It found four more components that the first pass missed. They are included here:ee/app/assets/javascripts/ai/components/ai_genie.vueee/app/assets/javascripts/ai/shared/feature_settings/model_select_dropdown.vueee/app/assets/javascripts/boards/components/board_add_new_column.vueee/app/assets/javascripts/work_items/components/shared/work_item_link_child_metadata.vue
- After this MR, the rule reports no unused
glFeatureFlagsMixinregistration underee/app/assets/javascripts.
A second commit removes the now inert glFeatures setup from five specs of the touched components, as asked in !256677 (comment 3882984375). In four specs the flag was exposed as a factory parameter, which suggested it still drove the component. No assertion changes.
ee/spec/frontend/approvals/mr_edit/app_spec.js- drops the
mrCollapsedApprovalRulesfactory parameter and itsprovide
- drops the
ee/spec/frontend/security_dashboard/components/pipeline/pipeline_vulnerability_report_spec.js- drops the
vulnerabilityReportTypeScannerFilterparameter and itsprovide
- drops the
ee/spec/frontend/ai/shared/feature_settings/model_select_dropdown_spec.js- drops the
featuresparameter and itsprovide
- drops the
ee/spec/frontend/security_orchestration/components/policy_editor/scan_result/advanced_settings/policy_exceptions/policy_exceptions_selector_spec.js- drops the
glFeaturesparameter and itsprovide
- drops the
ee/spec/frontend/ai/duo_agents_platform/pages/flow_triggers/components/flow_trigger_form_spec.js- drops the inline
glFeatures: {}
- drops the inline
mrCollapsedApprovalRules and vulnerabilityReportTypeScannerFilter no longer exist in the app code either.
Left out on purpose:
ee/app/assets/javascripts/vue_merge_request_widget/mixins/ready_to_merge.jsregisters the mixin inside a mixin object. The rule does not cover.jsmixin files. The only consumer,app/assets/javascripts/vue_merge_request_widget/components/states/ready_to_merge.vue, registersglFeatureFlagsMixin()itself, so the nested registration is redundant but harmless.ee/spec/frontend/ai/components/ai_genie_spec.jskeepsglFeatures: { inlineBlame: false }. Thatprovidegoes to the real source-viewerChunkcomponent, which injectsglFeaturesdirectly.- Specs of parent components that mount the touched components as children. Their
glFeaturessetup drives the parent, not the child.
How to set up and validate locally
-
Run ESLint on the touched files:
git diff --name-only origin/master...HEAD | xargs ./node_modules/.bin/eslintNo
local-rules/vue-mixin-pairingerror is reported. -
Optional: in
eslint.config.mjs, setreportUnused: trueon thegl_feature_flags_mixinentry and run ESLint overee/app/assets/javascripts. No unused registration is reported. -
Run the Jest specs of the touched components:
git diff --name-only origin/master...HEAD | sed -E 's#^(ee/)?app/assets/javascripts/#\1spec/frontend/#; s#\.vue$#_spec.js#' | xargs ls 2>/dev/null | xargs yarn jest26 suites, 687 tests pass.
self_managed_add_on_eligible_user_list.vuehas no spec of its own.
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.
References
- Closes #630283 (closed), the follow-up for the spec cleanup
- Review suggestion that asked for the spec cleanup: !256677 (comment 3882984375)
- Related to #629073 (closed), which asks for the pairing rules and for existing violations to be fixed in separate MRs
- Rule MR whose autofix produced this change: !256664 (merged)
- Motivating bug for the rules: !255388 (merged)