← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~mbp/launchpad/flags into lp:launchpad

 

Martin Pool has proposed merging lp:~mbp/launchpad/flags into lp:launchpad.

Requested reviews:
  Stuart Bishop (stub)
  Robert Collins (lifeless)
  Launchpad code reviewers (launchpad-reviewers)


This adds a new FeatureFlag table, along the lines of <https://dev.launchpad.net/LEP/FeatureFlags>.  

In earlier versions of the spec I proposed to define the available scopes in the database as celebrities, but it seems hard to keep the celebrities up to date, so I'll instead define and document them in Python.

The security.cfg is probably wrong.  I want to let any part of the system read them, and the web app update them.

Thanks
-- 
https://code.launchpad.net/~mbp/launchpad/flags/+merge/29907
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~mbp/launchpad/flags into lp:launchpad.
=== added file 'database/schema/pending/patch-2207-68-0.sql'
--- database/schema/pending/patch-2207-68-0.sql	1970-01-01 00:00:00 +0000
+++ database/schema/pending/patch-2207-68-0.sql	2010-07-14 16:54:45 +0000
@@ -0,0 +1,36 @@
+-- Copyright 2009 Canonical Ltd.  This software is licensed under the
+-- GNU Affero General Public License version 3 (see the file LICENSE).
+
+-- database changes for https://dev.launchpad.net/LEP/FeatureFlags
+SET client_min_messages=ERROR;
+
+-- All flags set within various scopes
+CREATE TABLE FeatureFlag (
+    scope text not null,
+    priority integer not null,
+    flag text not null,
+    value text,
+    date_modified timestamp without time zone not null 
+    	default (current_timestamp at time zone 'utc'),
+    constraint feature_flag_pkey primary key (scope, flag),
+    constraint feature_flag_unique_priority_per_flag unique (flag, priority)
+);
+comment on table FeatureFlag is
+    'Configuration that varies by the active scope and that \
+can be changed without restarting Launchpad
+<https://dev.launchpad.net/LEP/FeatureFlags>';
+
+comment on column FeatureFlag.scope is 
+    'Scope in which this setting is active';
+
+comment on column FeatureFlag.priority is 
+    'Higher priority flags override lower';
+
+comment on column FeatureFlag.flag is 
+    'Name of the flag being controlled';
+
+
+insert into LaunchpadDatabaseRevision values (2207, 68, 0);
+
+
+-- vim: sw=4

=== modified file 'database/schema/security.cfg'
--- database/schema/security.cfg	2010-06-22 16:08:05 +0000
+++ database/schema/security.cfg	2010-07-14 16:54:45 +0000
@@ -9,6 +9,8 @@
 [DEFAULT]
 # Objects in these schemas are publicly readable or executable. *not* writable
 public_schemas=ts2
+# the currently active feature flags can be read by anyone
+public.featureflag                         = SELECT
 
 [public]
 # The public role is automatically granted to all users by PostgreSQL
@@ -135,6 +137,7 @@
 public.emailaddress                     = SELECT, INSERT, UPDATE, DELETE
 public.entitlement                      = SELECT, INSERT, UPDATE, DELETE
 public.faq                              = SELECT, INSERT, UPDATE, DELETE
+public.featureflag                      = SELECT, INSERT, UPDATE, DELETE
 public.featuredproject                  = SELECT, INSERT, DELETE
 public.hwdevicedriverlink               = SELECT
 public.hwdevicenamevariant              = SELECT


Follow ups