Skip to content
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

feat: Environment Variable Provider #312

Merged
merged 15 commits into from
Mar 12, 2025

Conversation

MJRichardson
Copy link
Contributor

Environment Variable Provider

This PR adds a provider that evaluates environment variables.

It will use the flag key as the name of the environment variable, but also provides the ability for a common prefix to be supplied when the provider is created.

            // If no prefix is required, the default constructor can be used, e.g.
            // var provider = new EnvVarProvider();
            var provider = new EnvVarProvider("FeatureToggles_");
            await OpenFeature.Api.Instance.SetProviderAsync(provider);

@MJRichardson MJRichardson requested review from a team as code owners February 6, 2025 02:47
@MJRichardson MJRichardson force-pushed the michrich/env-var-provider branch from 80a729c to 9cd7c02 Compare February 6, 2025 02:52
@beeme1mr
Copy link
Member

beeme1mr commented Mar 6, 2025

Greetings @MJRichardson, could you please also update release-please-config.json? There's also seems to a lint issue.

Sorry for the delay on the review. Feel free to ping me if the PR get stuck again.

Copy link
Member

@askpt askpt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I dropped a few minor suggestions. I advise you to run dotnet format in the repository's root to correct formatting errors.

MJRichardson and others added 13 commits March 11, 2025 00:16
Signed-off-by: Michael Richardson <[email protected]>
Signed-off-by: Michael Richardson <[email protected]>
Signed-off-by: Michael Richardson <[email protected]>
Signed-off-by: Michael Richardson <[email protected]>
Signed-off-by: Michael Richardson <[email protected]>
Signed-off-by: Michael Richardson <[email protected]>
Co-authored-by: André Silva <[email protected]>
Signed-off-by: Michael Richardson <[email protected]>
Signed-off-by: Michael Richardson <[email protected]>
Signed-off-by: Michael Richardson <[email protected]>
Signed-off-by: Michael Richardson <[email protected]>
@MJRichardson MJRichardson force-pushed the michrich/env-var-provider branch from 52b1643 to 6a0125e Compare March 10, 2025 14:16
@MJRichardson
Copy link
Contributor Author

Greetings @MJRichardson, could you please also update release-please-config.json? There's also seems to a lint issue.

Sorry for the delay on the review. Feel free to ping me if the PR get stuck again.

Howdy @beeme1mr, and thanks :)

I've made those changes.

@MJRichardson MJRichardson requested a review from askpt March 10, 2025 14:24
Copy link
Member

@beeme1mr beeme1mr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good. I just left one comment about the readme. Thanks for the contribution!

@github-actions github-actions bot requested a review from vpetrusevici March 12, 2025 07:15
@MJRichardson MJRichardson force-pushed the michrich/env-var-provider branch 2 times, most recently from 1c00ec3 to 8141eb9 Compare March 12, 2025 07:37
Signed-off-by: Michael Richardson <[email protected]>
@MJRichardson MJRichardson force-pushed the michrich/env-var-provider branch from 8141eb9 to 21dbdbb Compare March 12, 2025 07:42
@MJRichardson
Copy link
Contributor Author

@beeme1mr While rebasing to sign my commits, I inadvertently signed commits which caused other reviewers to be added to the PR 🤦
I corrected this, but I can't remove the additional reviewers. Would you mind?

@beeme1mr beeme1mr merged commit 4908000 into open-feature:main Mar 12, 2025
8 checks passed
@beeme1mr
Copy link
Member

Hey @MJRichardson, the provider is now available in NuGet. Thanks for the contribution!

https://www.nuget.org/packages/OpenFeature.Contrib.Providers.EnvVar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants