Skip to content

Commit

Permalink
Merge branch 'main' into export-api
Browse files Browse the repository at this point in the history
* main:
  feat: add LiteFS example for Flipt in the examples directory (#2297)
  docs: add legoheld as a contributor for code (#2321)
  chore: update Clients in readme (#2320)
  chore: prep v1.30 (#2319)
  chore(deps): bump github.com/docker/docker in /_tools (#2314)
  chore(deps): bump github.com/docker/docker in /build (#2315)
  feat: add flag key to variant and boolean evaluation responses (#2318)
  chore(deps): bump github.com/aws/aws-sdk-go-v2/config (#2310)
  chore(deps): bump github.com/redis/go-redis/v9 from 9.2.0 to 9.2.1 (#2309)
  • Loading branch information
markphelps committed Nov 1, 2023
2 parents d941f29 + a3cff90 commit 1bf45e0
Show file tree
Hide file tree
Showing 25 changed files with 445 additions and 128 deletions.
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,15 @@
"contributions": [
"code"
]
},
{
"login": "legoheld",
"name": "legoheld",
"avatar_url": "https://avatars.githubusercontent.com/u/4560982?v=4",
"profile": "https://github.com/legoheld",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 7,
Expand Down
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,24 @@
This format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [v1.30.0](https://github.com/flipt-io/flipt/releases/tag/v1.30.0) - 2023-10-31

### Added

- add flag key to variant and boolean evaluation responses (#2318)
- add subject to authentication metadata for auditing (#2299)
- `git`: support SSH authentication (#2272)

### Changed

- `ui`: redux all flag and variant state management (#2301)
- dependency updates

### Fixed

- readOnly config option should be read_only (#2298)
- Audit log path will be created if doesn't exist (#2295)

## [v1.29.1](https://github.com/flipt-io/flipt/releases/tag/v1.29.1) - 2023-10-26

### Fixed
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,17 +209,18 @@ The [Flipt REST API](https://www.flipt.io/docs/reference/overview) can also be u
| -------- | ------- | ------ |
| [Go](./sdk/go) | ![go](https://img.shields.io/github/v/tag/flipt-io/flipt?filter=sdk%2Fgo%2Fv*&label=go&link=https%3A%2F%2Fpkg.go.dev%2Fgo.flipt.io%2Fflipt%2Fsdk%2Fgo) | ![stable](https://img.shields.io/badge/status-stable-green) |
| [Node/TypeScript](https://github.com/flipt-io/flipt-node) | [![npm](https://img.shields.io/npm/v/@flipt-io/flipt)](https://www.npmjs.com/package/@flipt-io/flipt) | ![stable](https://img.shields.io/badge/status-stable-green) |
| [Java](https://github.com/flipt-io/flipt-java) | ![Maven Central](https://img.shields.io/maven-central/v/io.flipt/flipt-java) | ![hardening](https://img.shields.io/badge/status-hardening-orange) |
| [Java](https://github.com/flipt-io/flipt-java) | [![Maven Central](https://img.shields.io/maven-central/v/io.flipt/flipt-java)](https://central.sonatype.com/artifact/io.flipt/flipt-java) | ![stable](https://img.shields.io/badge/status-stable-green) |
| [Python](https://github.com/flipt-io/flipt-python) | [![pypi](https://img.shields.io/pypi/v/flipt.svg)](https://pypi.org/project/flipt) | ![hardening](https://img.shields.io/badge/status-hardening-orange) |
| [Rust](https://github.com/flipt-io/flipt-rust) | [![crates.io](https://img.shields.io/crates/v/flipt.svg)](https://crates.io/crates/flipt) | ![hardening](https://img.shields.io/badge/status-hardening-orange) |
| [PHP](https://github.com/flipt-io/flipt-php) | [![Packagist](https://img.shields.io/packagist/v/flipt-io/flipt)](https://packagist.org/packages/flipt-io/flipt) | ![beta](https://img.shields.io/badge/status-beta-yellow) |

### GRPC Client Libraries

| Language | Version | Status |
| -------- | ------- | ------ |
| [Go](./sdk/go) | ![go](https://img.shields.io/github/v/tag/flipt-io/flipt?filter=sdk%2Fgo%2Fv*&label=go&link=https%3A%2F%2Fpkg.go.dev%2Fgo.flipt.io%2Fflipt%2Fsdk%2Fgo) | ![stable](https://img.shields.io/badge/status-stable-green) |
| [Ruby](https://github.com/flipt-io/flipt-grpc-ruby) | ![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/flipt-io/flipt-grpc-ruby?color=red&label=gem&sort=semver) | ![stable](https://img.shields.io/badge/status-stable-green) |
| [.NET](https://github.com/flipt-io/flipt-grpc-dotnet) | ![Nuget](https://img.shields.io/nuget/v/flipt.grpc) | ![beta](https://img.shields.io/badge/status-beta-yellow) |
| [.NET](https://github.com/flipt-io/flipt-grpc-dotnet) | ![Nuget](https://img.shields.io/nuget/v/flipt.grpc) | ![hardening](https://img.shields.io/badge/status-hardening-orange) |

### Generate Your Own

Expand Down Expand Up @@ -367,6 +368,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center" valign="top" width="14.28%"><a href="https://github.com/testwill"><img src="https://avatars.githubusercontent.com/u/8717479?v=4?s=100" width="100px;" alt="guangwu"/><br /><sub><b>guangwu</b></sub></a><br /><a href="https://github.com/flipt-io/flipt/commits?author=testwill" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Provinite"><img src="https://avatars.githubusercontent.com/u/13734094?v=4?s=100" width="100px;" alt="Collin Driscoll"/><br /><sub><b>Collin Driscoll</b></sub></a><br /><a href="https://github.com/flipt-io/flipt/commits?author=Provinite" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Jamess-Lucass"><img src="https://avatars.githubusercontent.com/u/23193271?v=4?s=100" width="100px;" alt="James"/><br /><sub><b>James</b></sub></a><br /><a href="https://github.com/flipt-io/flipt/commits?author=Jamess-Lucass" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/legoheld"><img src="https://avatars.githubusercontent.com/u/4560982?v=4?s=100" width="100px;" alt="legoheld"/><br /><sub><b>legoheld</b></sub></a><br /><a href="https://github.com/flipt-io/flipt/commits?author=legoheld" title="Code">💻</a></td>
</tr>
</tbody>
</table>
Expand Down
2 changes: 1 addition & 1 deletion _tools/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/denis-tingaikin/go-header v0.4.3 // indirect
github.com/docker/distribution v2.8.2+incompatible // indirect
github.com/docker/docker v23.0.3+incompatible // indirect
github.com/docker/docker v24.0.7+incompatible // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/esimonov/ifshort v1.0.4 // indirect
Expand Down
4 changes: 2 additions & 2 deletions _tools/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ github.com/denis-tingaikin/go-header v0.4.3 h1:tEaZKAlqql6SKCY++utLmkPLd6K8IBM20
github.com/denis-tingaikin/go-header v0.4.3/go.mod h1:0wOCWuN71D5qIgE2nz9KrKmuYBAC2Mra5RassOIQ2/c=
github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8=
github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/docker v23.0.3+incompatible h1:9GhVsShNWz1hO//9BNg/dpMnZW25KydO4wtVxWAIbho=
github.com/docker/docker v23.0.3+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v24.0.7+incompatible h1:Wo6l37AuwP3JaMnZa226lzVXGA3F9Ig1seQen0cKYlM=
github.com/docker/docker v24.0.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ=
github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec=
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
Expand Down
16 changes: 8 additions & 8 deletions build/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@ require (
github.com/aws/aws-sdk-go-v2/config v1.18.28
github.com/aws/aws-sdk-go-v2/service/s3 v1.37.0
github.com/containerd/containerd v1.6.19
github.com/docker/docker v23.0.5+incompatible
github.com/docker/docker v24.0.7+incompatible
github.com/go-git/go-billy/v5 v5.4.1
github.com/go-git/go-git/v5 v5.7.0
github.com/gofrs/uuid v4.4.0+incompatible
github.com/google/go-cmp v0.5.9
github.com/google/go-github/v53 v53.2.0
github.com/google/uuid v1.3.0
github.com/google/uuid v1.3.1
github.com/magefile/mage v1.15.0
github.com/opencontainers/image-spec v1.1.0-rc2
github.com/stretchr/testify v1.8.4
github.com/tsenart/vegeta v12.7.0+incompatible
go.flipt.io/flipt v1.23.3
go.flipt.io/flipt/rpc/flipt v1.28.0
go.flipt.io/flipt/sdk/go v0.5.0
go.flipt.io/flipt/rpc/flipt v1.30.0
go.flipt.io/flipt/sdk/go v0.6.1
golang.org/x/mod v0.12.0
golang.org/x/sync v0.3.0
google.golang.org/grpc v1.58.3
google.golang.org/grpc v1.59.0
google.golang.org/protobuf v1.31.0
gopkg.in/yaml.v2 v2.4.0
sigs.k8s.io/kind v0.17.0
Expand Down Expand Up @@ -107,9 +107,9 @@ require (
golang.org/x/text v0.13.0 // indirect
golang.org/x/tools v0.12.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20231009173412-8bfb1ae86b6c // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20231009173412-8bfb1ae86b6c // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231009173412-8bfb1ae86b6c // indirect
google.golang.org/genproto v0.0.0-20231030173426-d783a09b4405 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20231030173426-d783a09b4405 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gotest.tools/v3 v3.1.0 // indirect
Expand Down
13 changes: 11 additions & 2 deletions build/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ github.com/dgryski/go-gk v0.0.0-20200319235926-a69029f61654/go.mod h1:qm+vckxRlD
github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA=
github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8=
github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/docker v23.0.5+incompatible h1:DaxtlTJjFSnLOXVNUBU1+6kXGz2lpDoEAH6QoxaSg8k=
github.com/docker/docker v23.0.5+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/docker v24.0.7+incompatible h1:Wo6l37AuwP3JaMnZa226lzVXGA3F9Ig1seQen0cKYlM=
github.com/docker/docker v24.0.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ=
github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec=
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
Expand Down Expand Up @@ -153,6 +153,7 @@ github.com/google/safetext v0.0.0-20220905092116-b49f7bc46da2/go.mod h1:Tv1PlzqC
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo=
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 h1:RtRsiaGvWxcwd8y3BiRZxsylPT8hLWZ5SPcfI+3IDNk=
Expand Down Expand Up @@ -391,17 +392,25 @@ google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98
google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20231009173412-8bfb1ae86b6c h1:ml3TAUoIIzQUtX88s/icpXCFW9lV5VwsuIuS1htNjKY=
google.golang.org/genproto v0.0.0-20231009173412-8bfb1ae86b6c/go.mod h1:MugzuwC+GYOxyF0XUGQvsT97bOgWCV7MM1XMc5FZv8E=
google.golang.org/genproto v0.0.0-20231030173426-d783a09b4405 h1:I6WNifs6pF9tNdSob2W24JtyxIYjzFB9qDlpUC76q+U=
google.golang.org/genproto v0.0.0-20231030173426-d783a09b4405/go.mod h1:3WDQMjmJk36UQhjQ89emUzb1mdaHcPeeAh4SCBKznB4=
google.golang.org/genproto/googleapis/api v0.0.0-20231009173412-8bfb1ae86b6c h1:0RtEmmHjemvUXloH7+RuBSIw7n+GEHMOMY1CkGYnWq4=
google.golang.org/genproto/googleapis/api v0.0.0-20231009173412-8bfb1ae86b6c/go.mod h1:Wth13BrWMRN/G+guBLupKa6fslcWZv14R0ZKDRkNfY8=
google.golang.org/genproto/googleapis/api v0.0.0-20231030173426-d783a09b4405 h1:HJMDndgxest5n2y77fnErkM62iUsptE/H8p0dC2Huo4=
google.golang.org/genproto/googleapis/api v0.0.0-20231030173426-d783a09b4405/go.mod h1:oT32Z4o8Zv2xPQTg0pbVaPr0MPOH6f14RgXt7zfIpwg=
google.golang.org/genproto/googleapis/rpc v0.0.0-20231009173412-8bfb1ae86b6c h1:jHkCUWkseRf+W+edG5hMzr/Uh1xkDREY4caybAq4dpY=
google.golang.org/genproto/googleapis/rpc v0.0.0-20231009173412-8bfb1ae86b6c/go.mod h1:4cYg8o5yUbm77w8ZX00LhMVNl/YVBFJRYWDc0uYWMs0=
google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405 h1:AB/lmRny7e2pLhFEYIbl5qkDAUt2h0ZRO4wGPhZf+ik=
google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405/go.mod h1:67X1fPuzjcrkymZzZV1vvkFeTn2Rvc6lYF9MYFGCcwE=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0=
google.golang.org/grpc v1.58.3 h1:BjnpXut1btbtgN/6sp+brB2Kbm2LjNXnidYujAVbSoQ=
google.golang.org/grpc v1.58.3/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0=
google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk=
google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
Expand Down
8 changes: 8 additions & 0 deletions build/testing/integration/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,7 @@ func API(t *testing.T, ctx context.Context, client sdk.SDK, namespace string, au

require.True(t, result.Match, "Evaluation should have matched.")
assert.Contains(t, result.SegmentKeys, "everyone")
assert.Equal(t, "test", result.FlagKey)
assert.Equal(t, "one", result.VariantKey)
assert.Equal(t, evaluation.EvaluationReason_MATCH_EVALUATION_REASON, result.Reason)
})
Expand All @@ -974,6 +975,7 @@ func API(t *testing.T, ctx context.Context, client sdk.SDK, namespace string, au
require.True(t, result.Match, "Evaluation should have matched.")
assert.Contains(t, result.SegmentKeys, "segment")
assert.Contains(t, result.SegmentKeys, "another-segment")
assert.Equal(t, "test", result.FlagKey)
assert.Equal(t, "two", result.VariantKey)
assert.Equal(t, evaluation.EvaluationReason_MATCH_EVALUATION_REASON, result.Reason)
})
Expand All @@ -991,6 +993,7 @@ func API(t *testing.T, ctx context.Context, client sdk.SDK, namespace string, au

assert.False(t, result.Match, "Evaluation should not have matched.")
assert.Equal(t, evaluation.EvaluationReason_UNKNOWN_EVALUATION_REASON, result.Reason)
assert.Equal(t, "test", result.FlagKey)
assert.Empty(t, result.VariantKey)
})

Expand All @@ -1005,6 +1008,7 @@ func API(t *testing.T, ctx context.Context, client sdk.SDK, namespace string, au

assert.False(t, result.Match, "Evaluation should not have matched.")
assert.Equal(t, evaluation.EvaluationReason_FLAG_DISABLED_EVALUATION_REASON, result.Reason)
assert.Equal(t, "disabled", result.FlagKey)
assert.Empty(t, result.VariantKey)
})

Expand Down Expand Up @@ -1120,6 +1124,7 @@ func API(t *testing.T, ctx context.Context, client sdk.SDK, namespace string, au
require.NoError(t, err)

assert.Equal(t, evaluation.EvaluationReason_DEFAULT_EVALUATION_REASON, result.Reason)
assert.Equal(t, "boolean_disabled", result.FlagKey)
assert.False(t, result.Enabled, "value should be the flag state")
})

Expand All @@ -1136,6 +1141,7 @@ func API(t *testing.T, ctx context.Context, client sdk.SDK, namespace string, au
require.NoError(t, err)

assert.Equal(t, evaluation.EvaluationReason_MATCH_EVALUATION_REASON, result.Reason)
assert.Equal(t, "boolean_disabled", result.FlagKey)
assert.False(t, result.Enabled, "value should be threshold match value")
})

Expand All @@ -1153,6 +1159,7 @@ func API(t *testing.T, ctx context.Context, client sdk.SDK, namespace string, au
require.NoError(t, err)

assert.Equal(t, evaluation.EvaluationReason_MATCH_EVALUATION_REASON, result.Reason)
assert.Equal(t, "boolean_disabled", result.FlagKey)
assert.True(t, result.Enabled, "value should be segment match value")
})

Expand All @@ -1170,6 +1177,7 @@ func API(t *testing.T, ctx context.Context, client sdk.SDK, namespace string, au
require.NoError(t, err)

assert.Equal(t, evaluation.EvaluationReason_MATCH_EVALUATION_REASON, result.Reason)
assert.Equal(t, "boolean_disabled", result.FlagKey)
assert.False(t, result.Enabled, "value should be segment match value")
})
})
Expand Down
9 changes: 9 additions & 0 deletions build/testing/integration/readonly/readonly_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ func TestReadOnly(t *testing.T) {
require.NoError(t, err)

assert.Equal(t, true, response.Match)
assert.Equal(t, "flag_001", response.FlagKey)
assert.Equal(t, "variant_002", response.VariantKey)
assert.Equal(t, evaluation.EvaluationReason_MATCH_EVALUATION_REASON, response.Reason)
assert.Contains(t, response.SegmentKeys, "segment_005")
Expand All @@ -459,6 +460,7 @@ func TestReadOnly(t *testing.T) {

assert.Equal(t, true, response.Match)
assert.Equal(t, "variant_002", response.VariantKey)
assert.Equal(t, "flag_variant_and_segments", response.FlagKey)
assert.Equal(t, evaluation.EvaluationReason_MATCH_EVALUATION_REASON, response.Reason)
assert.Contains(t, response.SegmentKeys, "segment_001")
assert.Contains(t, response.SegmentKeys, "segment_anding")
Expand Down Expand Up @@ -520,6 +522,7 @@ func TestReadOnly(t *testing.T) {
require.NoError(t, err)

assert.Equal(t, evaluation.EvaluationReason_DEFAULT_EVALUATION_REASON, result.Reason)
assert.Equal(t, "flag_boolean", result.FlagKey)
assert.False(t, result.Enabled, "default flag value should be false")
})

Expand All @@ -534,6 +537,7 @@ func TestReadOnly(t *testing.T) {
require.NoError(t, err)

assert.Equal(t, evaluation.EvaluationReason_MATCH_EVALUATION_REASON, result.Reason)
assert.Equal(t, "flag_boolean", result.FlagKey)
assert.True(t, result.Enabled, "boolean evaluation value should be true")
})

Expand All @@ -550,6 +554,7 @@ func TestReadOnly(t *testing.T) {
require.NoError(t, err)

assert.Equal(t, evaluation.EvaluationReason_MATCH_EVALUATION_REASON, result.Reason)
assert.Equal(t, "flag_boolean", result.FlagKey)
assert.True(t, result.Enabled, "segment evaluation value should be true")
})

Expand All @@ -562,6 +567,7 @@ func TestReadOnly(t *testing.T) {
require.NoError(t, err)

assert.Equal(t, evaluation.EvaluationReason_MATCH_EVALUATION_REASON, result.Reason)
assert.Equal(t, "flag_boolean_no_constraints", result.FlagKey)
assert.True(t, result.Enabled, "segment evaluation value should be true")
})

Expand All @@ -577,6 +583,7 @@ func TestReadOnly(t *testing.T) {
require.NoError(t, err)

assert.Equal(t, evaluation.EvaluationReason_MATCH_EVALUATION_REASON, result.Reason)
assert.Equal(t, "flag_boolean_and_segments", result.FlagKey)
assert.True(t, result.Enabled, "segment evaluation value should be true")
})
})
Expand Down Expand Up @@ -613,6 +620,7 @@ func TestReadOnly(t *testing.T) {
b, ok := result.Responses[0].Response.(*evaluation.EvaluationResponse_BooleanResponse)
assert.True(t, ok, "response should be boolean evaluation response")
assert.True(t, b.BooleanResponse.Enabled, "boolean response should have true value")
assert.Equal(t, "flag_boolean", b.BooleanResponse.FlagKey)
assert.Equal(t, evaluation.EvaluationReason_MATCH_EVALUATION_REASON, b.BooleanResponse.Reason)
assert.Equal(t, evaluation.EvaluationResponseType_BOOLEAN_EVALUATION_RESPONSE_TYPE, result.Responses[0].Type)

Expand All @@ -627,6 +635,7 @@ func TestReadOnly(t *testing.T) {
assert.True(t, v.VariantResponse.Match, "variant response match should have true value")
assert.Equal(t, evaluation.EvaluationReason_MATCH_EVALUATION_REASON, v.VariantResponse.Reason)
assert.Equal(t, "variant_002", v.VariantResponse.VariantKey)
assert.Equal(t, "flag_001", v.VariantResponse.FlagKey)
assert.Contains(t, v.VariantResponse.SegmentKeys, "segment_005")
assert.Equal(t, evaluation.EvaluationResponseType_VARIANT_EVALUATION_RESPONSE_TYPE, result.Responses[2].Type)
})
Expand Down
Loading

0 comments on commit 1bf45e0

Please sign in to comment.