need a features 'scope' for page ids

Bug #634342 reported by Robert Collins
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Undecided
Robert Collins

Bug Description

Scopes are the things in lp.services.features that provide the control surface for per-request configuration.

ScopesFromRequest should also put the request in scopes for each of:
the full page id
each prefix of the page id leading up to a : or #

e.g. for
ScopedCollection:CollectionResource#foo-bar
We should add the following scopes:
ScopedCollection
ScopedCollection:CollectionResource
ScopedCollection:CollectionResource#foo-bar

This will let us add rules like
scope='bugtask:+index' key='memcached' value='off'

To perform immediate-effect changes in the system.

Changed in launchpad-foundations:
assignee: nobody → Robert Collins (lifeless)
Changed in launchpad-foundations:
milestone: none → 10.10
status: New → Fix Committed
Revision history for this message
Launchpad QA Bot (lpqabot) wrote : Bug fixed by a commit
tags: added: qa-needstesting
Revision history for this message
Robert Collins (lifeless) wrote :

Marking qa-ok because this is in a bit of the code base not actually used by anything live: its fine to deploy based on edge and staging still working. Will get a losa to disable memcache with it on staging today and get more solid confirmation still.

tags: added: qa-ok
removed: qa-needstesting
Revision history for this message
Robert Collins (lifeless) wrote :

To QA, on staging:
insert into featureflag (scope, priority, flag, value) values ('BugTask:+index', 0, 'memcache', 'disabled');

and then the bugtask index page should not use memcache. Remove the flag and it should use it again.

e.g. hit /bugs/600000 with the row present and missing and confirm memcache rows sppear/disappear

Revision history for this message
Robert Collins (lifeless) wrote :

Not sure if this is good or bad, I see:

    Features: {'memcache': None}
    in scopes {'BugTask:+index': None}

in the comment block; so it looks like it finds the scope, but I can't tell if the disabled value propogates properly or not from this view.

Testing with a ++oops++ shows that there are still memcache calls made, so something isn't glued up quite right yet.

https://lp-oops.canonical.com/oops.py/?oopsid=1725S85

Revision history for this message
Martin Pool (mbp) wrote :

https://bugs.edge.launchpad.net/launchpad-foundations/+bug/644751 asking for this to be more obvious.

I would have expected this to show "{'memcache': 'disabled'}" in the features comment.

Revision history for this message
Martin Pool (mbp) wrote :

<lifeless> poolie: that would be lovely
<lifeless> poolie: if you do 'make run' and visit bugs.launchpad.dev/bugs/1
<poolie> ok, let me answer this roadmap mail then i'll see what i can make of it
<lifeless> poolie: then look at the source, you should see the memcache flag evaluated
<lifeless> if you do ++oops++ on that and look at the oops, you can see memcache calls are made.
<lifeless> poolie: setting the rule in the db as I put in the bug, the scope is found, the flag still evaluates to None, and memcache calls are still made.
<lifeless> poolie: its likely shallow, but I've been elbow deep in this bugtask perf patch.

tags: added: feature-flags
tags: added: flags
removed: feature-flags
Revision history for this message
Robert Collins (lifeless) wrote :

Turns out I was a muppet; thanks for looking into it Martin.

Martin Pool (mbp)
tags: added: feature-flags
Curtis Hovey (sinzui)
Changed in launchpad-foundations:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.