Stop running fallback Go autobuild if database is finalized (#1405)
This commit is contained in:
parent
a631f4b016
commit
9af9a11da8
3 changed files with 16 additions and 1 deletions
6
lib/analyze-action.js
generated
6
lib/analyze-action.js
generated
|
|
@ -103,6 +103,8 @@ function doesGoExtractionOutputExist(config) {
|
||||||
* - We detect whether an autobuild step is present by checking the
|
* - We detect whether an autobuild step is present by checking the
|
||||||
* `util.DID_AUTOBUILD_GO_ENV_VAR_NAME` environment variable, which is set
|
* `util.DID_AUTOBUILD_GO_ENV_VAR_NAME` environment variable, which is set
|
||||||
* when the autobuilder is invoked.
|
* when the autobuilder is invoked.
|
||||||
|
* - We detect whether the Go database has already been finalized in case it
|
||||||
|
* has been manually set in a prior Action step.
|
||||||
* - 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.
|
||||||
*/
|
*/
|
||||||
|
|
@ -114,6 +116,10 @@ async function runAutobuildIfLegacyGoWorkflow(config, logger) {
|
||||||
logger.debug("Won't run Go autobuild since it has already been run.");
|
logger.debug("Won't run Go autobuild since it has already been run.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if ((0, analyze_1.dbIsFinalized)(config, languages_1.Language.go, logger)) {
|
||||||
|
logger.debug("Won't run Go autobuild since there is already a finalized database for Go.");
|
||||||
|
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.debug("Won't run Go autobuild since at least one file of Go code has already been extracted.");
|
logger.debug("Won't run Go autobuild since at least one file of Go code has already been extracted.");
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -9,6 +9,7 @@ import * as actionsUtil from "./actions-util";
|
||||||
import { DatabaseCreationTimings } from "./actions-util";
|
import { DatabaseCreationTimings } from "./actions-util";
|
||||||
import {
|
import {
|
||||||
CodeQLAnalysisError,
|
CodeQLAnalysisError,
|
||||||
|
dbIsFinalized,
|
||||||
QueriesStatusReport,
|
QueriesStatusReport,
|
||||||
runCleanup,
|
runCleanup,
|
||||||
runFinalize,
|
runFinalize,
|
||||||
|
|
@ -134,6 +135,8 @@ function doesGoExtractionOutputExist(config: Config): boolean {
|
||||||
* - We detect whether an autobuild step is present by checking the
|
* - We detect whether an autobuild step is present by checking the
|
||||||
* `util.DID_AUTOBUILD_GO_ENV_VAR_NAME` environment variable, which is set
|
* `util.DID_AUTOBUILD_GO_ENV_VAR_NAME` environment variable, which is set
|
||||||
* when the autobuilder is invoked.
|
* when the autobuilder is invoked.
|
||||||
|
* - We detect whether the Go database has already been finalized in case it
|
||||||
|
* has been manually set in a prior Action step.
|
||||||
* - 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.
|
||||||
*/
|
*/
|
||||||
|
|
@ -145,6 +148,12 @@ async function runAutobuildIfLegacyGoWorkflow(config: Config, logger: Logger) {
|
||||||
logger.debug("Won't run Go autobuild since it has already been run.");
|
logger.debug("Won't run Go autobuild since it has already been run.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (dbIsFinalized(config, Language.go, logger)) {
|
||||||
|
logger.debug(
|
||||||
|
"Won't run Go autobuild since there is already a finalized database for Go."
|
||||||
|
);
|
||||||
|
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.debug(
|
logger.debug(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue