GithubHelp home page GithubHelp logo

isabella232 / feature-flag-reference-validator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from configcat/feature-flag-reference-validator

0.0 0.0 0.0 60 KB

The feature flag reference validator for ConfigCat. ConfigCat is a hosted feature flag service: https://configcat.com. Manage feature toggles across frontend, backend, mobile, desktop apps. Alternative to LaunchDarkly. Management app + feature flag SDKs.

Home Page: https://configcat.com

License: MIT License

Dockerfile 1.77% Python 98.23%

feature-flag-reference-validator's Introduction

Feature Flag reference validator CLI [archived]

This repository has been archived. The project became obsolate after the release of ConfigCat's official CLI.

PyPI Docker version

This CLI utility discovers ConfigCat feature flag usages in your source code and validates them against your feature flags on the ConfigCat Dashboard.

About ConfigCat

Manage features and change your software configuration using ConfigCat feature flags, without the need to re-deploy code. A 10 minute trainable Dashboard allows even non-technical team members to manage features directly. Deploy anytime, release when confident. Target a specific group of users first with new ideas. Supports A/B/n testing and soft launching. Provides open-source SDKs for easy integration with any web, mobile or backend application.

Installation

This CLI tool is written in python so you have to have python installed on your system.

  1. Install the The silver searcher used for source code scanning.
    • Linux
      apt-get install silversearcher-ag
    • Windows
      choco install ag
  2. Install the reference validator using pip.
    pip install configcat-flag-reference-validator
  3. Execute the validator.
    configcat-validator.py [YOUR-CONFIGCAT-SDKKEY] [DIRECTORY-TO-SCAN] 

Docker

Pull the configcat/feature-flag-reference-validator docker image to your environment. The image provides an entry point configcat-validator.py to execute the validator.

docker pull configcat/feature-flag-reference-validator

docker run configcat-validator.py [YOUR-CONFIGCAT-SDKKEY] [DIRECTORY-TO-SCAN]

Arguments

Name Required Default value Description
configcat_sdk_key yes N/A The SDK Key of your ConfigCat project.
search_dir yes N/A The directory to scan for flag references.
-s, --configcat_cdn_server no cdn.configcat.com The domain name of the ConfigCat CDN where you ConfigCat configuration file is stored.
-f, --fail_on_warnings no false Signals an error when the validation fails. By default only warnings are showed.
-v, --verbose no false Turns on detailed logging.

Example

The following command will execute a flag reference validation on the ./repo folder and signals a failure when it finds flag key mismatches.

configcat-validator.py \
    [YOUR-CONFIGCAT-SDKKEY] \
    ./repo \
    --fail_on_warnings \
    --verbose

Output:

INFO:configcat.reference_validator.config_fetcher:Fetching the current ConfigCat configuration from cdn.configcat.com.
INFO:configcat.reference_validator.config_fetcher:Successful fetch, 2 settings found: ['key1', 'key2'].
INFO:configcat.reference_validator.reference_finder:Scanning the ./repo directory for ConfigCat setting references.
INFO:configcat.reference_validator.reference_finder:6 references found: {'key1', 'key2', 'key3'}.
WARNING:configcat.reference_validator.reference_validator:Feature flag/Setting keys not found in ConfigCat (but present in source code): {'key3'}.
Exited with code 1

CI Integrations

About ConfigCat

feature-flag-reference-validator's People

Contributors

configcat-developer avatar endret avatar kyletryon avatar sigewuzhere avatar z4kn4fein avatar

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.