Skip to content

Commit 31eb322

Browse files
authored
Merge branch 'main' into copilot/update-selector-handling
Signed-off-by: Simon Schrottner <[email protected]>
2 parents 323bb33 + 17fd726 commit 31eb322

File tree

146 files changed

+11650
-2459
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+11650
-2459
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ node_modules
1616
*.launch
1717
.settings/
1818
*.sublime-workspace
19+
.cursor
1920

2021
# IDE - VSCode
2122
.vscode/*

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@
1717
[submodule "libs/shared/flagd-core/spec"]
1818
path = libs/shared/flagd-core/spec
1919
url = https://github.com/open-feature/spec
20+
[submodule "libs/providers/go-feature-flag/wasm-releases"]
21+
path = libs/providers/go-feature-flag/wasm-releases
22+
url = https://github.com/go-feature-flag/wasm-releases.git

.release-please-manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
"libs/providers/launchdarkly-client": "0.3.3",
99
"libs/providers/go-feature-flag-web": "0.2.6",
1010
"libs/shared/flagd-core": "1.1.0",
11-
"libs/shared/ofrep-core": "1.1.0",
11+
"libs/shared/ofrep-core": "2.0.0",
1212
"libs/providers/ofrep": "0.2.1",
13-
"libs/providers/ofrep-web": "0.3.3",
13+
"libs/providers/ofrep-web": "0.3.5",
1414
"libs/providers/flipt": "0.1.3",
1515
"libs/providers/flagsmith-client": "0.1.3",
1616
"libs/providers/flipt-web": "0.1.5",

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@
187187
same "printed page" as the copyright notice for easier
188188
identification within third-party archives.
189189

190-
Copyright [yyyy] [name of copyright owner]
190+
Copyright OpenFeature Maintainers
191191

192192
Licensed under the Apache License, Version 2.0 (the "License");
193193
you may not use this file except in compliance with the License.

libs/providers/flagd/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"current-version": "echo $npm_package_version"
88
},
99
"peerDependencies": {
10-
"@grpc/grpc-js": "~1.8.0 || ~1.9.0 || ~1.10.0 || ~1.11.0 || ~1.12.0 || ~1.13.0",
10+
"@grpc/grpc-js": "~1.8.0 || ~1.9.0 || ~1.10.0 || ~1.11.0 || ~1.12.0 || ~1.13.0 || ~1.14.0",
1111
"@openfeature/server-sdk": "^1.17.0"
1212
},
1313
"dependencies": {
Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,6 @@
11
import { getGherkinTestPath } from '@openfeature/flagd-core';
22

3-
export const FLAGD_NAME = 'flagd';
43
export const UNSTABLE_CLIENT_NAME = 'unstable';
54
export const UNAVAILABLE_CLIENT_NAME = 'unavailable';
65

76
export const GHERKIN_FLAGD = getGherkinTestPath('*.feature');
8-
export const CONNECTION_FEATURE = getGherkinTestPath('connection.feature');
9-
export const CONTEXT_ENRICHMENT_FEATURE = getGherkinTestPath('contextEnrichment.feature');
10-
export const EVALUATION_FEATURE = getGherkinTestPath('evaluation.feature');
11-
export const EVENTS_FEATURE = getGherkinTestPath('events.feature');
12-
export const METADATA_FEATURE = getGherkinTestPath('metadata.feature');
13-
export const RPC_CACHING_FEATURE = getGherkinTestPath('rpc-caching.feature');
14-
export const SELECTOR_FEATURE = getGherkinTestPath('selector.feature');
15-
export const TARGETING_FEATURE = getGherkinTestPath('targeting.feature');
16-
export const GHERKIN_EVALUATION_FEATURE = getGherkinTestPath(
17-
'evaluation.feature',
18-
'spec/specification/assets/gherkin/',
19-
);

libs/providers/flagd/src/e2e/step-definitions/providerSteps.ts

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { ProviderStatus } from '@openfeature/server-sdk';
12
import { OpenFeature } from '@openfeature/server-sdk';
23
import { FlagdContainer } from '../tests/flagdContainer';
34
import type { State, Steps } from './state';
@@ -6,7 +7,7 @@ import type { FlagdProviderOptions } from '../../lib/configuration';
67

78
export const providerSteps: Steps =
89
(state: State) =>
9-
({ given, when, then }) => {
10+
({ given, when, then, and }) => {
1011
const container: FlagdContainer = FlagdContainer.build();
1112
beforeAll(async () => {
1213
console.log('Setting flagd provider...');
@@ -33,26 +34,29 @@ export const providerSteps: Steps =
3334
const flagdOptions: FlagdProviderOptions = {
3435
resolverType: state.resolverType,
3536
deadlineMs: 2000,
37+
...state.config,
38+
...state.options,
3639
};
40+
3741
let type = 'default';
3842
switch (providerType) {
39-
default:
40-
flagdOptions['port'] = container.getPort(state.resolverType);
41-
if (state?.options?.['selector']) {
42-
flagdOptions['selector'] = state?.options?.['selector'] as string;
43-
}
44-
break;
4543
case 'unavailable':
4644
flagdOptions['port'] = 9999;
4745
break;
4846
case 'ssl':
4947
// TODO: modify this to support ssl
5048
flagdOptions['port'] = container.getPort(state.resolverType);
51-
if (state?.config?.selector) {
52-
flagdOptions['selector'] = state.config.selector;
53-
}
5449
type = 'ssl';
5550
break;
51+
case 'stable':
52+
flagdOptions['port'] = container.getPort(state.resolverType);
53+
break;
54+
case 'syncpayload':
55+
flagdOptions['port'] = container.getPort(state.resolverType);
56+
type = 'sync-payload';
57+
break;
58+
default:
59+
throw new Error('unknown provider type: ' + providerType);
5660
}
5761

5862
await fetch('http://' + container.getLaunchpadUrl() + '/start?config=' + type);
@@ -67,6 +71,21 @@ export const providerSteps: Steps =
6771
state.providerType = providerType;
6872
});
6973

74+
function mapProviderState(state: string): ProviderStatus {
75+
const mappedState = state.toUpperCase().replace('-', '_');
76+
const status = Object.values(ProviderStatus).find((s) => s === mappedState);
77+
78+
if (!status) {
79+
throw new Error(`Unknown provider status: ${state}`);
80+
}
81+
82+
return status;
83+
}
84+
85+
then(/^the client should be in (.*) state/, (providerState: string) => {
86+
expect(state.client?.providerStatus).toBe(mapProviderState(providerState));
87+
});
88+
7089
when(/^the connection is lost for (\d+)s$/, async (time) => {
7190
console.log('stopping flagd');
7291
await fetch('http://' + container.getLaunchpadUrl() + '/restart?seconds=' + time);

libs/providers/flagd/src/e2e/step-definitions/utils.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ export function mapValueToType(value: string, type: string): any {
1919
return value.toLowerCase() as ResolverType;
2020
case 'CacheType':
2121
return value as CacheOption;
22+
case 'StringList':
23+
return value.split(',').map((item) => item.trim());
2224
case 'Object':
2325
if (value == 'null') {
2426
return undefined;

libs/providers/flagd/src/e2e/tests/in-process.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ describe('in-process', () => {
2222
// remove filters as we add support for features
2323
// see: https://github.com/open-feature/js-sdk-contrib/issues/1096 and child issues
2424
tagFilter:
25-
'@in-process and not @targetURI and not @customCert and not @events and not @sync and not @grace and not @metadata and not @contextEnrichment',
25+
'@in-process and not @targetURI and not @forbidden and not @customCert and not @events and not @sync and not @grace and not @metadata and not @unixsocket',
2626
scenarioNameTemplate: (vars) => {
2727
return `${vars.scenarioTitle} (${vars.scenarioTags.join(',')} ${vars.featureTags.join(',')})`;
2828
},

libs/providers/flagd/src/e2e/tests/rpc.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ describe('rpc', () => {
2323
tagFilter:
2424
// remove filters as we add support for features
2525
// see: https://github.com/open-feature/js-sdk-contrib/issues/1096 and child issues
26-
'@rpc and not @targetURI and not @customCert and not @events and not @stream and not @grace and not @metadata and not @contextEnrichment and not @caching',
26+
'@rpc and not @targetURI and not @customCert and not @forbidden and not @events and not @stream and not @grace and not @metadata and not @caching and not @unixsocket',
2727
scenarioNameTemplate: (vars) => {
2828
return `${vars.scenarioTitle} (${vars.scenarioTags.join(',')} ${vars.featureTags.join(',')})`;
2929
},

0 commit comments

Comments
 (0)