mirror of
https://github.com/github/codeql-action.git
synced 2025-12-24 08:10:06 +08:00
Resolve dependency cycle between util and API client
This commit is contained in:
15
lib/feature-flags.js
generated
15
lib/feature-flags.js
generated
@@ -23,16 +23,23 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.logCodeScanningConfigInCli = exports.useCodeScanningConfigInCli = exports.Features = exports.FEATURE_FLAGS_FILE_NAME = exports.featureConfig = exports.Feature = void 0;
|
||||
exports.logCodeScanningConfigInCli = exports.useCodeScanningConfigInCli = exports.Features = exports.FEATURE_FLAGS_FILE_NAME = exports.featureConfig = exports.Feature = exports.CODEQL_VERSION_NEW_ANALYSIS_SUMMARY = exports.CODEQL_VERSION_BUNDLE_SEMANTICALLY_VERSIONED = void 0;
|
||||
const fs = __importStar(require("fs"));
|
||||
const path = __importStar(require("path"));
|
||||
const semver = __importStar(require("semver"));
|
||||
const api_client_1 = require("./api-client");
|
||||
const codeql_1 = require("./codeql");
|
||||
const defaults = __importStar(require("./defaults.json"));
|
||||
const util = __importStar(require("./util"));
|
||||
const DEFAULT_VERSION_FEATURE_FLAG_PREFIX = "default_codeql_version_";
|
||||
const DEFAULT_VERSION_FEATURE_FLAG_SUFFIX = "_enabled";
|
||||
/**
|
||||
* Versions 2.13.4+ of the CodeQL CLI have an associated CodeQL Bundle release that is semantically versioned.
|
||||
*/
|
||||
exports.CODEQL_VERSION_BUNDLE_SEMANTICALLY_VERSIONED = "2.13.4";
|
||||
/**
|
||||
* Versions 2.14.0+ of the CodeQL CLI support new analysis summaries.
|
||||
*/
|
||||
exports.CODEQL_VERSION_NEW_ANALYSIS_SUMMARY = "2.14.0";
|
||||
/**
|
||||
* Feature enablement as returned by the GitHub API endpoint.
|
||||
*
|
||||
@@ -73,7 +80,7 @@ exports.featureConfig = {
|
||||
},
|
||||
[Feature.NewAnalysisSummaryEnabled]: {
|
||||
envVar: "CODEQL_ACTION_NEW_ANALYSIS_SUMMARY",
|
||||
minimumVersion: codeql_1.CODEQL_VERSION_NEW_ANALYSIS_SUMMARY,
|
||||
minimumVersion: exports.CODEQL_VERSION_NEW_ANALYSIS_SUMMARY,
|
||||
defaultValue: false,
|
||||
},
|
||||
[Feature.QaTelemetryEnabled]: {
|
||||
@@ -205,7 +212,7 @@ class GitHubFeatureFlags {
|
||||
.map(([f, isEnabled]) => isEnabled ? this.getCliVersionFromFeatureFlag(f) : undefined)
|
||||
.filter((f) => f !== undefined &&
|
||||
// Only consider versions that have semantically versioned bundles.
|
||||
semver.gte(f, codeql_1.CODEQL_VERSION_BUNDLE_SEMANTICALLY_VERSIONED))
|
||||
semver.gte(f, exports.CODEQL_VERSION_BUNDLE_SEMANTICALLY_VERSIONED))
|
||||
.map((f) => f);
|
||||
if (enabledFeatureFlagCliVersions.length === 0) {
|
||||
// We expect at least one default CLI version to be enabled on Dotcom at any time. However if
|
||||
|
||||
Reference in New Issue
Block a user