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

[PM-1012] Feature access using context #2764

Merged
merged 4 commits into from
Mar 7, 2023
Merged

[PM-1012] Feature access using context #2764

merged 4 commits into from
Mar 7, 2023

Conversation

withinfocus
Copy link
Contributor

@withinfocus withinfocus commented Mar 2, 2023

Type of change

- [ ] Bug fix
- [X] New feature development
- [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc)
- [ ] Build/deploy pipeline (DevOps)
- [ ] Other

Objective

Methods for accessing feature flags as simple Booleans, integers, and strings, all using the current context.

Code changes

  • src/Core/Constants.cs: Class for feature flag keys, as constants.
  • src/Core/Services/IFeatureService.cs: Three new interface methods to retrieve values using context and defaults.
  • src/Core/Services/Implementations/LaunchDarklyFeatureService.cs: Implementation using LaunchDarkly. Builds a context of the user and organization IDs when available (although the user context is truly needed) and respects default values for when offline.
  • test/Core.Test/Services/LaunchDarklyFeatureServiceTests.cs: Tests to exercise the new methods with a generated user ID. Marked a few as skips so they can stick around as example implementations.

Before you submit

  • Please check for formatting errors (dotnet format --verify-no-changes) (required)
  • If making database changes - make sure you also update Entity Framework queries and/or migrations
  • Please add unit tests where it makes sense to do so (encouraged but not required)
  • If this change requires a documentation update - notify the documentation team
  • If this change has particular deployment requirements - notify the DevOps team

@withinfocus withinfocus marked this pull request as ready for review March 2, 2023 21:31
@withinfocus withinfocus requested a review from Hinton March 3, 2023 15:34
@withinfocus withinfocus merged commit 11c59ad into master Mar 7, 2023
@withinfocus withinfocus deleted the ldcontext branch March 7, 2023 18:46
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.

3 participants