iilyak [Wed, 29 Jul 2020 13:40:18 +0000 (06:40 -0700)]
Merge pull request #30 from iilyak/implement-format-status
Refactor config:set to be able to pass sensitive flag
ILYA Khlopotov [Mon, 2 Mar 2020 12:25:25 +0000 (04:25 -0800)]
Refactor config:set to be able to pass sensitive flag
The sensitive flag wouldn't log the value.
Will Holley [Wed, 22 Jan 2020 08:28:33 +0000 (08:28 +0000)]
Merge pull request #29 from apache/notify_on_reload
Raise notify events on reload
Will Holley [Tue, 21 Jan 2020 21:58:12 +0000 (21:58 +0000)]
Raise notify events on reload
When config is reloaded from disk, raise notification events
for values that have changed or are deleted.
iilyak [Thu, 21 Feb 2019 19:04:15 +0000 (11:04 -0800)]
Merge pull request #28 from cloudant/keep_features_on_config_restart
Keep features on config process restart.
ILYA Khlopotov [Thu, 21 Feb 2019 17:57:29 +0000 (17:57 +0000)]
Keep features on config process restart.
We used to store a list of enabled features in ets table owned by `config`
process. This meant that on every `config` process restart we loose the
list. Therefore welcome endpoint start to return empty list of features.
Use application environment to keep the list.
fixes #1930
Nick Vatamaniuc [Thu, 24 Jan 2019 16:57:07 +0000 (11:57 -0500)]
Merge pull request #27 from apache/fix-regex-in-key
Fix regex patterns in keys
Nick Vatamaniuc [Thu, 24 Jan 2019 16:53:00 +0000 (11:53 -0500)]
Update .travis.yml to match release versions used in main repo
Nick Vatamaniuc [Thu, 24 Jan 2019 16:39:35 +0000 (11:39 -0500)]
Fix regex patterns in keys
Make sure to escape regex patterns in config keys
jiangph [Tue, 13 Nov 2018 07:09:52 +0000 (15:09 +0800)]
Merge branch 'COUCHDB-1380-fix-nasty-error' of github.com:cloudant/couchdb-config
wenwl [Thu, 8 Nov 2018 02:25:07 +0000 (10:25 +0800)]
Fix nasty 500 error on POST to /_config
wenwl [Tue, 13 Nov 2018 04:41:53 +0000 (12:41 +0800)]
Change the variable name from _Else to Else
wenwl [Thu, 8 Nov 2018 02:25:07 +0000 (10:25 +0800)]
Fix nasty 500 error on POST to /_config
jiangph [Tue, 13 Nov 2018 05:14:23 +0000 (13:14 +0800)]
Merge branch 'remove-R16B03-1-build' of github.com:cloudant/couchdb-config
jiangph [Thu, 8 Nov 2018 08:56:54 +0000 (16:56 +0800)]
Remove R16B03-1 build flavor
Jan Lehnardt [Fri, 14 Sep 2018 10:09:48 +0000 (12:09 +0200)]
fix tests for #1602
Dave Cottlehuber [Mon, 30 Apr 2018 12:12:07 +0000 (12:12 +0000)]
config: tighten config validation
Nick Vatamaniuc [Wed, 14 Mar 2018 15:38:57 +0000 (11:38 -0400)]
Merge remote-tracking branch 'cloudant/support-not-persist-variants'
Fix #19
ILYA Khlopotov [Wed, 14 Mar 2018 13:13:56 +0000 (06:13 -0700)]
Support not persist variants for helper functions
This adds support for specifying Persist argument for the following
helper functions:
* set_boolean
* set_integer
* set_float
Nick Vatamaniuc [Thu, 15 Feb 2018 16:09:39 +0000 (11:09 -0500)]
Merge branch 'use-callbacks-for-behavior'
Fixes #18
Nick Vatamaniuc [Thu, 15 Feb 2018 06:30:44 +0000 (01:30 -0500)]
Use callback directive for config_listener behaviour
This knocks out a few dialyzer errors such as:
`Callback info about the config_listener behaviour is not available`
It is also more descriptive as it specifies types and argument names for each
callback.
Nick Vatamaniuc [Sat, 22 Jul 2017 03:34:22 +0000 (23:34 -0400)]
Merge remote-tracking branch 'cloudant/issue-703'
Fixes #703
Nick Vatamaniuc [Sat, 22 Jul 2017 03:13:01 +0000 (23:13 -0400)]
Add longer timeouts for operations which could write to disk
It turns out that 5 seconds is often not enough in a severly throttled test
environment, and simple operations like config:set and config:delete raise
timeout errors.
Increase default 5 second timeout to half a minute. This should hopefully
handle even heavily throttled IO environments.
Fixed #703
Paul J. Davis [Thu, 13 Jul 2017 19:56:14 +0000 (14:56 -0500)]
Replace couch_log calls with mocks
Depending on the order of test suite invocations its possible that the
config suite will end up with -DTEST compiled versions from couch_log's
eunit test suite. These have syncrhonous calls where the normal versions
are all gen_server:cast/2 calls. This breaks config's test suite when
since couch_log is not started.
Rather than go through the hoops of getting couch_log started (which
causes a circular dependency) I've just mocked out the calls so that
they don't cause issues.
Paul J. Davis [Mon, 22 May 2017 16:20:26 +0000 (11:20 -0500)]
Merge branch 'fix-eunit-tests'
Paul J. Davis [Tue, 16 May 2017 20:07:46 +0000 (15:07 -0500)]
Make sure to stop the correct applications
We need to make sure and stop all applications that we started.
Paul J. Davis [Tue, 16 May 2017 20:06:37 +0000 (15:06 -0500)]
Let test_util figure out our deps
Dependencies are already listed in config.app.src so we should just let
the test_util figure out what else needs starting.
Nick Vatamaniuc [Wed, 9 Nov 2016 02:46:13 +0000 (21:46 -0500)]
Features API and implementation.
Implement ability to enable, disable and query feature flags.
Features are identified as atoms. Usage intent is for various components in the
system to enable features, then the HTTP API will expose those to the user.
For example, features could indicate the presence of an optional component, a
plugin or a new mode of operation.
The API has 3 functions:
* `config:features/0` : Return a sorted list of feature flags
* `config:enable_feature/1` : Enables a feature. Feature argument could be a
list, a binary or an atom.
* `config:disable_feature/1` : Disables a feature.
Implementation is a thin wrapper around setting and deleting keys from the
'[features]' config section. This means, users can also set their own features
there via the .ini config files. Features set via the API are not persistent,
so applications will have to set them every time they initialize.
COUCHDB-3180
ILYA Khlopotov [Wed, 24 Aug 2016 19:21:47 +0000 (12:21 -0700)]
Merge remote branch 'cloudant:fix-return-value'
This closes #13
Signed-off-by: ILYA Khlopotov <iilyak@ca.ibm.com>
ILYA Khlopotov [Wed, 24 Aug 2016 19:01:43 +0000 (12:01 -0700)]
handle_event expected to return {ok, State}
Fix return value of handle_event callback.
COUCHDB-3102
ILYA Khlopotov [Wed, 24 Aug 2016 16:41:27 +0000 (09:41 -0700)]
Merge remote branch 'cloudant:3102-fixup-for-config_subscription'
This closes #12
Signed-off-by: ILYA Khlopotov <iilyak@ca.ibm.com>
ILYA Khlopotov [Tue, 23 Aug 2016 23:01:48 +0000 (16:01 -0700)]
Add config_listener_mon:start_link/2
This a fixup commit for
f09a2eb7d
COUCHDB-3102
ILYA Khlopotov [Tue, 23 Aug 2016 22:03:32 +0000 (15:03 -0700)]
Merge remote branch 'cloudant:3102-restart-monitor'
This closes #11
Signed-off-by: ILYA Khlopotov <iilyak@ca.ibm.com>
ILYA Khlopotov [Fri, 19 Aug 2016 22:44:55 +0000 (15:44 -0700)]
Make sure we don't subscribe multiple times
Check there is no subscription from given Pid in subscribe_for_changes
COUCHDB-3102
ILYA Khlopotov [Fri, 19 Aug 2016 19:33:17 +0000 (12:33 -0700)]
Return `{ok, Pid}` from config_listener_mon:subscribe/2
ILYA Khlopotov [Thu, 18 Aug 2016 19:58:04 +0000 (12:58 -0700)]
Add config:subscribe_for_changes/1
Add a new gen event handler which sends plain events to the Subscriber.
COUCHDB-3102
ILYA Khlopotov [Tue, 16 Aug 2016 22:56:34 +0000 (15:56 -0700)]
Fix compilation warning
ILYA Khlopotov [Mon, 15 Aug 2016 23:55:09 +0000 (16:55 -0700)]
Consider only needed handlers in n_handlers
When testing. Make sure we don't count other config_event handlers
present in the system.
Paul J. Davis [Wed, 10 Aug 2016 20:06:11 +0000 (15:06 -0500)]
Merge branch '3096-fix-config-listener-accumulation'
Paul J. Davis [Fri, 5 Aug 2016 19:41:58 +0000 (14:41 -0500)]
Fix config listener event handler registration
We rely on `gen_event:add_sup_handler/3` to remove handlers when the
process that registered for events exits. On master this was changed so
that config becomes the process that's monitored by gen_event. As such
any handler that is registered (say, for when an index is opened) adds a
handler to the config_event gen_event process. Since the config process
never exits these handlers are never removed.
The end result of all of this is that on a busy cluster the config_event
process will end up with millions of handlers consuming many gigabytes
of RAM.
This change creates a monitor process for every event handler. This
monitors the process wanting to listen for config changes and exits when
the requesting process exits. This means that we maintain our pure
callback API improvement while correctly removing handlers.
COUCHDB-3096
Paul J. Davis [Fri, 5 Aug 2016 19:49:17 +0000 (14:49 -0500)]
Clean up config_tests
This cleans up the config_tests both stylistically as well as removes
some race conditions around message passing from the config handler.
This also reformats and changes a lot of the tests so that we're using
consistent patterns through out the file. Unfortunately foreach and
foreachx are terrible constructs and require using the `?_test/1` macro
which is a bit annoying but ended up being the least worst approach I
could find.
COUCHDB-3096
Robert Newson [Fri, 5 Aug 2016 13:25:05 +0000 (14:25 +0100)]
Consult default.d/local.d for ini files
COUCHDB-3089
Russell Branca [Thu, 28 Apr 2016 23:29:33 +0000 (23:29 +0000)]
Merge branch 'enable-read-concurrency'
Russell Branca [Thu, 28 Apr 2016 23:22:19 +0000 (23:22 +0000)]
Enable read_concurrency for config ets table
Alexander Shorin [Wed, 27 Jan 2016 11:29:23 +0000 (14:29 +0300)]
Merge remote-tracking branch 'github/pr/7'
Jay Doane [Fri, 22 Jan 2016 05:40:14 +0000 (21:40 -0800)]
Don't set real log levels in tests
Setting the actual "log" "level" in tests triggers extraneous logging,
which is undesirable to have interleaved into test output.
Jay Doane [Thu, 21 Jan 2016 04:48:24 +0000 (20:48 -0800)]
Remove unnecessary application dependencies
This removes all but the minimum applications necessary to pass the tests.
Previously, references to some extra applications such as lager would cause
test failures in downstream builds which omitted those applications.
COUCHDB-2866
Alexander Shorin [Tue, 1 Dec 2015 14:22:21 +0000 (17:22 +0300)]
Update handlers counter in tests
Somehow, but here we depend on existed and registered config
changes listeners. This change respects recent couch_log update
which subscribes to config changes and eventually bumps this counter.
Klaus Trainer [Fri, 20 Nov 2015 15:44:40 +0000 (16:44 +0100)]
Fix typo in tests: s/beahiour/behaviour/
Alexander Shorin [Mon, 2 Nov 2015 06:23:02 +0000 (09:23 +0300)]
Update Travis config
- Clone faster
- Remove unsupported R14B04
- Use containers
- Use new better way to run specific app tests
ILYA Khlopotov [Wed, 9 Sep 2015 15:21:37 +0000 (08:21 -0700)]
Add tests for to_integer and to_float
ILYA Khlopotov [Wed, 9 Sep 2015 15:21:09 +0000 (08:21 -0700)]
Fix to_float(Int)
ILYA Khlopotov [Wed, 9 Sep 2015 14:32:26 +0000 (07:32 -0700)]
Fix to_integer and to_float
Alexander Shorin [Sun, 23 Aug 2015 10:07:45 +0000 (13:07 +0300)]
Integrate with Travis CI
Alexander Shorin [Sun, 23 Aug 2015 10:06:29 +0000 (13:06 +0300)]
Add LICENSE file
Robert Newson [Tue, 9 Jun 2015 19:30:41 +0000 (20:30 +0100)]
allow atoms too (chttpd, bind_address)
Alexander Shorin [Wed, 4 Feb 2015 15:43:14 +0000 (18:43 +0300)]
Merge remote-tracking branch 'iilyak/2561-make-config-API-consistent'
This closes #2
COUCHDB-2561
ILYA Khlopotov [Thu, 29 Jan 2015 21:01:21 +0000 (13:01 -0800)]
Enforce type verification for config:set/get
Check the type of given default value to make sure it is supported.
Raise error(badarg) from set/get on type missmatch.
Add tests for the feature
COUCHDB-2561
ILYA Khlopotov [Thu, 29 Jan 2015 20:55:27 +0000 (12:55 -0800)]
Callback driven API for config_listener behaviour
This implementaion replaces a mix of message driven and callback driven
API for config_listener. In particular it replaces gen_event_EXIT
message with a call to Module:handle_config_stop(Pid, Reason, State).
This fixes the problem of using config:listen_for_changes in supervisor
context where there is no way to handle arbitrary messages.
COUCHDB-2561
ILYA Khlopotov [Thu, 29 Jan 2015 20:53:11 +0000 (12:53 -0800)]
Change setup/teardown logic and enable some tests
COUCHDB-2561
ILYA Khlopotov [Thu, 29 Jan 2015 20:52:29 +0000 (12:52 -0800)]
Remove tests for dropped register functionality
COUCHDB-2561
Robert Newson [Fri, 10 Oct 2014 11:53:58 +0000 (12:53 +0100)]
start couch_stats last to ensure we load couch_log stats
Robert Newson [Fri, 10 Oct 2014 11:53:58 +0000 (12:53 +0100)]
start couch_stats for test suite
Russell Branca [Fri, 29 Aug 2014 20:31:46 +0000 (13:31 -0700)]
Use couch_eunit include paths
Russell Branca [Thu, 28 Aug 2014 22:35:06 +0000 (15:35 -0700)]
Disable problematic tests
Russell Branca [Thu, 28 Aug 2014 22:34:58 +0000 (15:34 -0700)]
The couch_httpd port is now 5986
Russell Branca [Thu, 28 Aug 2014 22:34:32 +0000 (15:34 -0700)]
Be explicit about starting and stopping deps
Russell Branca [Thu, 28 Aug 2014 21:24:24 +0000 (14:24 -0700)]
Switch to using config instead of couch_config
Russell Branca [Thu, 28 Aug 2014 21:07:21 +0000 (14:07 -0700)]
Use updated couch_eunit.hrl path macros
Russell Branca [Thu, 28 Aug 2014 21:02:04 +0000 (14:02 -0700)]
Update include paths
Russell Branca [Thu, 28 Aug 2014 21:00:27 +0000 (14:00 -0700)]
Move files out of test/couchdb into top level test/ folder
Alexander Shorin [Mon, 26 May 2014 05:46:06 +0000 (09:46 +0400)]
Port 083-config-no-files.t etap test suite to eunit
Merged into couch_config_tests suite.
Alexander Shorin [Mon, 26 May 2014 05:26:22 +0000 (09:26 +0400)]
Port 082-config-register.t etap test suite to eunit
Merged into couch_config_tests suite.
Alexander Shorin [Sun, 25 May 2014 18:02:19 +0000 (22:02 +0400)]
Port 081-config-override.t etap test suite to eunit
Merged into couch_config_tests suite.
Setup fixtures.
Alexander Shorin [Fri, 23 May 2014 05:29:22 +0000 (09:29 +0400)]
Port 080-config-get-set.t etap test suite to eunit
Robert Newson [Tue, 22 Apr 2014 10:05:19 +0000 (11:05 +0100)]
Merge remote-tracking branch 'upstream/master' into 1843-feature-bigcouch
Conflicts:
src/config.erl
Robert Newson [Wed, 12 Feb 2014 23:23:55 +0000 (23:23 +0000)]
Change API to function per level
Robert Newson [Wed, 12 Feb 2014 20:12:11 +0000 (20:12 +0000)]
Switch to couch_log
Paul J. Davis [Fri, 17 Jan 2014 21:25:36 +0000 (13:25 -0800)]
Let rebar build the module list
Robert Newson [Wed, 18 Dec 2013 14:04:59 +0000 (14:04 +0000)]
Build with rebar
Robert Newson [Thu, 13 Jun 2013 12:42:11 +0000 (13:42 +0100)]
Fix up copyright headers
Paul J. Davis [Tue, 12 Mar 2013 20:23:07 +0000 (15:23 -0500)]
Fix core etap tests
Paul J. Davis [Wed, 13 Mar 2013 06:47:34 +0000 (01:47 -0500)]
Add a config:reload/0 and HTTP trigger
Theoretically this should prevent all of those annoying test suite
failures when a test fails in with a temporary config set and fails to
undo its changes.
This works by storing the list of INI files in the config server and on
command will clear its ets table and re-read data from disk thus
clearing its cache of non-persisted values. Obviously this isn't
something that should be relied on in production settings.
Paul J. Davis [Mon, 11 Mar 2013 21:13:14 +0000 (16:13 -0500)]
Rewrite the boot procedure for the couch app
We had a lot of historical cruft lying around from before people knew
hot OTP worked. This does some cleanup to make things a bit more tidy
through this section but we still have a long ways to go.
Robert Newson [Wed, 5 Dec 2012 15:35:46 +0000 (15:35 +0000)]
Allow literal dot in config section names
BugzID: 15952
Paul J. Davis [Tue, 5 Mar 2013 22:35:12 +0000 (16:35 -0600)]
New build system for config
Paul J. Davis [Wed, 20 Mar 2013 10:04:53 +0000 (05:04 -0500)]
Remove Cloudant build system remnants
Robert Newson [Sun, 15 Dec 2013 11:16:45 +0000 (03:16 -0800)]
Merge pull request #5 from cloudant/25731-type-safety
Type-safe config:get and :set methods
Adam Kocoloski [Thu, 12 Dec 2013 12:19:00 +0000 (07:19 -0500)]
Guard get/set/delete to require list arguments
BugzID: 25731
Robert Newson [Tue, 3 Dec 2013 14:36:27 +0000 (14:36 +0000)]
Type-safe config:get and :set methods
BugzID: 25731
Robert Newson [Fri, 22 Nov 2013 16:51:18 +0000 (16:51 +0000)]
set module version to 1
Benjamin Anderson [Tue, 25 Jun 2013 20:49:13 +0000 (13:49 -0700)]
Merge pull request #4 from cloudant/20326-config-reasons
Add a "Reason" parameter to config:set and config:delete
Benjamin Anderson [Mon, 17 Jun 2013 18:35:04 +0000 (11:35 -0700)]
Add a "Reason" parameter to config:set and config:delete
This is intended to support better auditing of config changes. Existing code
and tools will be handled gracefully.
BugzID: 20326
Adam Kocoloski [Mon, 8 Apr 2013 20:24:55 +0000 (13:24 -0700)]
Merge pull request #3 from cloudant/15952-allow-dots
Allow literal dot in config section names
Robert Newson [Wed, 5 Dec 2012 15:35:46 +0000 (15:35 +0000)]
Allow literal dot in config section names
BugzID: 15952
Robert Newson [Mon, 11 Mar 2013 21:03:05 +0000 (14:03 -0700)]
Merge pull request #2 from cloudant/log-config-changes
Log all config changes
Robert Newson [Sun, 10 Mar 2013 20:02:20 +0000 (15:02 -0500)]
Log all config changes
Adam Kocoloski [Wed, 27 Feb 2013 19:04:09 +0000 (11:04 -0800)]
Merge pull request #1 from cloudant/13179-config-refactor
Allow multiple listeners per callback module
Adam Kocoloski [Wed, 27 Feb 2013 16:36:16 +0000 (11:36 -0500)]
Allow multiple listeners per callback module
Useful for couch_rep_httpc.
BugzID: 13179
Paul J. Davis [Fri, 22 Feb 2013 02:50:54 +0000 (20:50 -0600)]
Check that default config files exist
Avoid trying to load the default config files if they don't exist.