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
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,9 +18,13 @@ To install Hatch, just run `pip install hatch`.
18
18
19
19
You will also need to setup the `pre-commit` hooks. Run `pre-commit install` in the root directory of the repository. If you don't have `pre-commit` installed, you can install it with `pip install pre-commit`.
20
20
21
+
> **Note**
22
+
> Currently our protobuf files will be generated during `hatch build`
23
+
> Please run this command once, to generate all necessary files.
24
+
21
25
### Testing
22
26
23
-
Run tests by entering the package directory and running `hatch run test`.
27
+
Run tests by entering the package directory and running `hatch test`.
24
28
25
29
We use `pytest` for our unit testing, making use of `parametrized` to inject cases at scale.
The flagd provider can operate in two modes: [RPC](#remote-resolver-rpc) (evaluation takes place in flagd, via gRPC calls) or [in-process](#in-process-resolver) (evaluation takes place in-process, with the provider getting a ruleset from a compliant sync-source).
14
+
15
+
### Remote resolver (RPC)
16
+
17
+
This is the default mode of operation of the provider.
18
+
In this mode, `FlagdProvider` communicates with [flagd](https://github.com/open-feature/flagd) via the gRPC protocol.
19
+
Flag evaluations take place remotely at the connected flagd instance.
20
+
13
21
Instantiate a new FlagdProvider instance and configure the OpenFeature SDK to use it:
14
22
15
23
```python
@@ -19,7 +27,9 @@ from openfeature.contrib.provider.flagd import FlagdProvider
19
27
api.set_provider(FlagdProvider())
20
28
```
21
29
22
-
To use in-process evaluation in offline mode with a file as source:
30
+
### In-process resolver
31
+
32
+
This mode performs flag evaluations locally (in-process).
| context_enricher | - | sync-metadata to evaluation context mapping function | function | identity function | in-process |
70
+
| offline_pollIntervalMs | FLAGD_OFFLINE_POLL_MS | poll interval for reading offlineFlagSourcePath | int | 5000 | in-process |
71
+
-->
72
+
73
+
> [!NOTE]
74
+
> Some configurations are only applicable for RPC resolver.
75
+
76
+
<!--
77
+
### Unix socket support
78
+
Unix socket communication with flagd is facilitated by usaging of the linux-native `epoll` library on `linux-x86_64`
79
+
only (ARM support is pending the release of `netty-transport-native-epoll` v5).
80
+
Unix sockets are not supported on other platforms or architectures.
81
+
-->
82
+
83
+
### Reconnection
84
+
85
+
Reconnection is supported by the underlying gRPC connections.
86
+
If the connection to flagd is lost, it will reconnect automatically.
87
+
A failure to connect will result in an [error event](https://openfeature.dev/docs/reference/concepts/events#provider_error) from the provider, though it will attempt to reconnect
88
+
indefinitely.
89
+
90
+
### Deadlines
91
+
92
+
Deadlines are used to define how long the provider waits to complete initialization or flag evaluations.
93
+
They behave differently based on the resolver type.
94
+
95
+
#### Deadlines with Remote resolver (RPC)
96
+
97
+
If the remote evaluation call is not completed within this deadline, the gRPC call is terminated with the error `DEADLINE_EXCEEDED`
98
+
and the evaluation will default.
99
+
100
+
### TLS
101
+
102
+
TLS is available in situations where flagd is running on another host.
103
+
104
+
<!--
105
+
You may optionally supply an X.509 certificate in PEM format. Otherwise, the default certificate store will be used.
0 commit comments