Skip to content

Add Feature Flag Override Toggle

Jason Goodman requested to merge ff-toggle-backend into master

What does this MR do?

  • Implement the backend for the feature flag override toggle.
  • Remove the frontend feature flag and enable the feature.

Issue: #13416 (closed)

Screenshots

Index Page:

Screen_Shot_2019-12-19_at_1.30.55_PM

Edit Page:

Screen_Shot_2019-12-19_at_1.31.21_PM

Migration Details

There are about 550 rows in the operations_feature_flags table on production.

This migration is expected to update 37 of them.

gitlabhq_production=> SELECT COUNT(id) FROM operations_feature_flags;
 count 
-------
   550
(1 row)

gitlabhq_production=> SELECT COUNT(id) FROM operations_feature_flags WHERE active = false;
 count 
-------
    37
(1 row)

gitlabhq_production=> 

The migration gives the following results in #database-lab:

EXPLAIN UPDATE “operations_feature_flags” SET “active” = TRUE WHERE “operations_feature_flags”.“active” = FALSE

 ModifyTable on public.operations_feature_flags  (cost=0.00..33.71 rows=38 width=68) (actual time=16.250..16.250 rows=0 loops=1)
   Buffers: shared hit=347 read=22 dirtied=11
   I/O Timings: read=15.225
   ->  Seq Scan on public.operations_feature_flags  (cost=0.00..33.71 rows=38 width=68) (actual time=2.444..7.342 rows=37 loops=1)
         Filter: (NOT operations_feature_flags.active)
         Rows Removed by Filter: 534
         Buffers: shared hit=1 read=6
         I/O Timings: read=7.219
Time: 16.856 ms
  - planning: 0.518 ms
  - execution: 16.338 ms
    - I/O read: 15.225 ms
    - I/O write: 0.000 ms

Shared buffers:
  - hits: 347 (~2.70 MiB) from the buffer pool
  - reads: 22 (~176.00 KiB) from the OS file cache, including disk I/O
  - dirtied: 11 (~88.00 KiB)
  - writes: 0

This migration cannot be reversed. It updates all the false values of active to true. Once complete, there is no way to determine which true values were originally false.

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

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 Mayra Cabrera

Merge request reports

Loading