Giter VIP home page Giter VIP logo

openfeature-al's Introduction

OpenFeature for AL

GitHub latest release GitHub last commit GitHub issues GitHub pull requests GitHub GitHub tweet

Overview

OpenFeature for AL is created to popularise the feature flag-driven development among Dynamics 365 Business Central community by providing a workable tool to manage it.

Installation

1. Deploy OpenFeature extension to your environment

  • For On-Prem and local development: Clone PTE release git clone -b release/PTE https://github.com/thetanz/OpenFeature-al.git, package extension from MAIN folder and deploy to your On-Prem environment.
  • For SaaS: Follow the link to install OpenFeature extension into your Cloud environment.

2. Add dependency to your extension:

    {
      "id": "c42f2379-d7b5-4378-8ce4-9bca293c6189",
      "publisher": "Theta Systems Limited",
      "name": "OpenFeature",
      "version": "3.4.0.0"
    }

Usage

OpenFeature extension allows the development team to manage feature flags. When the feature is enabled, the extension appends ApplicationArea with enabled feature identifiers.

For Pages

Use your feature identifier as an ApplicationArea for all feature-related page controls and actions. Example:

field(StripeID; Rec.StripeID)
{
     Caption = 'Stripe ID';
     ToolTip = 'Customer''s Stripe ID';
     ApplicationArea = Stripe;
}

For Code

Wrap feature-related code block into a condition. It's recommended to use IsEnabled function from FeatureMgt_FF_TSL codeunit. Example:

if FeatureMgt.IsEnabled('Stripe') then 
     // Feature 'Stripe' is enabled
     StripeClient.CreateInvoice(SalesHeader);

Define Features

OpenFeature extension uses Providers to manage features as well as their states.

Condition Provider

ConditionProvider_FF_TSL codeunit enables any extension to add features with conditions. Example:

// Add new feature with condition to be enabled only for users with email ending with '.nz'.
ConditionProvider.AddFeature('Stripe', '[Enables Stripe Integration](https://example.com/Stripe)');
User.SetFilter("Contact Email", '*.nz');
ConditionProvider.AddCondition('NZUserOnly', ConditionFunction_FF_TSL::UserFilter, User.GetView());
ConditionProvider.AddFeatureCondition('Stripe', 'NZUserOnly');

As introduced, conditions could be modified by any user with Feature Mgt. - Admin permission set assigned.

PostHog Provider (EXPERIMENTAL)

PostHogProvider_FF_TSL codeunit enables integration with PostHog Feature Flags service which will mirror enabled features within your Business Central environment. Setup example:

// App PostHog provider. It will load all available features automatically.
ISecretProvider := SecretProvider;
ISecretProvider.GetSecret('PostHogPersonalAPIKey', PersonalAPIKey);
ISecretProvider.GetSecret('PostHogProjectID', ProjectID);
if not PostHogProvider.AddProvider('THETA_POSTHOG', PersonalAPIKey, ProjectID) then
     Error(GetLastErrorText());

Roadmap

See the open issues for a list of proposed features (and known issues).

License

OpenFeature for AL licensed under GNU Lesser General Public License version 3 (LGPL-3.0). Key features of the LGPL-3.0 include:

  • Usage Freedom: Allows free use OpenFeature for AL in any projects, whether those projects are open-source or proprietary.
  • Modification Requirements: Requires that any modifications made to the OpenFeature for AL itself be released under the same LGPL terms.
  • Linking with Proprietary Software: Allows linking OpenFeature for AL with any proprietary software without requiring the proprietary software to be open-sourced.

Contributing

Contributions make the open-source community a fantastic place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a pull request

Contact

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.