Skip to content

Extract Admin::SetFeatureFlagService from `POST /features`

Fabio Pitino requested to merge refactor-post-feature-flags into master

What does this MR do and why?

Related to #373176 (feature flag issue)

In this MR we are extracting a service object from POST /features API endpoint. The endpoint contains a lot of business logic that is also contained in the helpers.

With extracting a service object Admin::SetFeatureFlagService we have all the logic in a single place, leaving the endpoint dealing only with input parameters and HTTP responses. The logic can also be tested in isolation.

This change is introduced via a feature flag set_feature_flag_service that will be rolled out in [Feature flag] Rollout of `set_feature_flag_ser... (#373176).

💡 Disable "show whitespace changes" for a much cleaner diff: Especially for spec/requests/api/features_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.

Edited by Fabio Pitino

Merge request reports