Skip to content

feat: Update to provider 0.2.0 #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Install dependencies
run: poetry install

- uses: launchdarkly/gh-actions/actions/verify-hello-app@verify-hello-app-v1.0.0
- uses: launchdarkly/gh-actions/actions/verify-hello-app@verify-hello-app-v2.0.0
with:
use_server_key: true
role_arn: ${{ vars.AWS_ROLE_ARN }}
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ We've built a simple console script that demonstrates how LaunchDarkly's OpenFea
## Build instructions

1. Install the project dependencies by running `poetry install`
2. Set the environment variable `LAUNCHDARKLY_SERVER_KEY` to your LaunchDarkly SDK key.
2. Set the environment variable `LAUNCHDARKLY_SDK_KEY` to your LaunchDarkly SDK key.
3. Set the environment variable `LAUNCHDARKLY_FLAG_KEY` to the LaunchDarkly boolean flag key you wish to evaluate.
4. Run `poetry run python main.py`.

You should see the message `"Feature flag '<flag key>' is <True/False> for this context"`.
You should see the message `"The <flag key> feature flag evaluates to <true/false>"`.
6 changes: 3 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
from ld_openfeature import LaunchDarklyProvider
from os import getenv

sdk_key = getenv("LAUNCHDARKLY_SERVER_KEY", "")
sdk_key = getenv("LAUNCHDARKLY_SDK_KEY", "")
flag_key = getenv("LAUNCHDARKLY_FLAG_KEY", "")

if sdk_key == "":
print("*** Set the 'LAUNCHDARKLY_SERVER_KEY' environment variable before running this script")
print("*** Set the 'LAUNCHDARKLY_SDK_KEY' environment variable before running this script")
exit(1)
elif flag_key == "":
print("*** Set the 'LAUNCHDARKLY_FLAG_KEY' environment variable before running this script")
Expand All @@ -24,4 +24,4 @@
context = EvaluationContext("example-user-key", {"name": "Sandy"})

flag_value = client.get_boolean_value(flag_key, False, context)
print(f"*** Feature flag '{flag_key}' is {flag_value} for this context")
print(f"*** The {flag_key} feature flag evaluates to {flag_value}.")
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ readme = "README.md"

[tool.poetry.dependencies]
python = "^3.8"
launchdarkly-openfeature-server = "^0.1.0"
launchdarkly-openfeature-server = "^0.2.0"


[build-system]
Expand Down
Loading