GitLab Feature Flags Extension

Precondition to control the execution of a changelog or changeset based on the state of the feature flag in GitLab.

Supported Editions

Liquibase Pro

Installation

The easiest way to install this extension is with lpm liquibase package manager.

Copy
lpm update
lpm add gitlab-feature-flags

Setup

  • API URL is required for the extension to access the GitLab Feature Flag API.
  • Instance ID is required for the extension to access the GitLab Feature Flag API.
  • Application name is required for the extension to access the GitLab Feature Flag API.
Copy
--git-lab-app-name=PARAM

     The name of the GitLab environment the application
       runs in (not the name of the application itself)
     (liquibase.gitLab.appName)
     (LIQUIBASE_GIT_LAB_APP_NAME)
     [deprecated: --gitLabAppName]

--git-lab-instance-id=PARAM

     Unique token that authorizes the retrieval of the
       GitLab feature flags
     (liquibase.gitLab.instanceId)
     (LIQUIBASE_GIT_LAB_INSTANCE_ID)
     [deprecated: --gitLabInstanceId]

--git-lab-url=PARAM
     URL where the client (application) connects to get
       a list of GitLab feature flags
     (liquibase.gitLab.url)
     (LIQUIBASE_GIT_LAB_URL)
     [deprecated: --gitLabUrl]

Usage

To use this extension, add the gitLabFeatureFlag precondition to your Changelog or Changeset with an enabledFlags attribute. The value for enabledFlags is either a string with one feature flag key or a comma separated string with multiple feature flag keys. All feature flags must be enabled for the precondition to pass.

Example

Copy
databaseChangeLog:
  -  preConditions:
     -  gitLabFeatureFlag:
          enabledFlags: changelog-testing
Copy
<changeSet id="1" author="example">
    <preConditions>
        <ext:gitLabFeatureFlag enabledFlags="changelog-testing"/>
    </preConditions>
    ...
</changeSet>

Feedback and Issues

Please submit all feedback and issues to this idea board.