Commit Graph

6 Commits

Author SHA1 Message Date
Todd Baert b49abf9506
feat!: flagSetMetadata in OFREP/ResolveAll, core refactors (#1540)
⚠️ This PR brings a breaking change to the
[flagd-core](https://pkg.go.dev/github.com/open-feature/flagd/core)
library: the `IStore` interface now returns an additional value
representing the flag set metadata. There are no breaking changes in
flagd's behavior.

Changes in flagd:

- returns flag set metadata as metadata for error flags (best effort)
- returns flag set metadata in OFREP and RPC calls
- moves metadata merging logic to evaluator (all flags inherent flag set
metadata, but can override, as as before but now reusable in flagd core)
- removes duplicated flag set metadata keys when the same flag set
metadata key exists in multiple sources

### To Test

- requires `curl`, `grpcurl`, and `jq`

#### RPC

```shell
grpcurl -import-path  /...../schemas/protobuf/flagd/evaluation/v1  -proto evaluation.proto -plaintext  localhost:8013 flagd.evaluation.v1.Service/ResolveAll | jq
```

### OFREP

```shell
curl --location 'http://localhost:8016/ofrep/v1/evaluate/flags'  --header 'Content-Type: application/json' --data '{"context": {"color": "yellow"}}'  | jq
```

### Sync

```shell
grpcurl -import-path /...../schemas/protobuf/flagd/sync/v1/ -proto sync.proto -plaintext   localhost:8015 flagd.sync.v1.FlagSyncService/FetchAllFlags    | jq -r .flagConfiguration  | jq
```

---------

Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
2025-01-31 10:54:47 -05:00
aasifkhan7 13fbbad4d8
feat: support flag metadata (#1476)
- Adds functionality to return flag metadata as part of the response.

Signed-off-by: Aasif Khan <aasifk106@gmail.com>
2025-01-15 14:49:03 -05:00
Dave 7ff33effcc
fix: readable error messages (#1325)
- Mapped the error codes to easier to read error messages
- Created unit test to check functionality

 #1100

---------

Signed-off-by: DBlanchard88 <davidblanchard88@gmail.com>
Signed-off-by: Dave <89858058+DBlanchard88@users.noreply.github.com>
Co-authored-by: Todd Baert <todd.baert@dynatrace.com>
2024-06-18 16:38:16 -04:00
Kavindu Dodanduwa ed5025d8f2
fix: fixes store merge when selector is used (#1322)
## This PR

This change address
https://github.com/open-feature/open-feature-operator/issues/664.

**Background**

We allow using multiple flag source CRDs when using flagd-proxy with
OFO. Internally, this converts to flagd using gRPC syncs with scopes,
where scopes specify the CRD names that need to source flags from.

**Bug**

We had two bugs, first gRPC resyncs never contained `scope`. This is why
we observed `unable to build sync from URI for target` message.
Secondly, we triggered resyncs only considering source equility. This is
not valid with flagd-proxy as we always go through the proxy for any
CRD.

**Fix**

Fix here adds scope to gRPC resyncs and considers both source and
selector equality when triggering a resync

**How to validate the fix**

[Use this
image](https://hub.docker.com/repository/docker/kavindudodanduwa/flagd/general)
with OFO sidecar image override

```helm upgrade --install openfeature openfeature/open-feature-operator --set sidecarConfiguration.image.tag=1,sidecarConfiguration.image.repository=kavindudodanduwa/flagd```

Signed-off-by: Kavindu Dodanduwa <kavindudodanduwa@gmail.com>
2024-06-06 09:36:11 -04:00
Kavindu Dodanduwa 9d12fc2070
feat: OFREP support for flagd (#1247)
## This PR

Fixes #1245 and introduce OFREP support for flagd

OFREP service runs on 8016 by default and can simply use curl for flag
evaluations,

```shell
curl -X POST 'http://localhost:8016/ofrep/v1/evaluate/flags/myBoolFlag'
```

NOTE - This PR touch several files as I had to migrate from
`github.com/golang/mock/gomock` to `go.uber.org/mock/gomock`. This is
because https://github.com/golang/mock is no longer maintained.

---------

Signed-off-by: Kavindu Dodanduwa <kavindudodanduwa@gmail.com>
Signed-off-by: Kavindu Dodanduwa <Kavindu-Dodan@users.noreply.github.com>
Co-authored-by: Giovanni Liva <giovanni.liva@dynatrace.com>
Co-authored-by: Florian Bacher <florian.bacher@dynatrace.com>
2024-03-27 10:03:01 -07:00
James Milligan ed2993cd67
feat: Restructure for monorepo setup (#486)
<!-- Please use this template for your pull request. -->
<!-- Please use the sections that you need and delete other sections -->

## This PR
<!-- add the description of the PR here -->

- adds this new feature

### Related Issues
<!-- add here the GitHub issue that this PR resolves if applicable -->

https://github.com/open-feature/flagd/issues/435
https://github.com/open-feature/flagd/issues/480
https://github.com/open-feature/flagd/issues/481

### Notes
<!-- any additional notes for this PR -->

### Follow-up Tasks
<!-- anything that is related to this PR but not done here should be
noted under this section -->
<!-- if there is a need for a new issue, please link it here -->

### How to test
<!-- if applicable, add testing instructions under this section -->

---------

Signed-off-by: James Milligan <james@omnant.co.uk>
2023-03-10 15:29:23 +00:00