mirror of
https://github.com/github/codeql-action.git
synced 2026-10-30 01:27:22 +00:00
Merge pull request #3484 from github/mbg/cli/force-nightly
Add feature for forcing the `nightly` bundle in `dynamic` workflows
This commit is contained in:
5
lib/analyze-action-post.js
generated
5
lib/analyze-action-post.js
generated
@@ -161566,6 +161566,11 @@ var featureConfig = {
|
||||
legacyApi: true,
|
||||
minimumVersion: void 0
|
||||
},
|
||||
["force_nightly" /* ForceNightly */]: {
|
||||
defaultValue: false,
|
||||
envVar: "CODEQL_ACTION_FORCE_NIGHTLY",
|
||||
minimumVersion: void 0
|
||||
},
|
||||
["ignore_generated_files" /* IgnoreGeneratedFiles */]: {
|
||||
defaultValue: false,
|
||||
envVar: "CODEQL_ACTION_IGNORE_GENERATED_FILES",
|
||||
|
||||
53
lib/analyze-action.js
generated
53
lib/analyze-action.js
generated
@@ -107118,6 +107118,7 @@ function formatDuration(durationMs) {
|
||||
|
||||
// src/diagnostics.ts
|
||||
var unwrittenDiagnostics = [];
|
||||
var unwrittenDefaultLanguageDiagnostics = [];
|
||||
function makeDiagnostic(id, name, data = void 0) {
|
||||
return {
|
||||
...data,
|
||||
@@ -107137,6 +107138,19 @@ function addDiagnostic(config, language, diagnostic) {
|
||||
unwrittenDiagnostics.push({ diagnostic, language });
|
||||
}
|
||||
}
|
||||
function addNoLanguageDiagnostic(config, diagnostic) {
|
||||
if (config !== void 0) {
|
||||
addDiagnostic(
|
||||
config,
|
||||
// Arbitrarily choose the first language. We could also choose all languages, but that
|
||||
// increases the risk of misinterpreting the data.
|
||||
config.languages[0],
|
||||
diagnostic
|
||||
);
|
||||
} else {
|
||||
unwrittenDefaultLanguageDiagnostics.push(diagnostic);
|
||||
}
|
||||
}
|
||||
function writeDiagnostic(config, language, diagnostic) {
|
||||
const logger = getActionsLogger();
|
||||
const databasePath = language ? getCodeQLDatabasePath(config, language) : config.dbLocation;
|
||||
@@ -107634,6 +107648,11 @@ var featureConfig = {
|
||||
legacyApi: true,
|
||||
minimumVersion: void 0
|
||||
},
|
||||
["force_nightly" /* ForceNightly */]: {
|
||||
defaultValue: false,
|
||||
envVar: "CODEQL_ACTION_FORCE_NIGHTLY",
|
||||
minimumVersion: void 0
|
||||
},
|
||||
["ignore_generated_files" /* IgnoreGeneratedFiles */]: {
|
||||
defaultValue: false,
|
||||
envVar: "CODEQL_ACTION_IGNORE_GENERATED_FILES",
|
||||
@@ -108980,10 +108999,36 @@ async function getCodeQLSource(toolsInput, defaultCliVersion, apiDetails, varian
|
||||
let cliVersion2;
|
||||
let tagName;
|
||||
let url2;
|
||||
if (toolsInput !== void 0 && CODEQL_NIGHTLY_TOOLS_INPUTS.includes(toolsInput)) {
|
||||
logger.info(
|
||||
`Using the latest CodeQL CLI nightly, as requested by 'tools: ${toolsInput}'.`
|
||||
);
|
||||
const canForceNightlyWithFF = isDynamicWorkflow() || isInTestMode();
|
||||
const forceNightlyValueFF = await features.getValue("force_nightly" /* ForceNightly */);
|
||||
const forceNightly = forceNightlyValueFF && canForceNightlyWithFF;
|
||||
const nightlyRequestedByToolsInput = toolsInput !== void 0 && CODEQL_NIGHTLY_TOOLS_INPUTS.includes(toolsInput);
|
||||
if (forceNightly || nightlyRequestedByToolsInput) {
|
||||
if (forceNightly) {
|
||||
logger.info(
|
||||
`Using the latest CodeQL CLI nightly, as forced by the ${"force_nightly" /* ForceNightly */} feature flag.`
|
||||
);
|
||||
addNoLanguageDiagnostic(
|
||||
void 0,
|
||||
makeDiagnostic(
|
||||
"codeql-action/forced-nightly-cli",
|
||||
"A nightly release of CodeQL was used",
|
||||
{
|
||||
markdownMessage: "GitHub configured this analysis to use a nightly release of CodeQL to allow you to preview changes from an upcoming release.\n\nNightly releases do not undergo the same validation as regular releases and may lead to analysis instability.\n\nIf use of a nightly CodeQL release for this analysis is unexpected, please contact GitHub support.",
|
||||
visibility: {
|
||||
cliSummaryTable: true,
|
||||
statusPage: true,
|
||||
telemetry: true
|
||||
},
|
||||
severity: "note"
|
||||
}
|
||||
)
|
||||
);
|
||||
} else {
|
||||
logger.info(
|
||||
`Using the latest CodeQL CLI nightly, as requested by 'tools: ${toolsInput}'.`
|
||||
);
|
||||
}
|
||||
toolsInput = await getNightlyToolsUrl(logger);
|
||||
}
|
||||
const forceShippedTools = toolsInput && CODEQL_BUNDLE_VERSION_ALIAS.includes(toolsInput);
|
||||
|
||||
5
lib/autobuild-action.js
generated
5
lib/autobuild-action.js
generated
@@ -103971,6 +103971,11 @@ var featureConfig = {
|
||||
legacyApi: true,
|
||||
minimumVersion: void 0
|
||||
},
|
||||
["force_nightly" /* ForceNightly */]: {
|
||||
defaultValue: false,
|
||||
envVar: "CODEQL_ACTION_FORCE_NIGHTLY",
|
||||
minimumVersion: void 0
|
||||
},
|
||||
["ignore_generated_files" /* IgnoreGeneratedFiles */]: {
|
||||
defaultValue: false,
|
||||
envVar: "CODEQL_ACTION_IGNORE_GENERATED_FILES",
|
||||
|
||||
1148
lib/init-action-post.js
generated
1148
lib/init-action-post.js
generated
File diff suppressed because it is too large
Load Diff
67
lib/init-action.js
generated
67
lib/init-action.js
generated
@@ -104575,6 +104575,7 @@ function formatDuration(durationMs) {
|
||||
|
||||
// src/diagnostics.ts
|
||||
var unwrittenDiagnostics = [];
|
||||
var unwrittenDefaultLanguageDiagnostics = [];
|
||||
function makeDiagnostic(id, name, data = void 0) {
|
||||
return {
|
||||
...data,
|
||||
@@ -104595,13 +104596,17 @@ function addDiagnostic(config, language, diagnostic) {
|
||||
}
|
||||
}
|
||||
function addNoLanguageDiagnostic(config, diagnostic) {
|
||||
addDiagnostic(
|
||||
config,
|
||||
// Arbitrarily choose the first language. We could also choose all languages, but that
|
||||
// increases the risk of misinterpreting the data.
|
||||
config.languages[0],
|
||||
diagnostic
|
||||
);
|
||||
if (config !== void 0) {
|
||||
addDiagnostic(
|
||||
config,
|
||||
// Arbitrarily choose the first language. We could also choose all languages, but that
|
||||
// increases the risk of misinterpreting the data.
|
||||
config.languages[0],
|
||||
diagnostic
|
||||
);
|
||||
} else {
|
||||
unwrittenDefaultLanguageDiagnostics.push(diagnostic);
|
||||
}
|
||||
}
|
||||
function writeDiagnostic(config, language, diagnostic) {
|
||||
const logger = getActionsLogger();
|
||||
@@ -104638,13 +104643,16 @@ function logUnwrittenDiagnostics() {
|
||||
}
|
||||
function flushDiagnostics(config) {
|
||||
const logger = getActionsLogger();
|
||||
logger.debug(
|
||||
`Writing ${unwrittenDiagnostics.length} diagnostic(s) to database.`
|
||||
);
|
||||
const diagnosticsCount = unwrittenDiagnostics.length + unwrittenDefaultLanguageDiagnostics.length;
|
||||
logger.debug(`Writing ${diagnosticsCount} diagnostic(s) to database.`);
|
||||
for (const unwritten of unwrittenDiagnostics) {
|
||||
writeDiagnostic(config, unwritten.language, unwritten.diagnostic);
|
||||
}
|
||||
for (const unwritten of unwrittenDefaultLanguageDiagnostics) {
|
||||
addNoLanguageDiagnostic(config, unwritten);
|
||||
}
|
||||
unwrittenDiagnostics = [];
|
||||
unwrittenDefaultLanguageDiagnostics = [];
|
||||
}
|
||||
function makeTelemetryDiagnostic(id, name, attributes) {
|
||||
return makeDiagnostic(id, name, {
|
||||
@@ -105167,6 +105175,11 @@ var featureConfig = {
|
||||
legacyApi: true,
|
||||
minimumVersion: void 0
|
||||
},
|
||||
["force_nightly" /* ForceNightly */]: {
|
||||
defaultValue: false,
|
||||
envVar: "CODEQL_ACTION_FORCE_NIGHTLY",
|
||||
minimumVersion: void 0
|
||||
},
|
||||
["ignore_generated_files" /* IgnoreGeneratedFiles */]: {
|
||||
defaultValue: false,
|
||||
envVar: "CODEQL_ACTION_IGNORE_GENERATED_FILES",
|
||||
@@ -107383,10 +107396,36 @@ async function getCodeQLSource(toolsInput, defaultCliVersion, apiDetails, varian
|
||||
let cliVersion2;
|
||||
let tagName;
|
||||
let url;
|
||||
if (toolsInput !== void 0 && CODEQL_NIGHTLY_TOOLS_INPUTS.includes(toolsInput)) {
|
||||
logger.info(
|
||||
`Using the latest CodeQL CLI nightly, as requested by 'tools: ${toolsInput}'.`
|
||||
);
|
||||
const canForceNightlyWithFF = isDynamicWorkflow() || isInTestMode();
|
||||
const forceNightlyValueFF = await features.getValue("force_nightly" /* ForceNightly */);
|
||||
const forceNightly = forceNightlyValueFF && canForceNightlyWithFF;
|
||||
const nightlyRequestedByToolsInput = toolsInput !== void 0 && CODEQL_NIGHTLY_TOOLS_INPUTS.includes(toolsInput);
|
||||
if (forceNightly || nightlyRequestedByToolsInput) {
|
||||
if (forceNightly) {
|
||||
logger.info(
|
||||
`Using the latest CodeQL CLI nightly, as forced by the ${"force_nightly" /* ForceNightly */} feature flag.`
|
||||
);
|
||||
addNoLanguageDiagnostic(
|
||||
void 0,
|
||||
makeDiagnostic(
|
||||
"codeql-action/forced-nightly-cli",
|
||||
"A nightly release of CodeQL was used",
|
||||
{
|
||||
markdownMessage: "GitHub configured this analysis to use a nightly release of CodeQL to allow you to preview changes from an upcoming release.\n\nNightly releases do not undergo the same validation as regular releases and may lead to analysis instability.\n\nIf use of a nightly CodeQL release for this analysis is unexpected, please contact GitHub support.",
|
||||
visibility: {
|
||||
cliSummaryTable: true,
|
||||
statusPage: true,
|
||||
telemetry: true
|
||||
},
|
||||
severity: "note"
|
||||
}
|
||||
)
|
||||
);
|
||||
} else {
|
||||
logger.info(
|
||||
`Using the latest CodeQL CLI nightly, as requested by 'tools: ${toolsInput}'.`
|
||||
);
|
||||
}
|
||||
toolsInput = await getNightlyToolsUrl(logger);
|
||||
}
|
||||
const forceShippedTools = toolsInput && CODEQL_BUNDLE_VERSION_ALIAS.includes(toolsInput);
|
||||
|
||||
5
lib/resolve-environment-action.js
generated
5
lib/resolve-environment-action.js
generated
@@ -103958,6 +103958,11 @@ var featureConfig = {
|
||||
legacyApi: true,
|
||||
minimumVersion: void 0
|
||||
},
|
||||
["force_nightly" /* ForceNightly */]: {
|
||||
defaultValue: false,
|
||||
envVar: "CODEQL_ACTION_FORCE_NIGHTLY",
|
||||
minimumVersion: void 0
|
||||
},
|
||||
["ignore_generated_files" /* IgnoreGeneratedFiles */]: {
|
||||
defaultValue: false,
|
||||
envVar: "CODEQL_ACTION_IGNORE_GENERATED_FILES",
|
||||
|
||||
572
lib/setup-codeql-action.js
generated
572
lib/setup-codeql-action.js
generated
File diff suppressed because it is too large
Load Diff
5
lib/start-proxy-action-post.js
generated
5
lib/start-proxy-action-post.js
generated
@@ -160972,6 +160972,11 @@ var featureConfig = {
|
||||
legacyApi: true,
|
||||
minimumVersion: void 0
|
||||
},
|
||||
["force_nightly" /* ForceNightly */]: {
|
||||
defaultValue: false,
|
||||
envVar: "CODEQL_ACTION_FORCE_NIGHTLY",
|
||||
minimumVersion: void 0
|
||||
},
|
||||
["ignore_generated_files" /* IgnoreGeneratedFiles */]: {
|
||||
defaultValue: false,
|
||||
envVar: "CODEQL_ACTION_IGNORE_GENERATED_FILES",
|
||||
|
||||
5
lib/start-proxy-action.js
generated
5
lib/start-proxy-action.js
generated
@@ -120664,6 +120664,11 @@ var featureConfig = {
|
||||
legacyApi: true,
|
||||
minimumVersion: void 0
|
||||
},
|
||||
["force_nightly" /* ForceNightly */]: {
|
||||
defaultValue: false,
|
||||
envVar: "CODEQL_ACTION_FORCE_NIGHTLY",
|
||||
minimumVersion: void 0
|
||||
},
|
||||
["ignore_generated_files" /* IgnoreGeneratedFiles */]: {
|
||||
defaultValue: false,
|
||||
envVar: "CODEQL_ACTION_IGNORE_GENERATED_FILES",
|
||||
|
||||
621
lib/upload-lib.js
generated
621
lib/upload-lib.js
generated
File diff suppressed because it is too large
Load Diff
5
lib/upload-sarif-action-post.js
generated
5
lib/upload-sarif-action-post.js
generated
@@ -161134,6 +161134,11 @@ var featureConfig = {
|
||||
legacyApi: true,
|
||||
minimumVersion: void 0
|
||||
},
|
||||
["force_nightly" /* ForceNightly */]: {
|
||||
defaultValue: false,
|
||||
envVar: "CODEQL_ACTION_FORCE_NIGHTLY",
|
||||
minimumVersion: void 0
|
||||
},
|
||||
["ignore_generated_files" /* IgnoreGeneratedFiles */]: {
|
||||
defaultValue: false,
|
||||
envVar: "CODEQL_ACTION_IGNORE_GENERATED_FILES",
|
||||
|
||||
604
lib/upload-sarif-action.js
generated
604
lib/upload-sarif-action.js
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user