Skip to content
This repository was archived by the owner on May 30, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
46476dd
capture variation index and new flag properties in events
eli-darkly Mar 22, 2018
28fd53f
move EventProcessor out of index.js
eli-darkly Mar 22, 2018
4a247e5
implement summary events
eli-darkly Mar 22, 2018
6d58042
misc fixes
eli-darkly Mar 22, 2018
2f6e5a1
typo
eli-darkly Mar 22, 2018
53f61c4
add test for 401 error
eli-darkly Mar 23, 2018
e0aed40
fix test to catch promise rejections
eli-darkly Mar 23, 2018
3151932
revise tests using Nock
eli-darkly Mar 23, 2018
ccafa73
fix promise/callback utility: avoid rejecting and returning the promi…
apucacao Mar 26, 2018
1a80d2b
remove unneeded assertion
apucacao Mar 26, 2018
04a1a4e
call done()
apucacao Mar 26, 2018
6672d4a
Merge branch 'summary-events' into eb/ch12906/summary-events
eli-darkly Mar 27, 2018
3887b99
Merge branch 'summary-events' into eb/ch12906/summary-events
eli-darkly Mar 30, 2018
45b8fda
Merge pull request #63 from launchdarkly/ag/ch15352/fix-promise-callb…
eli-darkly Apr 5, 2018
cb608bf
Merge branch 'summary-events' into eb/ch12906/summary-events
eli-darkly Apr 5, 2018
2ba1d2c
explicit return
eli-darkly Apr 5, 2018
6e3ba85
debug events should be in addition to regular events, & should always…
eli-darkly Apr 10, 2018
ecf667b
add unit test
eli-darkly Apr 10, 2018
961042d
retry event post once after a 5xx error or connection error
eli-darkly Apr 10, 2018
910ad4a
move user key cache out of summarizer, misc cleanup
eli-darkly Apr 12, 2018
f311122
change UserFilter options and method to camelcase
eli-darkly Apr 12, 2018
b37b65c
change internally-used symbols to camelcase
eli-darkly Apr 12, 2018
9f4ca02
enforce camelcase everywhere else, add deprecation warnings, refactor…
eli-darkly Apr 13, 2018
df9c2e5
rm redundant default
eli-darkly Apr 13, 2018
028ff1d
don't need a guard on the logger, there will always be one
eli-darkly Apr 13, 2018
40aead4
add a stub logger in tests
eli-darkly Apr 13, 2018
c77f2a5
Merge branch 'master' into summary-events
eli-darkly Apr 18, 2018
2a40f5b
Merge branch 'summary-events' into eb/ch12906/summary-events
eli-darkly Apr 18, 2018
259546f
Merge branch 'eb/ch12906/summary-events' into eb/ch16018/camelcase
eli-darkly Apr 18, 2018
5f3c32d
fix merge
eli-darkly Apr 18, 2018
1a59ec4
Merge branch 'eb/ch12906/summary-events' into eb/ch16018/camelcase
eli-darkly Apr 18, 2018
966b91e
Merge branch 'eb/ch12906/summary-events' into eb/ch15679/retry-event-…
eli-darkly Apr 18, 2018
c9a7cba
add schema header to event payload
eli-darkly Apr 18, 2018
6ee9a3d
Merge branch 'eb/ch12906/summary-events' into eb/ch16018/camelcase
eli-darkly Apr 18, 2018
cbcdbc4
Merge branch 'eb/ch12906/summary-events' into eb/ch15679/retry-event-…
eli-darkly Apr 18, 2018
3d40ce7
Merge branch 'eb/ch15679/retry-event-post' into eb/ch16018/camelcase
eli-darkly Apr 18, 2018
599b481
Merge pull request #62 from launchdarkly/eb/ch12906/summary-events
eli-darkly Apr 23, 2018
692b4ff
Merge pull request #66 from launchdarkly/eb/ch15679/retry-event-post
eli-darkly Apr 23, 2018
b7c506e
Merge branch 'eb/ch16018/camelcase' into summary-events
eli-darkly Apr 23, 2018
462b397
fix behavior of config defaults when a value is null
eli-darkly Apr 23, 2018
3ed1951
Merge pull request #70 from launchdarkly/eb/fix-config-defaults
eli-darkly Apr 23, 2018
00048d1
fix allFlags method
eli-darkly Apr 23, 2018
2cfc5f2
fix store initialization check
eli-darkly Apr 23, 2018
5ff1ec5
Merge pull request #71 from launchdarkly/eb/more-fixes
eli-darkly Apr 23, 2018
47227ca
re-add redundant key property to identify event
eli-darkly Apr 23, 2018
29cba7f
fix unit tests
eli-darkly Apr 24, 2018
e7f201e
send as much of a feature event as possible even if user is invalid
eli-darkly Apr 25, 2018
56eb454
Merge pull request #72 from launchdarkly/eb/events-for-bad-users
eli-darkly Apr 25, 2018
7e2e28b
run two CI builds in parallel for different Node versions
eli-darkly Apr 27, 2018
f750898
fix template syntax
eli-darkly Apr 27, 2018
d92f424
add variation index to feature events and summary counters
eli-darkly Apr 28, 2018
153b3ab
allow a custom updateProcessor for testing
eli-darkly Apr 28, 2018
054d5fd
Merge pull request #75 from launchdarkly/eb/update-processor-stub
eli-darkly Apr 30, 2018
fb2d400
Merge pull request #74 from launchdarkly/eb/ch16654/variation-index
eli-darkly Apr 30, 2018
a0a6fd2
update event schema version
eli-darkly Apr 30, 2018
f34cedc
Merge pull request #76 from launchdarkly/eb/schema-version
eli-darkly May 3, 2018
4c8fcc2
Merge pull request #73 from launchdarkly/eb/ch16647/multi-node-versio…
eli-darkly May 3, 2018
5931505
Merge branch 'master' into summary-events
eli-darkly May 3, 2018
71fb66f
fix merge
eli-darkly May 3, 2018
acb0df9
fix transitive dependency on buggy version of "hoek"
eli-darkly May 10, 2018
03d9323
Merge pull request #77 from launchdarkly/eb/ch17242/fix-transitive-de…
eli-darkly May 10, 2018
fa8e52b
move dependency constraint out of devDependencies
eli-darkly May 10, 2018
891bbb3
Merge pull request #78 from launchdarkly/eb/ch17242/dependency-fix-2
eli-darkly May 10, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 30 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,35 @@
version: 2

