You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: CONTRIBUTING.md
+18-2
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
Welcome! Super happy to have you here.
1
+
## Welcome! Super happy to have you here.
2
2
3
3
A few things.
4
4
@@ -10,10 +10,26 @@ We're not keen on vendor-specific stuff in this library, but if there are change
10
10
11
11
Any contributions you make are expected to be tested with unit tests. You can validate these work with `gradle test`, or the automation itself will run them for you when you make a PR.
12
12
13
-
Your code is supposed to work with Java 11+.
13
+
Your code is supposed to work with Java 8+.
14
14
15
15
If you think we might be out of date with the spec, you can check that by invoking `python spec_finder.py` in the root of the repository. This will validate we have tests defined for all of the specification entries we know about.
16
16
17
17
If you're adding tests to cover something in the spec, use the `@Specification` annotation like you see throughout the test suites.
18
18
19
+
## Integration tests
20
+
21
+
The continuous integration runs a set of [gherkin integration tests](https://github.com/open-feature/test-harness/blob/main/features/evaluation.feature) using [`flagd`](https://github.com/open-feature/flagd). These tests do not run with the default maven profile. If you'd like to run them locally, you can start the flagd testbed with
22
+
23
+
```
24
+
docker run -p 8013:8013 ghcr.io/open-feature/flagd-testbed:latest
25
+
```
26
+
and then run
27
+
```
28
+
mvn test -P integration-test
29
+
```
30
+
31
+
## Releasing
32
+
33
+
See [releasing](./docs/release.md).
34
+
19
35
Thanks and looking forward to your issues and pull requests.
[](https://www.repostatus.org/#active)
[OpenFeature][openfeature-website] is an open standard that provides a vendor-agnostic, community-driven API for feature flagging that works with your favorite feature flag management tool.
Standardizing feature flags unifies tools and vendors behind a common interface which avoids vendor lock-in at the code level. Additionally, it offers a framework for building extensions and integrations and allows providers to focus on their unique value proposition.
55
30
56
-
For complete documentation, visit: https://docs.openfeature.dev/docs/category/concepts
31
+
## 🔍 Requirements:
57
32
58
-
## Requirements
59
33
- Java 8+ (compiler target is 1.8)
60
34
61
-
## Installation
35
+
Note that this library is intended to be used in server-side contexts and has not been evaluated for use in mobile devices.
62
36
63
-
### Add it to your build
37
+
## 📦 Installation:
38
+
39
+
### Maven
64
40
65
-
#### Maven
66
41
<!-- x-release-please-start-version -->
67
42
```xml
68
43
<dependency>
@@ -88,7 +63,7 @@ If you would like snapshot builds, this is the relevant repository information:
88
63
</repositories>
89
64
```
90
65
91
-
####Gradle
66
+
### Gradle
92
67
<!-- x-release-please-start-version -->
93
68
```groovy
94
69
dependencies {
@@ -97,51 +72,153 @@ dependencies {
97
72
```
98
73
<!-- x-release-please-end-version -->
99
74
100
-
### Configure it
101
-
To configure it, you'll need to add a provider to the global singleton `OpenFeatureAPI`. From there, you can generate a `Client` which is usable by your code. While you'll likely want a provider for your specific backend, we've provided a `NoOpProvider`, which simply returns the default passed in.
75
+
### Software Bill of Materials (SBOM)
76
+
77
+
We publish SBOMs with all of our releases as of 0.3.0. You can find them in Maven Central alongside the artifacts.
78
+
79
+
## 🌟 Features:
80
+
81
+
- support for various backend [providers](https://docs.openfeature.dev/docs/reference/concepts/provider)
82
+
- easy integration and extension via [hooks](https://docs.openfeature.dev/docs/reference/concepts/hooks)
We hold regular meetings which you can see [here](https://github.com/open-feature/community/#meetings-and-events).
114
104
115
-
We are also present on the `#openfeature` channel in the [CNCF slack](https://slack.cncf.io/).
105
+
### Context-aware evaluation:
116
106
117
-
## Developing
107
+
Sometimes the value of a flag must take into account some dynamic criteria about the application or user, such as the user location, IP, email address, or the location of the server.
108
+
In OpenFeature, we refer to this as [`targeting`](https://docs.openfeature.dev/specification/glossary#targeting).
109
+
If the flag system you're using supports targeting, you can provide the input data using the `EvaluationContext`.
The continuous integration runs a set of [gherkin integration tests](https://github.com/open-feature/test-harness/blob/main/features/evaluation.feature) using [`flagd`](https://github.com/open-feature/flagd). These tests do not run with the default maven profile. If you'd like to run them locally, you can start the flagd testbed with
130
+
### Providers:
122
131
132
+
To develop a provider, you need to create a new project and include the OpenFeature SDK as a dependency. This can be a new repository or included in [the existing contrib repository](https://github.com/open-feature/java-sdk-contrib) available under the OpenFeature organization. Finally, you’ll then need to write the provider itself. This can be accomplished by implementing the `FeatureProvider` interface exported by the OpenFeature SDK.
docker run -p 8013:8013 ghcr.io/open-feature/flagd-testbed:latest
125
-
```
126
-
and then run
127
-
```
128
-
mvn test -P integration-test
167
+
168
+
See [here](https://docs.openfeature.dev/docs/reference/technologies/server/java) for a catalog of available providers.
169
+
170
+
### Hooks:
171
+
172
+
Hooks are a mechanism that allow for the addition of arbitrary behavior at well-defined points of the flag evaluation life-cycle. Use cases include validation of the resolved flag value, modifying or adding data to the evaluation context, logging, telemetry, and tracking.
173
+
174
+
```java
175
+
publicclassMyHookimplementsHook {
176
+
/**
177
+
*
178
+
* @param ctx Information about the particular flag evaluation
179
+
* @param details Information about how the flag was resolved, including any resolved values.
180
+
* @param hints An immutable mapping of data for users to communicate to the hooks.
0 commit comments