Remove "_enabled" suffix from non-legacy features
This commit is contained in:
parent
9dc84e9abe
commit
cf4c3b4434
15 changed files with 48 additions and 31 deletions
|
|
@ -169,7 +169,7 @@ export async function runAutobuild(
|
|||
}
|
||||
if (
|
||||
config.buildMode &&
|
||||
(await features.getValue(Feature.AutobuildDirectTracingEnabled, codeQL))
|
||||
(await features.getValue(Feature.AutobuildDirectTracing, codeQL))
|
||||
) {
|
||||
await codeQL.extractUsingBuildMode(config, language);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -641,9 +641,7 @@ export async function getCodeQLForCmd(
|
|||
) {
|
||||
applyAutobuildAzurePipelinesTimeoutFix();
|
||||
|
||||
if (
|
||||
await features.getValue(Feature.AutobuildDirectTracingEnabled, this)
|
||||
) {
|
||||
if (await features.getValue(Feature.AutobuildDirectTracing, this)) {
|
||||
await runTool(cmd, [
|
||||
"database",
|
||||
"trace-command",
|
||||
|
|
|
|||
|
|
@ -516,12 +516,25 @@ test("ignores invalid version numbers in default version feature flags", async (
|
|||
});
|
||||
});
|
||||
|
||||
test("feature flags should end with _enabled", async (t) => {
|
||||
for (const feature of Object.values(Feature)) {
|
||||
t.assert(
|
||||
feature.endsWith("_enabled"),
|
||||
`${feature} should end with '_enabled'`,
|
||||
);
|
||||
test("legacy feature flags should end with _enabled", async (t) => {
|
||||
for (const [feature, config] of Object.entries(featureConfig)) {
|
||||
if (config.legacyApi) {
|
||||
t.assert(
|
||||
feature.endsWith("_enabled"),
|
||||
`legacy feature ${feature} should end with '_enabled'`,
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
test("non-legacy feature flags should not end with _enabled", async (t) => {
|
||||
for (const [feature, config] of Object.entries(featureConfig)) {
|
||||
if (!config.legacyApi) {
|
||||
t.false(
|
||||
feature.endsWith("_enabled"),
|
||||
`non-legacy feature ${feature} should not end with '_enabled'`,
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -42,10 +42,10 @@ export interface FeatureEnablement {
|
|||
/**
|
||||
* Feature enablement as returned by the GitHub API endpoint.
|
||||
*
|
||||
* Each value of this enum should end with `_enabled`.
|
||||
* Legacy features should end with `_enabled`.
|
||||
*/
|
||||
export enum Feature {
|
||||
AutobuildDirectTracingEnabled = "autobuild_direct_tracing_enabled",
|
||||
AutobuildDirectTracing = "autobuild_direct_tracing",
|
||||
CombineSarifFilesDeprecationWarning = "combine_sarif_files_deprecation_warning_enabled",
|
||||
CppDependencyInstallation = "cpp_dependency_installation_enabled",
|
||||
CppTrapCachingEnabled = "cpp_trap_caching_enabled",
|
||||
|
|
@ -86,7 +86,7 @@ export const featureConfig: Record<
|
|||
toolsFeature?: ToolsFeature;
|
||||
}
|
||||
> = {
|
||||
[Feature.AutobuildDirectTracingEnabled]: {
|
||||
[Feature.AutobuildDirectTracing]: {
|
||||
defaultValue: false,
|
||||
envVar: "CODEQL_ACTION_AUTOBUILD_BUILD_MODE_DIRECT_TRACING",
|
||||
minimumVersion: undefined,
|
||||
|
|
|
|||
|
|
@ -20,10 +20,7 @@ export async function shouldEnableIndirectTracing(
|
|||
return (
|
||||
(!config.buildMode ||
|
||||
config.buildMode === BuildMode.Manual ||
|
||||
!(await features.getValue(
|
||||
Feature.AutobuildDirectTracingEnabled,
|
||||
codeql,
|
||||
))) &&
|
||||
!(await features.getValue(Feature.AutobuildDirectTracing, codeql))) &&
|
||||
config.languages.some((l) => isTracedLanguage(l))
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue