Refactor handling of feature flags
This commit centralizes how feature flags are handled. All feature flags must now add an entry in the `featureFlagConfig` dictionary. This dictionary associates the flag with an environment variable name and optionally a minimum version for CodeQL. The new logic is: - if the environment variable is set to false: disabled - if the minimum version requirement specified and met: disabled - if the environment variable is set to true: enable - Otherwise check feature flag enablement from the server
This commit is contained in:
parent
24c8de16fa
commit
e5c3375225
27 changed files with 400 additions and 368 deletions
|
|
@ -160,3 +160,11 @@ export function mockFeatureFlagApiEndpoint(
|
|||
|
||||
sinon.stub(apiClient, "getApiClient").value(() => client);
|
||||
}
|
||||
|
||||
export function mockCodeQLVersion(version) {
|
||||
return {
|
||||
async getVersion() {
|
||||
return version;
|
||||
},
|
||||
} as CodeQL.CodeQL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue