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

Add support for feature flags #1055

Open
9 tasks
dsebastien opened this issue Nov 4, 2024 · 4 comments
Open
9 tasks

Add support for feature flags #1055

dsebastien opened this issue Nov 4, 2024 · 4 comments
Labels
feature New feature or request P3 Affects a small number of users or is largely cosmetic quality_assurance Quality Assurance (QA) SHOULD Nice to have
Milestone

Comments

@dsebastien
Copy link
Member

Goal: control rollout of, and access to certain features (e.g., beta, premium, whatever).

We'll use Laravel Pennant: https://laravel.com/docs/11.x/pennant

  • Add and configure Laravel Pennant
  • Publish the Pennant vendor configs
  • Create a Features enum on the BE with feature names (to have type safety on the back-end)
  • Add a "beta" feature
  • Add a /features API endpoint to list features accessible to the current user
  • Create a Features "enum" on the FE (same logic)
  • Add support for the /features API endpoint on KnowiiApiClient
  • Use it
  • Add documentation

References:

@dsebastien dsebastien added quality_assurance Quality Assurance (QA) SHOULD Nice to have P3 Affects a small number of users or is largely cosmetic feature New feature or request labels Nov 4, 2024
@dsebastien dsebastien added this to the LATER milestone Nov 4, 2024
@dsebastien dsebastien added this to Knowii Nov 4, 2024
@dsebastien dsebastien moved this to Backlog in Knowii Nov 4, 2024
@dsebastien
Copy link
Member Author

Careful that features are resolved ONCE, stored in the database, and not changed afterwards

@dsebastien
Copy link
Member Author

dsebastien commented Nov 4, 2024

Use Feature::define('new-feature', Lottery::odds(1,10)); to enable a feature randomly for 10% of the users.

@dsebastien
Copy link
Member Author

Use ->middleware(EnsureFeaturesAreActive::using('new-feature')); to ensure users have access to specific features

@dsebastien
Copy link
Member Author

Make sure to configure feature discover so that Feature:all(); always gives the full list of features: https://laravel.com/docs/11.x/pennant#retrieving-multiple-features

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request P3 Affects a small number of users or is largely cosmetic quality_assurance Quality Assurance (QA) SHOULD Nice to have
Projects
Status: Backlog
Development

No branches or pull requests

1 participant