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
|
* - We approximate whether manual build steps are present by looking at
|
||||||
* whether any extraction output already exists for Go.
|
* whether any extraction output already exists for Go.
|
||||||
*/
|
*/
|
||||||
async function runGoAutobuilderIfLegacyWorkflow(config, featureFlags, logger) {
|
async function runAutobuildIfLegacyGoWorkflow(config, featureFlags, logger) {
|
||||||
// Only proceed if the beta Go extraction reconciliation behavior is
|
if (!config.languages.includes(languages_1.Language.go)) {
|
||||||
// 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.");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!config.languages.includes(languages_1.Language.go)) {
|
if (process.env["CODEQL_ACTION_RECONCILE_GO_EXTRACTION"] !== "true" &&
|
||||||
logger.info("Won't run the Go autobuilder since Go analysis is not enabled.");
|
!(await featureFlags.getValue(feature_flags_1.FeatureFlag.GolangExtractionReconciliationEnabled))) {
|
||||||
|
logger.debug("Won't run Go autobuild since Go extraction reconciliation is not enabled.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (process.env["CODEQL_ACTION_DID_AUTOBUILD_GOLANG"] === "true") {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
// This captures whether a user has added manual build steps for Go
|
// This captures whether a user has added manual build steps for Go
|
||||||
if (doesGoExtractionOutputExist(config)) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
await (0, autobuild_1.runAutobuild)(languages_1.Language.go, config, logger);
|
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 repositoryNwo = (0, repository_1.parseRepositoryNwo)(util.getRequiredEnvParam("GITHUB_REPOSITORY"));
|
||||||
const gitHubVersion = await (0, api_client_1.getGitHubVersionActionsOnly)();
|
const gitHubVersion = await (0, api_client_1.getGitHubVersionActionsOnly)();
|
||||||
const featureFlags = new feature_flags_1.GitHubFeatureFlags(gitHubVersion, apiDetails, repositoryNwo, logger);
|
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);
|
dbCreationTimings = await (0, analyze_1.runFinalize)(outputDir, threads, memory, config, logger, featureFlags);
|
||||||
if (actionsUtil.getRequiredInput("skip-queries") !== "true") {
|
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);
|
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
|
* - We approximate whether manual build steps are present by looking at
|
||||||
* whether any extraction output already exists for Go.
|
* whether any extraction output already exists for Go.
|
||||||
*/
|
*/
|
||||||
async function runGoAutobuilderIfLegacyWorkflow(
|
async function runAutobuildIfLegacyGoWorkflow(
|
||||||
config: Config,
|
config: Config,
|
||||||
featureFlags: FeatureFlags,
|
featureFlags: FeatureFlags,
|
||||||
logger: Logger
|
logger: Logger
|
||||||
) {
|
) {
|
||||||
// Only proceed if the beta Go extraction reconciliation behavior is
|
if (!config.languages.includes(Language.go)) {
|
||||||
// enabled.
|
return;
|
||||||
|
}
|
||||||
if (
|
if (
|
||||||
process.env["CODEQL_ACTION_RECONCILE_GO_EXTRACTION"] !== "true" &&
|
process.env["CODEQL_ACTION_RECONCILE_GO_EXTRACTION"] !== "true" &&
|
||||||
!(await featureFlags.getValue(
|
!(await featureFlags.getValue(
|
||||||
|
|
@ -152,24 +153,22 @@ async function runGoAutobuilderIfLegacyWorkflow(
|
||||||
))
|
))
|
||||||
) {
|
) {
|
||||||
logger.debug(
|
logger.debug(
|
||||||
"Won't run the Go autobuilder since Go extraction reconciliation is not enabled."
|
"Won't run Go autobuild 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."
|
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (process.env["CODEQL_ACTION_DID_AUTOBUILD_GOLANG"] === "true") {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
// This captures whether a user has added manual build steps for Go
|
// This captures whether a user has added manual build steps for Go
|
||||||
if (doesGoExtractionOutputExist(config)) {
|
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(
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -245,7 +244,7 @@ async function run() {
|
||||||
logger
|
logger
|
||||||
);
|
);
|
||||||
|
|
||||||
await runGoAutobuilderIfLegacyWorkflow(config, featureFlags, logger);
|
await runAutobuildIfLegacyGoWorkflow(config, featureFlags, logger);
|
||||||
|
|
||||||
dbCreationTimings = await runFinalize(
|
dbCreationTimings = await runFinalize(
|
||||||
outputDir,
|
outputDir,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue