Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions website/docs/advanced/code-references/azure-devops.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,23 @@ id: azure-devops
title: Azure DevOps - Scan your source code for feature flags
---

import { Steps, Step, Title } from '@site/src/components/Steps';

This section describes how to use the [ConfigCat CLI](../cli.mdx) in <a target="_blank" href="https://docs.microsoft.com/en-us/azure/devops/pipelines/?view=azure-devops">Azure DevOps Pipelines</a>
to automatically scan your source code for feature flag and setting usages and upload the found code references to ConfigCat.

## Setup

1. Create a new <a target="_blank" href="https://app.configcat.com/my-account/public-api-credentials">ConfigCat Management API credential</a> and store its values in Azure DevOps <a target="_blank" href="https://docs.microsoft.com/en-us/azure/devops/pipelines/process/variables">Pipeline Variables</a> with the following names: `CONFIGCAT_API_USER`, `CONFIGCAT_API_PASS`.
<Steps>
<Step>
Create a new <a target="_blank" href="https://app.configcat.com/my-account/public-api-credentials">ConfigCat Management API credential</a> and store its values in Azure DevOps <a target="_blank" href="https://docs.microsoft.com/en-us/azure/devops/pipelines/process/variables">Pipeline Variables</a> with the following names: `CONFIGCAT_API_USER`, `CONFIGCAT_API_PASS`.
<img src="/docs/assets/cli/scan/azure_secrets.png" alt="Azure secrets" decoding="async" loading="lazy"/>

2. Get your selected [Config's ID](overview.mdx#config-id).

3. Create a new or open your existing `azure-pipelines.yml` file, and add the following <a target="_blank" href="https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema#job">job</a> to your `jobs` definition.
</Step>
<Step>
Get your selected [Config's ID](overview.mdx#config-id).
</Step>
<Step>
Create a new or open your existing `azure-pipelines.yml` file, and add the following <a target="_blank" href="https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema#job">job</a> to your `jobs` definition.
Don't forget to replace the `PASTE-YOUR-CONFIG-ID-HERE` value with your actual Config ID.
```yaml
- job: configcat_scan_and_upload
Expand Down Expand Up @@ -41,7 +47,10 @@ to automatically scan your source code for feature flag and setting usages and u
:::info
If you are using a different VCS than Azure DevOps' Git, you should set the `--file-url-template` and `--commit-url-template` according to your VCS provider.
:::

4. Commit & push your changes.
</Step>
<Step>
Commit & push your changes.
</Step>
</Steps>

Scan reports are uploaded for each branch of your repository that triggers the job.
57 changes: 33 additions & 24 deletions website/docs/advanced/code-references/bitbucket-pipe.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,45 @@ id: bitbucket-pipe
title: Bitbucket Pipe - Scan your source code for feature flags
---

import { Steps, Step, Title } from '@site/src/components/Steps';

This section describes how to use ConfigCat's <a target="_blank" href="https://bitbucket.org/product/features/pipelines/integrations?p=configcat/scan-repository-pipe">Bitbucket Pipe</a>
to automatically scan your source code for feature flag and setting usages and upload the found code references to ConfigCat.
You can find more information about Bitbucket Pipelines <a target="_blank" href="https://bitbucket.org/product/features/pipelines">here</a>.

## Setup

1. Create a new <a target="_blank" href="https://app.configcat.com/my-account/public-api-credentials">ConfigCat Management API credential</a> and store its values in secure pipeline variables with the following names: `CONFIGCAT_API_USER`, `CONFIGCAT_API_PASS`.
<img src="/docs/assets/cli/scan/pipe_secrets.png" className="bordered-img" alt="Bitbucket Pipe secrets" decoding="async" loading="lazy" />

2. Get your selected [Config's ID](overview.mdx#config-id).

3. Add the following snippet to the script section of your `bitbucket-pipelines.yml` file.
Don't forget to replace the `PASTE-YOUR-CONFIG-ID-HERE` value with your actual Config ID.

```yaml
- pipe: configcat/scan-repository-pipe:1.8.1
variables:
CONFIG_ID: 'PASTE-YOUR-CONFIG-ID-HERE'
# LINE_COUNT: '3' # optional
# TIMEOUT: '1800' # optional
# SUB_FOLDER: '/src' # optional
# EXCLUDE_KEYS: > # optional
# flag_key_to_exclude_1
# flag_key_to_exclude_2
# ALIAS_PATTERNS: (\w+) = :CC_KEY,const (\w+) = feature_flags\.enabled\(:CC_KEY\) # optional
# USAGE_PATTERNS: feature_flags\.enabled\(:CC_KEY\)
# VERBOSE: 'true' # optional
```

4. Commit & push your changes.
<Steps>
<Step>
Create a new <a target="_blank" href="https://app.configcat.com/my-account/public-api-credentials">ConfigCat Management API credential</a> and store its values in secure pipeline variables with the following names: `CONFIGCAT_API_USER`, `CONFIGCAT_API_PASS`.
<img src="/docs/assets/cli/scan/pipe_secrets.png" className="bordered-img" alt="Bitbucket Pipe secrets" decoding="async" loading="lazy" />
</Step>
<Step>
Get your selected [Config's ID](overview.mdx#config-id).
</Step>
<Step>
Add the following snippet to the script section of your `bitbucket-pipelines.yml` file.
Don't forget to replace the `PASTE-YOUR-CONFIG-ID-HERE` value with your actual Config ID.

```yaml
- pipe: configcat/scan-repository-pipe:1.8.1
variables:
CONFIG_ID: 'PASTE-YOUR-CONFIG-ID-HERE'
# LINE_COUNT: '3' # optional
# TIMEOUT: '1800' # optional
# SUB_FOLDER: '/src' # optional
# EXCLUDE_KEYS: > # optional
# flag_key_to_exclude_1
# flag_key_to_exclude_2
# ALIAS_PATTERNS: (\w+) = :CC_KEY,const (\w+) = feature_flags\.enabled\(:CC_KEY\) # optional
# USAGE_PATTERNS: feature_flags\.enabled\(:CC_KEY\)
# VERBOSE: 'true' # optional
```
</Step>
<Step>
Commit & push your changes.
</Step>
</Steps>

Scan reports are uploaded for each branch of your repository that triggers the job.

Expand Down
26 changes: 17 additions & 9 deletions website/docs/advanced/code-references/bitrise-step.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,23 @@ id: bitrise-step
title: Bitrise - Scan your source code for feature flags
---

import { Steps, Step, Title } from '@site/src/components/Steps';

This section describes how to use ConfigCat's <a target="_blank" href="https://www.bitrise.io/integrations/steps/configcat-feature-flag-sync">Bitrise Step</a>
to automatically scan your source code for feature flag and setting usages and upload the found code references to ConfigCat.
<a target="_blank" href="https://www.bitrise.io/">Bitrise</a> is full-featured mobile CI/CD platform. You can find more information about Bitrise Steps <a target="_blank" href="https://devcenter.bitrise.io/en/steps-and-workflows/introduction-to-steps.html">here</a>.

## Setup

1. Create a new <a target="_blank" href="https://app.configcat.com/my-account/public-api-credentials">ConfigCat Management API credential</a> and store its values in secure pipeline variables with the following names: `CONFIGCAT_API_USER`, `CONFIGCAT_API_PASS`.
<img src="/docs/assets/cli/scan/bitrise_secrets.png" className="bordered-img" alt="Bitrise secrets" decoding="async" loading="lazy"/>

2. Get your selected [Config's ID](overview.mdx#config-id).

3. Add the following step to the workflows section of your `bitrise.yml` file.
<Steps>
<Step>
Create a new <a target="_blank" href="https://app.configcat.com/my-account/public-api-credentials">ConfigCat Management API credential</a> and store its values in secure pipeline variables with the following names: `CONFIGCAT_API_USER`, `CONFIGCAT_API_PASS`.
<img src="/docs/assets/cli/scan/bitrise_secrets.png" className="bordered-img" alt="Bitrise secrets" decoding="async" loading="lazy"/>
</Step>
<Step>
Get your selected [Config's ID](overview.mdx#config-id).
</Step>
<Step>
Add the following step to the workflows section of your `bitrise.yml` file.
Don't forget to replace the `PASTE-YOUR-CONFIG-ID-HERE` value with your actual Config ID.

```yaml
Expand All @@ -30,8 +35,11 @@ to automatically scan your source code for feature flag and setting usages and u
# - usage-patterns: feature_flags\.enabled\(:CC_KEY\) # optional
# - verbose: true # optional
```

4. Commit & push your changes.
</Step>
<Step>
Commit & push your changes.
</Step>
</Steps>

Scan reports are uploaded for each branch of your repository that triggers the job.

Expand Down
28 changes: 18 additions & 10 deletions website/docs/advanced/code-references/circleci-orb.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,24 @@ id: circleci-orb
title: CircleCI Orb - Scan your source code for feature flags
---

import { Steps, Step, Title } from '@site/src/components/Steps';

This section describes how to use ConfigCat's <a target="_blank" href="https://circleci.com/developer/orbs/orb/configcat/scan-repository">CircleCI Orb</a>
to automatically scan your source code for feature flag and setting usages and upload the found code references to ConfigCat.
You can find more information about CircleCI Orbs <a target="_blank" href="https://circleci.com/orbs/">here</a>.

## Setup

1. Create a new <a target="_blank" href="https://app.configcat.com/my-account/public-api-credentials">ConfigCat Management API credential</a> and store its values in <a target="_blank" href="https://circleci.com/docs/2.0/env-vars/#setting-an-environment-variable-in-a-project">CircleCI Environment Variables</a> with the following names: `CONFIGCAT_API_USER`, `CONFIGCAT_API_PASS`.
<img src="/docs/assets/cli/scan/cco_secrets.png" className="bordered-img" alt="CircleCI Orb secrets" decoding="async" loading="lazy" />

2. Get your selected [Config's ID](overview.mdx#config-id).

3. Create a new CircleCI YAML config in your repository under the `.circleci` folder, and put the following snippet into it.
Don't forget to replace the `PASTE-YOUR-CONFIG-ID-HERE` value with your actual Config ID.
<Steps>
<Step>
Create a new <a target="_blank" href="https://app.configcat.com/my-account/public-api-credentials">ConfigCat Management API credential</a> and store its values in <a target="_blank" href="https://circleci.com/docs/2.0/env-vars/#setting-an-environment-variable-in-a-project">CircleCI Environment Variables</a> with the following names: `CONFIGCAT_API_USER`, `CONFIGCAT_API_PASS`.
<img src="/docs/assets/cli/scan/cco_secrets.png" className="bordered-img" alt="CircleCI Orb secrets" decoding="async" loading="lazy" />
</Step>
<Step>
Get your selected [Config's ID](overview.mdx#config-id).
</Step>
<Step>
Create a new CircleCI YAML config in your repository under the `.circleci` folder, and put the following snippet into it.
Don't forget to replace the `PASTE-YOUR-CONFIG-ID-HERE` value with your actual Config ID.

```yaml
version: 2.1
Expand All @@ -40,8 +45,11 @@ You can find more information about CircleCI Orbs <a target="_blank" href="https
# usage-patterns: feature_flags\.enabled\(:CC_KEY\) # optional
# verbose: true # optional
```

4. Commit & push your changes.
</Step>
<Step>
Commit & push your changes.
</Step>
</Steps>

The above example configures a workflow that executes the scan and code reference upload on every git `push` event.
Scan reports are uploaded for each branch of your repository that triggers the workflow.
Expand Down
26 changes: 17 additions & 9 deletions website/docs/advanced/code-references/github-action.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,23 @@ id: github-action
title: GitHub Action - Scan your source code for feature flags
---

import { Steps, Step, Title } from '@site/src/components/Steps';

This section describes how to use ConfigCat's <a target="_blank" href="https://github.com/marketplace/actions/configcat-scan-repository">Scan Repository GitHub Action</a>
to automatically scan your source code for feature flag and setting usages and upload the found code references to ConfigCat.
You can find more information about GitHub Actions <a target="_blank" href="https://github.com/features/actions">here</a>.

## Setup

1. Create a new <a target="_blank" href="https://app.configcat.com/my-account/public-api-credentials">ConfigCat Management API credential</a> and store its values in your repository's <a target="_blank" href="https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository">GitHub Secrets</a> with the following names: `CONFIGCAT_API_USER`, `CONFIGCAT_API_PASS`.
<img src="/docs/assets/cli/scan/github_secrets.png" alt="Github Action secrets" decoding="async" loading="lazy" />

2. Get your selected [Config's ID](overview.mdx#config-id).

3. Create a new Actions workflow in your GitHub repository under the `.github/workflows` folder, and put the following snippet into it. Don't forget to replace the `PASTE-YOUR-CONFIG-ID-HERE` value with your actual Config ID.
<Steps>
<Step>
Create a new <a target="_blank" href="https://app.configcat.com/my-account/public-api-credentials">ConfigCat Management API credential</a> and store its values in your repository's <a target="_blank" href="https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository">GitHub Secrets</a> with the following names: `CONFIGCAT_API_USER`, `CONFIGCAT_API_PASS`.
<img src="/docs/assets/cli/scan/github_secrets.png" alt="Github Action secrets" decoding="async" loading="lazy" />
</Step>
<Step>
Get your selected [Config's ID](overview.mdx#config-id).
</Step>
<Step>
Create a new Actions workflow in your GitHub repository under the `.github/workflows` folder, and put the following snippet into it. Don't forget to replace the `PASTE-YOUR-CONFIG-ID-HERE` value with your actual Config ID.

```yaml
on: [push]
Expand Down Expand Up @@ -42,8 +47,11 @@ You can find more information about GitHub Actions <a target="_blank" href="http
# usage-patterns: feature_flags\.enabled\(:CC_KEY\) # optional, comma delimited flag key usage patterns
# verbose: true # optional
```

4. Commit & push your action.
</Step>
<Step>
Commit & push your action.
</Step>
</Steps>

The above example configures a workflow that executes the scan and code references upload on every git `push` event.
Scan reports are uploaded for each branch of your repository that triggers the workflow.
Expand Down
29 changes: 18 additions & 11 deletions website/docs/advanced/code-references/gitlab-ci.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,23 @@ id: gitlab-ci
title: GitLab - Scan your source code for feature flags
---

import { Steps, Step, Title } from '@site/src/components/Steps';

This section describes how to use the [ConfigCat CLI](../cli.mdx) in <a target="_blank" href="https://docs.gitlab.com/ee/ci/">GitLab CI/CD</a>
to automatically scan your source code for feature flag and setting usages and upload the found code references to ConfigCat.

## Setup

1. Create a new <a target="_blank" href="https://app.configcat.com/my-account/public-api-credentials">ConfigCat Management API credential</a> and store its values in GitLab's <a target="_blank" href="https://docs.gitlab.com/ee/ci/variables/">CI/CD Variables</a> with the following names: `CONFIGCAT_API_USER`, `CONFIGCAT_API_PASS`.
<img src="/docs/assets/cli/scan/gl_secrets.png" alt="GitLab secrets" decoding="async" loading="lazy"/>

2. Get your selected [Config's ID](overview.mdx#config-id).

3. Create a new or open your existing `.gitlab-ci.yml` file, and put the following job into it.
Don't forget to replace the `PASTE-YOUR-CONFIG-ID-HERE` value with your actual Config ID.
<Steps>
<Step>
Create a new <a target="_blank" href="https://app.configcat.com/my-account/public-api-credentials">ConfigCat Management API credential</a> and store its values in GitLab's <a target="_blank" href="https://docs.gitlab.com/ee/ci/variables/">CI/CD Variables</a> with the following names: `CONFIGCAT_API_USER`, `CONFIGCAT_API_PASS`.
<img src="/docs/assets/cli/scan/gl_secrets.png" alt="GitLab secrets" decoding="async" loading="lazy"/>
</Step>
<Step>
Get your selected [Config's ID](overview.mdx#config-id).
</Step>
<Step>
Create a new or open your existing `.gitlab-ci.yml` file, and put the following job into it.
Don't forget to replace the `PASTE-YOUR-CONFIG-ID-HERE` value with your actual Config ID.

```yaml
configcat-scan-repository:
Expand All @@ -33,7 +38,9 @@ to automatically scan your source code for feature flag and setting usages and u
--upload
--non-interactive
```

4. Commit & push your changes.

</Step>
<Step>
Commit & push your changes.
</Step>
</Steps>
Scan reports are uploaded for each branch of your repository that triggers the job.
16 changes: 13 additions & 3 deletions website/docs/advanced/code-references/manual.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,24 @@ id: manual
title: CLI - Add to CI/CD pipelines manually
---

import { Steps, Step, Title } from '@site/src/components/Steps';

This section describes how to use the [ConfigCat CLI](../cli.mdx)
to scan your source code for feature flag and setting usages and upload the found code references to ConfigCat.

## Prerequisites

- [Install](../cli.mdx#installation) the CLI in your CI/CD or local environment.
- [Setup](../cli.mdx#setup) the CLI with your ConfigCat Management API credentials.
- Get your selected [Config's ID](overview.mdx#config-id).
<Steps>
<Step>
[Install](../cli.mdx#installation) the CLI in your CI/CD or local environment.
</Step>
<Step>
[Setup](../cli.mdx#setup) the CLI with your ConfigCat Management API credentials.
</Step>
<Step>
Get your selected [Config's ID](overview.mdx#config-id).
</Step>
</Steps>

## Scan & Upload

Expand Down
13 changes: 9 additions & 4 deletions website/docs/advanced/code-references/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ title: Scan & Upload Code References Overview
---

import CodeRefIntro from './\_intro.mdx'
import { Steps, Step, Title } from '@site/src/components/Steps';

<CodeRefIntro linkText="CLI" linkUrl="/docs/advanced/cli" linkTarget="_self" />

Expand Down Expand Up @@ -46,13 +47,17 @@ In non-interactive environments, like in a CI/CD pipeline, you have to pass the

To get the ID of a Config, follow the steps below:

1. Go to your <a target="_blank" href="https://app.configcat.com">ConfigCat Dashboard</a>, select the desired Config, and click the code references icon on one of your feature flags.

<Steps>
<Step>
Go to your <a target="_blank" href="https://app.configcat.com">ConfigCat Dashboard</a>, select the desired Config, and click the code references icon on one of your feature flags.
<img width="400" src="/docs/assets/cli/scan/code_ref.png" alt="ConfigCat code references button" decoding="async" loading="lazy" />

2. Copy the Config ID from the highlighted box.

</Step>
<Step>
Copy the Config ID from the highlighted box.
<img src="/docs/assets/cli/scan/config_id.png" alt="ConfigCat Config ID" decoding="async" loading="lazy" />
</Step>
</Steps>

## How Scanning Works

Expand Down
12 changes: 10 additions & 2 deletions website/docs/advanced/config-v2-migration-guide.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ title: Config V2 Migration Guide
description: A detailed guide on how to migrate from Config V1 to Config V2.
---

import { Steps, Step, Title } from '@site/src/components/Steps';

This guide will help you migrate from Config V1 to Config V2.

## What is Config V2?
Expand All @@ -30,8 +32,14 @@ The migration process starts with copying your V1 config to a new V2 one and upd

### Step 1: Create the V2 config

1. Open the ConfigCat Dashboard and click on the `Start migration` button on top of a V1 config.
2. Click `Create V2 config` to create a new config with the same settings as the V1 config.
<Steps>
<Step>
Open the ConfigCat Dashboard and click on the `Start migration` button on top of a V1 config.
</Step>
<Step>
Click `Create V2 config` to create a new config with the same settings as the V1 config.
</Step>
</Steps>

It's important to note that the V2 config will be created with the same settings as the V1 config and the V1 config will still be accessible and unchanged.

Expand Down
Loading
Loading