workflows:
version: 2
test:
jobs:
- oldest-long-term-support-release
- current-release

node-template: &node-template
steps:
- checkout
- run: echo "Node version:" `node --version`
- run: npm install
- run:
command: npm test
environment:
JEST_JUNIT_OUTPUT: "reports/junit/js-test-results.xml"
- store_test_results:
path: reports/junit
- store_artifacts:
path: reports/junit

jobs:
build:
oldest-long-term-support-release:
<<: *node-template
docker:
- image: circleci/node:6
- image: redis
steps:
- checkout
- run: npm install
- run:
command: npm test
environment:
JEST_JUNIT_OUTPUT: "reports/junit/js-test-results.xml"
- store_test_results:
path: reports/junit
- store_artifacts:
path: reports/junit

current-release:
<<: *node-template
docker:
- image: circleci/node:latest
- image: redis
103 changes: 103 additions & 0 deletions configuration.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
var winston = require('winston');
var InMemoryFeatureStore = require('./feature_store');
var messages = require('./messages');
var package_json = require('./package.json');

module.exports = (function() {
var defaults = {
baseUri: 'https://app.launchdarkly.com',
streamUri: 'https://stream.launchdarkly.com',
eventsUri: 'https://events.launchdarkly.com',
stream: true,
sendEvents: true,
timeout: 5,
capacity: 1000,
flushInterval: 5,
pollInterval: 30,
offline: false,
useLdd: false,
allAttributesPrivate: false,
privateAttributeNames: [],
userKeysCapacity: 1000,
userKeysFlushInterval: 300,
featureStore: InMemoryFeatureStore()
};

var deprecatedOptions = {
base_uri: 'baseUri',
stream_uri: 'streamUri',
events_uri: 'eventsUri',
send_events: 'sendEvents',
flush_interval: 'flushInterval',
poll_interval: 'pollInterval',
proxy_host: 'proxyHost',
proxy_port: 'proxyPort',
proxy_auth: 'proxyAuth',
feature_store: 'featureStore',
use_ldd: 'useLdd',
all_attributes_private: 'allAttributesPrivate',
private_attribute_names: 'privateAttributeNames'
};

function checkDeprecatedOptions(config) {
Object.keys(deprecatedOptions).forEach(function(oldName) {
if (config[oldName] !== undefined) {
var newName = deprecatedOptions[oldName];
config.logger.warn(messages.deprecated(oldName, newName));
if (config[newName] === undefined) {
config[newName] = config[oldName];
}
delete config[oldName];
}
});
}

function applyDefaults(config, defaults) {
// This works differently from Object.assign() in that it will *not* override a default value
// if the provided value is explicitly set to null.
var ret = Object.assign({}, config);
Object.keys(defaults).forEach(function(name) {
if (ret[name] === undefined || ret[name] === null) {
ret[name] = defaults[name];
}
});
return ret;
}

function canonicalizeUri(uri) {
return uri.replace(/\/+$/, "");
}

function validate(options) {
var config = Object.assign({}, options || {});

config.userAgent = 'NodeJSClient/' + package_json.version;
config.logger = (config.logger ||
new winston.Logger({
level: 'info',
transports: [
new (winston.transports.Console)(({
formatter: function(options) {
return '[LaunchDarkly] ' + (options.message ? options.message : '');
}
})),
]
})
);

checkDeprecatedOptions(config);

config = applyDefaults(config, defaults);

config.baseUri = canonicalizeUri(config.baseUri);
config.streamUri = canonicalizeUri(config.streamUri);
config.eventsUri = canonicalizeUri(config.eventsUri);
config.pollInterval = config.pollInterval > 30 ? config.pollInterval : 30;

return config;
}

return {
validate: validate
};
})();
Loading