Improve clarity of logging
This commit is contained in:
parent
8e0846caf0
commit
fe1bd9ac76
3 changed files with 25 additions and 25 deletions
23
lib/analyze-action.js
generated
23
lib/analyze-action.js
generated
|
|
@ -107,25 +107,26 @@ function doesGoExtractionOutputExist(config) {
|
|||
* - We approximate whether manual build steps are present by looking at
|
||||
* whether any extraction output already exists for Go.
|
||||
*/
|
||||
async function runGoAutobuilderIfLegacyWorkflow(config, featureFlags, logger) {
|
||||
// Only proceed if the beta Go extraction reconciliation behavior is
|
||||
// enabled.
|
||||
if (process.env["CODEQL_ACTION_RECONCILE_GO_EXTRACTION"] !== "true" &&
|
||||
!(await featureFlags.getValue(feature_flags_1.FeatureFlag.GolangExtractionReconciliationEnabled))) {
|
||||
logger.debug("Won't run the Go autobuilder since Go extraction reconciliation is not enabled.");
|
||||
async function runAutobuildIfLegacyGoWorkflow(config, featureFlags, logger) {
|
||||
if (!config.languages.includes(languages_1.Language.go)) {
|
||||
return;
|
||||
}
|
||||
if (!config.languages.includes(languages_1.Language.go)) {
|
||||
logger.info("Won't run the Go autobuilder since Go analysis is not enabled.");
|
||||
if (process.env["CODEQL_ACTION_RECONCILE_GO_EXTRACTION"] !== "true" &&
|
||||
!(await featureFlags.getValue(feature_flags_1.FeatureFlag.GolangExtractionReconciliationEnabled))) {
|
||||
logger.debug("Won't run Go autobuild since Go extraction reconciliation is not enabled.");
|
||||
return;
|
||||
}
|
||||
if (process.env["CODEQL_ACTION_DID_AUTOBUILD_GOLANG"] === "true") {
|
||||
logger.info("Won't run the Go autobuilder since it has already been run.");
|
||||
// This log line is info level while Go extraction reconciliation is in beta.
|
||||
// We will make it debug level once Go extraction reconciliation is GA.
|
||||
logger.info("Won't run Go autobuild since it has already been run.");
|
||||
return;
|
||||
}
|
||||
// This captures whether a user has added manual build steps for Go
|
||||
if (doesGoExtractionOutputExist(config)) {
|
||||
logger.info("Won't run the Go autobuilder since at least one file of Go code has already been extracted.");
|
||||
// This log line is info level while Go extraction reconciliation is in beta.
|
||||
// We will make it debug level once Go extraction reconciliation is GA.
|
||||
logger.info("Won't run Go autobuild since at least one file of Go code has already been extracted.");
|
||||
return;
|
||||
}
|
||||
await (0, autobuild_1.runAutobuild)(languages_1.Language.go, config, logger);
|
||||
|
|
@ -164,7 +165,7 @@ async function run() {
|
|||
const repositoryNwo = (0, repository_1.parseRepositoryNwo)(util.getRequiredEnvParam("GITHUB_REPOSITORY"));
|
||||
const gitHubVersion = await (0, api_client_1.getGitHubVersionActionsOnly)();
|
||||
const featureFlags = new feature_flags_1.GitHubFeatureFlags(gitHubVersion, apiDetails, repositoryNwo, logger);
|
||||
await runGoAutobuilderIfLegacyWorkflow(config, featureFlags, logger);
|
||||
await runAutobuildIfLegacyGoWorkflow(config, featureFlags, logger);
|
||||
dbCreationTimings = await (0, analyze_1.runFinalize)(outputDir, threads, memory, config, logger, featureFlags);
|
||||
if (actionsUtil.getRequiredInput("skip-queries") !== "true") {
|
||||
runStats = await (0, analyze_1.runQueries)(outputDir, memory, util.getAddSnippetsFlag(actionsUtil.getRequiredInput("add-snippets")), threads, actionsUtil.getOptionalInput("category"), config, logger);
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -138,13 +138,14 @@ function doesGoExtractionOutputExist(config: Config): boolean {
|
|||
* - We approximate whether manual build steps are present by looking at
|
||||
* whether any extraction output already exists for Go.
|
||||
*/
|
||||
async function runGoAutobuilderIfLegacyWorkflow(
|
||||
async function runAutobuildIfLegacyGoWorkflow(
|
||||
config: Config,
|
||||
featureFlags: FeatureFlags,
|
||||
logger: Logger
|
||||
) {
|
||||
// Only proceed if the beta Go extraction reconciliation behavior is
|
||||
// enabled.
|
||||
if (!config.languages.includes(Language.go)) {
|
||||
return;
|
||||
}
|
||||
if (
|
||||
process.env["CODEQL_ACTION_RECONCILE_GO_EXTRACTION"] !== "true" &&
|
||||
!(await featureFlags.getValue(
|
||||
|
|
@ -152,24 +153,22 @@ async function runGoAutobuilderIfLegacyWorkflow(
|
|||
))
|
||||
) {
|
||||
logger.debug(
|
||||
"Won't run the Go autobuilder since Go extraction reconciliation is not enabled."
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (!config.languages.includes(Language.go)) {
|
||||
logger.info(
|
||||
"Won't run the Go autobuilder since Go analysis is not enabled."
|
||||
"Won't run Go autobuild since Go extraction reconciliation is not enabled."
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (process.env["CODEQL_ACTION_DID_AUTOBUILD_GOLANG"] === "true") {
|
||||
logger.info("Won't run the Go autobuilder since it has already been run.");
|
||||
// This log line is info level while Go extraction reconciliation is in beta.
|
||||
// We will make it debug level once Go extraction reconciliation is GA.
|
||||
logger.info("Won't run Go autobuild since it has already been run.");
|
||||
return;
|
||||
}
|
||||
// This captures whether a user has added manual build steps for Go
|
||||
if (doesGoExtractionOutputExist(config)) {
|
||||
// This log line is info level while Go extraction reconciliation is in beta.
|
||||
// We will make it debug level once Go extraction reconciliation is GA.
|
||||
logger.info(
|
||||
"Won't run the Go autobuilder since at least one file of Go code has already been extracted."
|
||||
"Won't run Go autobuild since at least one file of Go code has already been extracted."
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
|
@ -245,7 +244,7 @@ async function run() {
|
|||
logger
|
||||
);
|
||||
|
||||
await runGoAutobuilderIfLegacyWorkflow(config, featureFlags, logger);
|
||||
await runAutobuildIfLegacyGoWorkflow(config, featureFlags, logger);
|
||||
|
||||
dbCreationTimings = await runFinalize(
|
||||
outputDir,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue