Skip to content

Cleanup tech debt from registration features migration

What does this MR do and why?

Reverted legacy approach used to add features to registration features list.

Related MRs:

Previous approach

Using || License.features_with_usage_ping.include?(:feature_key) as an additional check to existing License.feature_available?(:feature_key)

Final condition example: License.feature_available?(:send_emails_from_admin_area) || License.features_with_usage_ping.include?(:send_emails_from_admin_area)

New approach

This new check is already a part of License#feature_available? so we don't need all these || License.features_with_usage_ping.include?(:feature_key) conditions anymore as well as helpers/classes that were introduced to wrap this complex condition.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

How to set up and validate locally

Origin specs added in scope of above related MR's should not fail.

# https://gitlab.com/gitlab-org/gitlab/-/merge_requests/118760/
# Add maintenance mode to registration features
ee/spec/controllers/admin/application_settings_controller_spec.rb
ee/spec/requests/api/settings_spec.rb
ee/spec/services/registration_features/maintenance_mode_spec.rb

# https://gitlab.com/gitlab-org/gitlab/-/merge_requests/70912/
# Repo size limit and group ip restriction
ee/spec/helpers/admin/ip_restriction_helper_spec.rb
ee/spec/helpers/admin/repo_size_limit_helper_spec.rb
ee/spec/lib/ee/gitlab/ip_restriction/enforcer_spec.rb
ee/spec/models/ee/project_spec.rb

# https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96397/
# Update API for groups to allow ip_restriction_ranges
ee/spec/lib/ee/api/entities/group_detail_spec.rb

# https://gitlab.com/gitlab-org/gitlab/-/merge_requests/64003
# Email users from Admin Area feature for free.
ee/spec/controllers/admin/emails_controller_spec.rb
ee/spec/features/admin/admin_emails_spec.rb
ee/spec/features/admin/admin_users_spec.rb
ee/spec/helpers/admin/emails_helper_spec.rb

# https://gitlab.com/gitlab-org/gitlab/-/merge_requests/119850
# Add password complexity feature to Registration Features
ee/spec/lib/ee/gitlab/gon_helper_spec.rb
ee/spec/lib/gitlab/registration_features/password_complexity_spec.rb
ee/spec/models/ee/user_spec.rb

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #423233 (closed)

Edited by Taras Tadai

Merge request reports