> For the complete CircleCI developer hub index, see [llms.txt](https://circleci.com/developer/llms.txt)

# configcat/feature-flag-reference-validator

This Orb's responsibility is to discover ConfigCat feature flag usages in your source
code and to validate them against your feature flags on the ConfigCat Dashboard.
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 application features. Supports A/B testing, soft launching or targeting a specific group of users first with new ideas. Deploy any time, release when confident. Open-source SDKs enable easy integration with any web, mobile or backend application.


## Commands

### install-validator

Installs the ConfigCat flag reference validator tool and its dependencies.

| Parameter | Type | Default | Description |
|---|---|---|---|
| `validator-version` | string | 2.0.1 | The version of the ConfigCat flag reference validator pypi package. |

### install-validator-win

Installs the ConfigCat flag reference validator tool and its dependencies on windows.

| Parameter | Type | Default | Description |
|---|---|---|---|
| `validator-version` | string | 2.0.1 | The version of the ConfigCat flag reference validator pypi package. |

### execute-validation

Scans the repository for ConfigCat feature flag references. Displays the missing feature flag keys in CircleCI's build log.

| Parameter | Type | Default | Description |
|---|---|---|---|
| `configcat-sdk-key` | env_var_name | CONFIG_CAT_SDK_KEY | The SDK Key of your ConfigCat project. |
| `scan-directory` | string | . | The directory to scan for flag references. |
| `configcat-cdn-server` | string | cdn.configcat.com | The domain name of the ConfigCat CDN where you ConfigCat configuration file is stored. |
| `fail-on-warnings` | boolean | false | Signals a build error in CircleCI when the validation fails. By default only warnings are showed. |
| `debug` | boolean | false | Turns on detailed logging. |

### execute-validation-win

Scans the repository for ConfigCat feature flag references on windows. Displays the missing feature flag keys in CircleCI's build log.

| Parameter | Type | Default | Description |
|---|---|---|---|
| `configcat-sdk-key` | env_var_name | CONFIG_CAT_SDK_KEY | The SDK Key of your ConfigCat project. |
| `scan-directory` | string | . | The directory to scan for flag references. |
| `configcat-cdn-server` | string | cdn.configcat.com | The domain name of the ConfigCat CDN where you ConfigCat configuration file is stored. |
| `fail-on-warnings` | boolean | false | Signals a build error in CircleCI when the validation fails. By default only warnings are showed. |
| `debug` | boolean | false | Turns on detailed logging. |

## Jobs

### validate-flag-references

Scans the repository for ConfigCat feature flag references. Displays the missing feature flag keys in CircleCI's build log.

| Parameter | Type | Default | Description |
|---|---|---|---|
| `configcat-sdk-key` | env_var_name | CONFIG_CAT_SDK_KEY | The SDK Key of your ConfigCat project. |
| `configcat-cdn-server` | string | cdn.configcat.com | The domain name of the ConfigCat CDN where you ConfigCat configuration file is stored. |
| `fail-on-warnings` | boolean | false | Signals a build error in CircleCI when the validation fails. By default only warnings are showed. |
| `debug` | boolean | false | Turns on detailed logging. |

## Executors

### default

The Docker container to use when executing the reference validator job.

| Parameter | Type | Default | Description |
|---|---|---|---|
| `docker-image-version` | string | 2.0.1 | The version of the ConfigCat flag reference validator docker image. |

## Examples

### job-default-configuration

Executes the reference validator job with default parameters.

```yaml
version: 2.1
orbs:
  configcat: configcat/feature-flag-reference-validator@2.0.1
workflows:
  main:
    jobs:
      - configcat/validate-flag-references
```

### job-complex-configuration

Executes the reference validator job with verbose logging and fails the execution on validation warnings.

```yaml
version: 2.1
orbs:
  configcat: configcat/feature-flag-reference-validator@2.0.1
workflows:
  main:
    jobs:
      - configcat/validate-flag-references:
          debug: true
          fail-on-warnings: true
```

### install-validator-command

Installs the ConfigCat validator and it's dependencies on the current environment. It uses `apt-get` and `pip` so it must be executed on an environment which has those.

```yaml
version: 2.1
orbs:
  configcat: configcat/feature-flag-reference-validator@2.0.1
jobs:
  build:
    docker:
      - image: circleci/python:2.7
    steps:
      - configcat/install-validator
```

### execute-validation-command

Installs the ConfigCat validator and executes the reference validation command with custom configuration on a python based docker environment.

```yaml
version: 2.1
orbs:
  configcat: configcat/feature-flag-reference-validator@2.0.1
jobs:
  build:
    docker:
      - image: circleci/python:2.7
    steps:
      - checkout:
          path: /repo
      - configcat/install-validator
      - configcat/execute-validation:
          debug: true
          fail-on-warnings: true
          scan-directory: /repo
```

### custom-executor

Executes the reference validator in a job which uses the pre-configured configcat job executor.

```yaml
version: 2.1
orbs:
  configcat: configcat/feature-flag-reference-validator@2.0.1
jobs:
  build:
    executor: configcat/default
    steps:
      - checkout
      - configcat/execute-validation
```