Conversation
|
FYI: There is already a similar config-based "features" feature implementation: That's used by various components to indicated their presence and then those features are bubbled up to the top level API. https://github.com/apache/couchdb/blob/master/src/chttpd/src/chttpd_misc.erl#L53 |
There are few important differences:
|
|
Ah you're right. It was mostly a capabilities thing. I just wanted to call it out in the PR so it's visible. As the old thing has the (confusing) "features" name. Maybe it would be good to replace the old thing with this? The "config" capabilities thing was a quick adhock thing, this seems better designed. |
f239923 to
a864b31
Compare
|
@nickva just checking, are you happy with this PR? Are you ok with us merging it? |
|
@garrensmith I didn't review the PR contents in detail so as far as that I am +0 so if you reviewed and looks good, go ahead and merge. |
|
I think IIya wants to add one more thing before merging.
…________________________________
From: Nick Vatamaniuc <notifications@github.com>
Sent: Thursday, November 1, 2018 4:46:18 PM
To: apache/couchdb
Cc: garren smith; Mention
Subject: Re: [apache/couchdb] Feature flags (#1682)
@garrensmith<https://github.com/garrensmith> I didn't review the PR contents in detail so as far as that I am +0 so if you reviewed and looks good, go ahead and merge.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#1682 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AAK9An81IkitazaMSLLhWB6JfF7OQb-oks5uqwk6gaJpZM4X6XHv>.
|
3b4681f to
3ce0855
Compare
jaydoane
left a comment
There was a problem hiding this comment.
make eunit apps=couch suites=couch_flags_tests,couch_flags_config
[done in 15.251 s]
=======================================================
All 5059 tests passed.
(that's a lot of new tests!)
| % - provides public API to use to get value for a given feature flag and subject | ||
| % - implements {feature_flags, couch_flags} service | ||
|
|
||
| % The module rely on couch_epi_data_gen which uses the data returned by |
|
|
||
| -define(SERVICE_ID, feature_flags). | ||
|
|
||
| enabled(Subject) -> |
There was a problem hiding this comment.
I would love to see type specs defined for public functions
3ce0855 to
18367a6
Compare
18367a6 to
e9abe50
Compare
Overview
Once in a while we merge a highly experimental features. It is beneficial to be able to have the codepath for these features effectivelly disabled by default until the implementation is stabilized.
This PR introduces an ability to add feature flag checks for experimental features.
This feature is for developers only and wouldn't need documentation.
The feature configuration
Notes:
*is only allowed at the end of the path/mytestdatabaseprefix* = [my_featureA, my_featureB]Usage of the feature in the code
Where Subject is one of
#db{}|#httpd{)|#shard{}|#ordered_shard{}|ShardName :: binary()|ShardName :: list()|DbName :: binary()|DbName :: list()Performance
There is a naive performance test in the test suite it does 1 million of calls to
is_enabled/2. One million of calls takes "1.884 s" on the laptop.Security
It is not safe to allow configuration of the feature flags over http since there might be a possibility of injecting arbitrary code via name of the configuration key within
feature_flagssection. Therefore the http access is disabled.Testing recommendations
Related Issues or Pull Requests
N/A
Checklist