Support Create/Read/Destroy operations in Feature Flag API
What does this MR do?
This MR introduces the following endpoints:
GET /api/:version/projects/:id/feature_flags(.:format) - Get all feature flags of a project
POST /api/:version/projects/:id/feature_flags(.:format) - Create a new feature flag
GET /api/:version/projects/:id/feature_flags/:name(.:format) - Get a feature flag of a project
DELETE /api/:version/projects/:id/feature_flags/:name(.:format) - Delete a feature flag
This MR also cleans up multiple technical debts:
- Finder preloads the relations (scope) by default. This is for preventing from accidental N+1.
- Have permission check on Services. This ensures that we always check the executor's permission level. This is especially important in the next MR !18368 (merged).
- Fixed bunch of false-positive specs.
Feature flag
feature_flag_api
Related:
- FF CRD APIs !18198 (merged)
- FF enable/disable APIs !18368 (merged)
- FF scope APIs !18200 (merged)
- Issue: #9566 (closed)
TODO
-
Schema check in ee/spec/requests/api/feature_flags_spec.rb
Screenshots
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry - [-] Documentation created/updated or follow-up review issue created => #9566 (closed)
-
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Performance and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. - [-] Tested in all supported browsers
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
- [-] Label as security and @ mention
@gitlab-com/gl-security/appsec
- [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
- [-] Security reports checked/validated by a reviewer from the AppSec team
Edited by Shinya Maeda